mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibWebView: Store search engine names/URLs as String
In order to support custom search engines, we will need to store the engine properties as String to hold user-provided data. This also caused a compile error trying to assign Optional<SearchEngine> to Optional<SearchEngine const&>, so there's a bit of extra churn here.
This commit is contained in:
parent
7f37a8f60f
commit
cbee476dac
Notes:
github-actions[bot]
2025-04-06 11:46:16 +00:00
Author: https://github.com/trflynn89
Commit: cbee476dac
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4237
2 changed files with 19 additions and 19 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2023-2025, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -7,17 +7,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
|
||||
namespace WebView {
|
||||
|
||||
struct SearchEngine {
|
||||
StringView name;
|
||||
StringView query_url;
|
||||
String name;
|
||||
String query_url;
|
||||
};
|
||||
|
||||
ReadonlySpan<SearchEngine> search_engines();
|
||||
Optional<SearchEngine const&> find_search_engine_by_name(StringView name);
|
||||
Optional<SearchEngine> find_search_engine_by_name(StringView name);
|
||||
Optional<SearchEngine const&> find_search_engine_by_query_url(StringView query_url);
|
||||
String format_search_query_for_display(StringView query_url, StringView query);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue