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

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 266553002: Add TrackedPreferenceValidationDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mnissler nits Created 6 years, 6 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
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "chrome/browser/net/pref_proxy_config_tracker.h" 54 #include "chrome/browser/net/pref_proxy_config_tracker.h"
55 #include "chrome/browser/net/proxy_service_factory.h" 55 #include "chrome/browser/net/proxy_service_factory.h"
56 #include "chrome/browser/net/ssl_config_service_manager.h" 56 #include "chrome/browser/net/ssl_config_service_manager.h"
57 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 57 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
58 #include "chrome/browser/plugins/plugin_prefs.h" 58 #include "chrome/browser/plugins/plugin_prefs.h"
59 #include "chrome/browser/policy/profile_policy_connector.h" 59 #include "chrome/browser/policy/profile_policy_connector.h"
60 #include "chrome/browser/policy/profile_policy_connector_factory.h" 60 #include "chrome/browser/policy/profile_policy_connector_factory.h"
61 #include "chrome/browser/prefs/browser_prefs.h" 61 #include "chrome/browser/prefs/browser_prefs.h"
62 #include "chrome/browser/prefs/chrome_pref_service_factory.h" 62 #include "chrome/browser/prefs/chrome_pref_service_factory.h"
63 #include "chrome/browser/prefs/pref_service_syncable.h" 63 #include "chrome/browser/prefs/pref_service_syncable.h"
64 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h"
64 #include "chrome/browser/prerender/prerender_manager_factory.h" 65 #include "chrome/browser/prerender/prerender_manager_factory.h"
65 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" 66 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h"
66 #include "chrome/browser/profiles/chrome_version_service.h" 67 #include "chrome/browser/profiles/chrome_version_service.h"
67 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" 68 #include "chrome/browser/profiles/gaia_info_update_service_factory.h"
68 #include "chrome/browser/profiles/profile_destroyer.h" 69 #include "chrome/browser/profiles/profile_destroyer.h"
69 #include "chrome/browser/profiles/profile_info_cache.h" 70 #include "chrome/browser/profiles/profile_info_cache.h"
70 #include "chrome/browser/profiles/profile_manager.h" 71 #include "chrome/browser/profiles/profile_manager.h"
71 #include "chrome/browser/profiles/profile_metrics.h" 72 #include "chrome/browser/profiles/profile_metrics.h"
72 #include "chrome/browser/search_engines/template_url_fetcher.h" 73 #include "chrome/browser/search_engines/template_url_fetcher.h"
73 #include "chrome/browser/sessions/session_service_factory.h" 74 #include "chrome/browser/sessions/session_service_factory.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 RegisterProfilePrefsForServices(this, pref_registry_.get()); 458 RegisterProfilePrefsForServices(this, pref_registry_.get());
458 459
459 ManagedUserSettingsService* managed_user_settings = NULL; 460 ManagedUserSettingsService* managed_user_settings = NULL;
460 #if defined(ENABLE_MANAGED_USERS) 461 #if defined(ENABLE_MANAGED_USERS)
461 managed_user_settings = 462 managed_user_settings =
462 ManagedUserSettingsServiceFactory::GetForProfile(this); 463 ManagedUserSettingsServiceFactory::GetForProfile(this);
463 managed_user_settings->Init( 464 managed_user_settings->Init(
464 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS); 465 path_, sequenced_task_runner, create_mode == CREATE_MODE_SYNCHRONOUS);
465 #endif 466 #endif
466 467
468 // TODO(grt): construct pref_validation_delegate_.
467 { 469 {
468 // On startup, preference loading is always synchronous so a scoped timer 470 // On startup, preference loading is always synchronous so a scoped timer
469 // will work here. 471 // will work here.
470 startup_metric_utils::ScopedSlowStartupUMA 472 startup_metric_utils::ScopedSlowStartupUMA
471 scoped_timer("Startup.SlowStartupPreferenceLoading"); 473 scoped_timer("Startup.SlowStartupPreferenceLoading");
472 prefs_ = chrome_prefs::CreateProfilePrefs( 474 prefs_ = chrome_prefs::CreateProfilePrefs(
473 path_, 475 path_,
474 sequenced_task_runner, 476 sequenced_task_runner,
noms (inactive) 2014/05/26 13:38:21 I think the indenting is off on this. It should on
grt (UTC plus 2) 2014/05/26 14:30:21 "git cl format" did this for me. I've switched it
475 profile_policy_connector_->policy_service(), 477 pref_validation_delegate_.get(),
476 managed_user_settings, 478 profile_policy_connector_->policy_service(),
477 new ExtensionPrefStore( 479 managed_user_settings,
478 ExtensionPrefValueMapFactory::GetForBrowserContext(this), false), 480 new ExtensionPrefStore(
479 pref_registry_, 481 ExtensionPrefValueMapFactory::GetForBrowserContext(this),
480 async_prefs).Pass(); 482 false),
483 pref_registry_,
484 async_prefs).Pass();
481 // Register on BrowserContext. 485 // Register on BrowserContext.
482 user_prefs::UserPrefs::Set(this, prefs_.get()); 486 user_prefs::UserPrefs::Set(this, prefs_.get());
483 } 487 }
484 488
485 startup_metric_utils::ScopedSlowStartupUMA 489 startup_metric_utils::ScopedSlowStartupUMA
486 scoped_timer("Startup.SlowStartupFinalProfileInit"); 490 scoped_timer("Startup.SlowStartupFinalProfileInit");
487 if (async_prefs) { 491 if (async_prefs) {
488 // Wait for the notification that prefs has been loaded 492 // Wait for the notification that prefs has been loaded
489 // (successfully or not). Note that we can use base::Unretained 493 // (successfully or not). Note that we can use base::Unretained
490 // because the PrefService is owned by this class and lives on 494 // because the PrefService is owned by this class and lives on
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1361 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1358 #if defined(OS_CHROMEOS) 1362 #if defined(OS_CHROMEOS)
1359 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1363 if (chromeos::ProfileHelper::IsSigninProfile(this)) {
1360 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1364 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1361 g_browser_process->local_state()); 1365 g_browser_process->local_state());
1362 } 1366 }
1363 #endif // defined(OS_CHROMEOS) 1367 #endif // defined(OS_CHROMEOS)
1364 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1368 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1365 GetPrefs(), g_browser_process->local_state()); 1369 GetPrefs(), g_browser_process->local_state());
1366 } 1370 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698