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

Unified Diff: chrome/browser/ui/search_engines/template_url_table_model.cc

Issue 2487633003: Change behaivor to decide whether a search engine should be shown in the default list (Closed)
Patch Set: Update based on Peter and Nicolas's comments. 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: chrome/browser/ui/search_engines/template_url_table_model.cc
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc
index bbfb283c9d0a946e812b563c12e54bb59952919b..b86a1ea2656fef2ce8ca5ef466fcf49b9fe4f3ba 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -143,16 +143,13 @@ void TemplateURLTableModel::Reload() {
extension_entries;
// Keywords that can be made the default first.
for (auto* template_url : urls) {
- // NOTE: we don't use ShowInDefaultList here to avoid items bouncing around
- // the lists while editing.
- if (template_url->show_in_default_list())
- default_entries.push_back(
- base::MakeUnique<ModelEntry>(this, template_url));
+ auto entry = base::MakeUnique<ModelEntry>(this, template_url);
+ if (template_url_service_->ShowInDefaultList(template_url))
+ default_entries.push_back(std::move(entry));
else if (template_url->type() == TemplateURL::OMNIBOX_API_EXTENSION)
- extension_entries.push_back(
- base::MakeUnique<ModelEntry>(this, template_url));
+ extension_entries.push_back(std::move(entry));
else
- other_entries.push_back(base::MakeUnique<ModelEntry>(this, template_url));
+ other_entries.push_back(std::move(entry));
}
last_search_engine_index_ = static_cast<int>(default_entries.size());

Powered by Google App Engine
This is Rietveld 408576698