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

Unified Diff: components/search_engines/template_url.h

Issue 2347973002: Enable Chrome to tweak search engines for some locales (Closed)
Patch Set: fix compile Created 4 years, 3 months 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.h
diff --git a/components/search_engines/template_url.h b/components/search_engines/template_url.h
index 04a66bc6551416b5308caf4a0ef8223a80df00f0..48f44778d3323b134c6f8cf887a7b253dd3dbf76 100644
--- a/components/search_engines/template_url.h
+++ b/components/search_engines/template_url.h
@@ -498,16 +498,16 @@ class TemplateURL {
NORMAL_CONTROLLED_BY_EXTENSION,
// The keyword associated with an extension that uses the Omnibox API.
OMNIBOX_API_EXTENSION,
+ // Installed only on this device. Should not be synced.
+ LOCAL,
};
// An AssociatedExtensionInfo represents information about the extension that
// added the search engine.
struct AssociatedExtensionInfo {
- AssociatedExtensionInfo(Type type, const std::string& extension_id);
+ AssociatedExtensionInfo(const std::string& extension_id);
Peter Kasting 2016/09/21 21:45:08 Nit: explicit
Ian Wen 2016/09/21 23:12:38 Done.
~AssociatedExtensionInfo();
- Type type;
-
std::string extension_id;
// Whether the search engine is supposed to be default.
@@ -518,7 +518,7 @@ class TemplateURL {
base::Time install_time;
};
- explicit TemplateURL(const TemplateURLData& data);
+ TemplateURL(const TemplateURLData& data, Type type = NORMAL);
Peter Kasting 2016/09/21 21:45:08 Nit: I think this still needs "explicit"? Or does
Ian Wen 2016/09/21 23:12:38 Compiler allows it. Yet I agree explicit should be
Peter Kasting 2016/09/23 01:28:36 What I meant was, if the compiler allows it, we de
~TemplateURL();
// Generates a suitable keyword for the specified url, which must be valid.
@@ -612,6 +612,9 @@ class TemplateURL {
return contextual_search_url_ref_;
}
+ Type type() const { return type_; }
+ void set_type(Type type) { type_ = type; }
+
// This setter shouldn't be used except by TemplateURLService and
// TemplateURLServiceClient implementations.
void set_extension_info(
@@ -637,8 +640,6 @@ class TemplateURL {
bool HasSameKeywordAs(const TemplateURLData& other,
const SearchTermsData& search_terms_data) const;
- Type GetType() const;
-
// Returns the id of the extension that added this search engine. Only call
// this for TemplateURLs of type NORMAL_CONTROLLED_BY_EXTENSION or
// OMNIBOX_API_EXTENSION.
@@ -757,6 +758,8 @@ class TemplateURL {
// Caches the computed engine type across successive calls to GetEngineType().
mutable SearchEngineType engine_type_;
+ Type type_;
Peter Kasting 2016/09/21 21:45:08 Nit: I'd probably place this above |engine_type_|.
Ian Wen 2016/09/21 23:12:38 Done.
+
// TODO(sky): Add date last parsed OSD file.
DISALLOW_COPY_AND_ASSIGN(TemplateURL);

Powered by Google App Engine
This is Rietveld 408576698