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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + comments Created 9 years, 7 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 837
838 // Initialize the prefs of the local state. 838 // Initialize the prefs of the local state.
839 browser::RegisterLocalState(local_state_.get()); 839 browser::RegisterLocalState(local_state_.get());
840 840
841 pref_change_registrar_.Init(local_state_.get()); 841 pref_change_registrar_.Init(local_state_.get());
842 842
843 print_job_manager_->InitOnUIThread(local_state_.get()); 843 print_job_manager_->InitOnUIThread(local_state_.get());
844 844
845 // Initialize the notification for the default browser setting policy. 845 // Initialize the notification for the default browser setting policy.
846 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, 846 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled,
847 false); 847 false,
848 false /* don't sync pref */);
848 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) { 849 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) {
849 if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) 850 if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled))
850 ShellIntegration::SetAsDefaultBrowser(); 851 ShellIntegration::SetAsDefaultBrowser();
851 } 852 }
852 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this); 853 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this);
853 854
854 // Initialize the preference for the plugin finder policy. 855 // Initialize the preference for the plugin finder policy.
855 // This preference is only needed on the IO thread so make it available there. 856 // This preference is only needed on the IO thread so make it available there.
856 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false); 857 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder,
858 false,
859 false /* don't sync pref */);
857 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder, 860 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder,
858 local_state_.get(), NULL); 861 local_state_.get(), NULL);
859 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO); 862 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO);
860 863
861 // This is observed by ChildProcessSecurityPolicy, which lives in content/ 864 // This is observed by ChildProcessSecurityPolicy, which lives in content/
862 // though, so it can't register itself. 865 // though, so it can't register itself.
863 local_state_->RegisterListPref(prefs::kDisabledSchemes); 866 local_state_->RegisterListPref(prefs::kDisabledSchemes,
867 false /* don't sync pref */);
868
864 pref_change_registrar_.Add(prefs::kDisabledSchemes, this); 869 pref_change_registrar_.Add(prefs::kDisabledSchemes, this);
865 ApplyDisabledSchemesPolicy(); 870 ApplyDisabledSchemesPolicy();
866 } 871 }
867 872
868 void BrowserProcessImpl::CreateIconManager() { 873 void BrowserProcessImpl::CreateIconManager() {
869 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); 874 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL);
870 created_icon_manager_ = true; 875 created_icon_manager_ = true;
871 icon_manager_.reset(new IconManager); 876 icon_manager_.reset(new IconManager);
872 } 877 }
873 878
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 } 1054 }
1050 1055
1051 void BrowserProcessImpl::OnAutoupdateTimer() { 1056 void BrowserProcessImpl::OnAutoupdateTimer() {
1052 if (CanAutorestartForUpdate()) { 1057 if (CanAutorestartForUpdate()) {
1053 DLOG(WARNING) << "Detected update. Restarting browser."; 1058 DLOG(WARNING) << "Detected update. Restarting browser.";
1054 RestartPersistentInstance(); 1059 RestartPersistentInstance();
1055 } 1060 }
1056 } 1061 }
1057 1062
1058 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 1063 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698