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

Unified Diff: components/search_engines/template_url.cc

Issue 2347973002: Enable Chrome to tweak search engines for some locales (Closed)
Patch Set: comments 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.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index a3be5cff8ebc067e03bc80fb10cf22c57bc3372d..085a41e47d40262ae40fb74b39a6bfbf3593768c 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -1199,14 +1199,13 @@ TemplateURL::AssociatedExtensionInfo::~AssociatedExtensionInfo() {
TemplateURL::TemplateURL(const TemplateURLData& data)
: data_(data),
url_ref_(nullptr),
- suggestions_url_ref_(this,
- TemplateURLRef::SUGGEST),
- instant_url_ref_(this,
- TemplateURLRef::INSTANT),
+ suggestions_url_ref_(this, TemplateURLRef::SUGGEST),
+ instant_url_ref_(this, TemplateURLRef::INSTANT),
image_url_ref_(this, TemplateURLRef::IMAGE),
new_tab_url_ref_(this, TemplateURLRef::NEW_TAB),
contextual_search_url_ref_(this, TemplateURLRef::CONTEXTUAL_SEARCH),
- engine_type_(SEARCH_ENGINE_UNKNOWN) {
+ engine_type_(SEARCH_ENGINE_UNKNOWN),
+ type_(NORMAL) {
ResizeURLRefVector();
SetPrepopulateId(data_.prepopulate_id);
@@ -1326,7 +1325,11 @@ bool TemplateURL::HasSameKeywordAs(
}
TemplateURL::Type TemplateURL::GetType() const {
- return extension_info_ ? extension_info_->type : NORMAL;
+ return extension_info_ ? extension_info_->type : type_;
+}
+
+void TemplateURL::SetType(Type type) {
+ type_ = type;
}
std::string TemplateURL::GetExtensionId() const {

Powered by Google App Engine
This is Rietveld 408576698