Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Unified Diff: components/search_engines/template_url_data.h

Issue 2497853002: Create TemplateUrlData to base::Dictionary utility functions (Closed)
Patch Set: Fixed android compilation Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/search_engines/template_url_data.h
diff --git a/components/search_engines/template_url_data.h b/components/search_engines/template_url_data.h
index 8036bc77729a658b9d097ad56b7ae46a520ef425..4b3479a96a2f37af235677ea082bff077a2410e0 100644
--- a/components/search_engines/template_url_data.h
+++ b/components/search_engines/template_url_data.h
@@ -13,12 +13,40 @@
#include "components/search_engines/template_url_id.h"
#include "url/gurl.h"
+namespace base {
+class ListValue;
+}
+
// The data for the TemplateURL. Separating this into its own class allows most
// users to do SSA-style usage of TemplateURL: construct a TemplateURLData with
// whatever fields are desired, then create an immutable TemplateURL from it.
struct TemplateURLData {
TemplateURLData();
TemplateURLData(const TemplateURLData& other);
+ // Creates a TemplateURLData suitable for prepopulated engines.
+ // Note that unlike in the default constructor, |safe_for_autoreplace| will
+ // be set to true. date_created and last_modified will be set to null time
+ // value, instead of current time.
+ // StringPiece in arguments is used to pass const char* pointer members
+ // of PrepopulatedEngine structure which can be nullptr.
+ TemplateURLData(const base::string16& name,
+ const base::string16& keyword,
+ base::StringPiece search_url,
+ base::StringPiece suggest_url,
+ base::StringPiece instant_url,
+ base::StringPiece image_url,
+ base::StringPiece new_tab_url,
+ base::StringPiece contextual_search_url,
+ base::StringPiece search_url_post_params,
+ base::StringPiece suggest_url_post_params,
+ base::StringPiece instant_url_post_params,
+ base::StringPiece image_url_post_params,
+ base::StringPiece favicon_url,
+ base::StringPiece encoding,
+ const base::ListValue& alternate_urls_list,
+ base::StringPiece search_terms_replacement_key,
+ int prepopulate_id);
+
~TemplateURLData();
// A short description of the template. This is the name we show to the user
« no previous file with comments | « components/search_engines/default_search_policy_handler_unittest.cc ('k') | components/search_engines/template_url_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698