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

Side by Side Diff: components/search_engines/default_search_manager.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search_engines/default_search_manager.h" 5 #include "components/search_engines/default_search_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 prefs_default_search_->input_encodings.push_back(encoding); 391 prefs_default_search_->input_encodings.push_back(encoding);
392 } 392 }
393 } 393 }
394 394
395 url_dict->GetString(kSearchTermsReplacementKey, 395 url_dict->GetString(kSearchTermsReplacementKey,
396 &prefs_default_search_->search_terms_replacement_key); 396 &prefs_default_search_->search_terms_replacement_key);
397 397
398 url_dict->GetBoolean(kCreatedByPolicy, 398 url_dict->GetBoolean(kCreatedByPolicy,
399 &prefs_default_search_->created_by_policy); 399 &prefs_default_search_->created_by_policy);
400 400
401 prefs_default_search_->show_in_default_list = true;
402 MergePrefsDataWithPrepopulated(); 401 MergePrefsDataWithPrepopulated();
403 } 402 }
404 403
405 void DefaultSearchManager::LoadPrepopulatedDefaultSearch() { 404 void DefaultSearchManager::LoadPrepopulatedDefaultSearch() {
406 std::unique_ptr<TemplateURLData> data = 405 std::unique_ptr<TemplateURLData> data =
407 TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(pref_service_); 406 TemplateURLPrepopulateData::GetPrepopulatedDefaultSearch(pref_service_);
408 fallback_default_search_ = std::move(data); 407 fallback_default_search_ = std::move(data);
409 MergePrefsDataWithPrepopulated(); 408 MergePrefsDataWithPrepopulated();
410 } 409 }
411 410
412 void DefaultSearchManager::NotifyObserver() { 411 void DefaultSearchManager::NotifyObserver() {
413 if (!change_observer_.is_null()) { 412 if (!change_observer_.is_null()) {
414 Source source = FROM_FALLBACK; 413 Source source = FROM_FALLBACK;
415 TemplateURLData* data = GetDefaultSearchEngine(&source); 414 TemplateURLData* data = GetDefaultSearchEngine(&source);
416 change_observer_.Run(data, source); 415 change_observer_.Run(data, source);
417 } 416 }
418 } 417 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698