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

Side by Side Diff: chrome/browser/search_engines/default_search_pref_migration.cc

Issue 355853002: Componentize TemplateURLPrepopulateData, DefaultSearchManager and DefaultSearchPolicyHandler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing comma in gyp Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
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 "chrome/browser/search_engines/default_search_pref_migration.h" 5 #include "chrome/browser/search_engines/default_search_pref_migration.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "chrome/browser/search_engines/default_search_manager.h"
14 #include "chrome/browser/search_engines/template_url_service.h" 13 #include "chrome/browser/search_engines/template_url_service.h"
14 #include "components/search_engines/default_search_manager.h"
15 #include "components/search_engines/search_engines_pref_names.h" 15 #include "components/search_engines/search_engines_pref_names.h"
16 #include "components/search_engines/template_url_data.h" 16 #include "components/search_engines/template_url_data.h"
17 17
18 namespace { 18 namespace {
19 19
20 // Loads the user-selected DSE (if there is one, and it's not masked by policy 20 // Loads the user-selected DSE (if there is one, and it's not masked by policy
21 // or an extension) from legacy preferences. 21 // or an extension) from legacy preferences.
22 scoped_ptr<TemplateURLData> LoadDefaultSearchProviderFromPrefs( 22 scoped_ptr<TemplateURLData> LoadDefaultSearchProviderFromPrefs(
23 PrefService* pref_service) { 23 PrefService* pref_service) {
24 scoped_ptr<TemplateURLData> legacy_dse_from_prefs; 24 scoped_ptr<TemplateURLData> legacy_dse_from_prefs;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void ConfigureDefaultSearchPrefMigrationToDictionaryValue( 88 void ConfigureDefaultSearchPrefMigrationToDictionaryValue(
89 PrefService* pref_service) { 89 PrefService* pref_service) {
90 if (pref_service->GetInitializationStatus() == 90 if (pref_service->GetInitializationStatus() ==
91 PrefService::INITIALIZATION_STATUS_WAITING) { 91 PrefService::INITIALIZATION_STATUS_WAITING) {
92 pref_service->AddPrefInitObserver( 92 pref_service->AddPrefInitObserver(
93 base::Bind(&OnPrefsInitialized, base::Unretained(pref_service))); 93 base::Bind(&OnPrefsInitialized, base::Unretained(pref_service)));
94 } else { 94 } else {
95 MigrateDefaultSearchPref(pref_service); 95 MigrateDefaultSearchPref(pref_service);
96 } 96 }
97 } 97 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698