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

Side by Side Diff: chrome/browser/prefs/browser_prefs.cc

Issue 8245018: Remove race condition when installing default apps into a new profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Addressing review comments Created 9 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 | 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/prefs/browser_prefs.h" 5 #include "chrome/browser/prefs/browser_prefs.h"
6 6
7 #include "chrome/browser/about_flags.h" 7 #include "chrome/browser/about_flags.h"
8 #include "chrome/browser/autofill/autofill_manager.h" 8 #include "chrome/browser/autofill/autofill_manager.h"
9 #include "chrome/browser/background/background_mode_manager.h" 9 #include "chrome/browser/background/background_mode_manager.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #if defined(OS_CHROMEOS) 80 #if defined(OS_CHROMEOS)
81 #include "chrome/browser/chromeos/audio_mixer_alsa.h" 81 #include "chrome/browser/chromeos/audio_mixer_alsa.h"
82 #include "chrome/browser/chromeos/customization_document.h" 82 #include "chrome/browser/chromeos/customization_document.h"
83 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" 83 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
84 #include "chrome/browser/chromeos/login/user_manager.h" 84 #include "chrome/browser/chromeos/login/user_manager.h"
85 #include "chrome/browser/chromeos/login/wizard_controller.h" 85 #include "chrome/browser/chromeos/login/wizard_controller.h"
86 #include "chrome/browser/chromeos/preferences.h" 86 #include "chrome/browser/chromeos/preferences.h"
87 #include "chrome/browser/chromeos/status/input_method_menu.h" 87 #include "chrome/browser/chromeos/status/input_method_menu.h"
88 #include "chrome/browser/chromeos/status/network_menu_button.h" 88 #include "chrome/browser/chromeos/status/network_menu_button.h"
89 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 89 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
90 #else
91 #include "chrome/browser/extensions/default_apps.h"
90 #endif 92 #endif
91 93
92 namespace browser { 94 namespace browser {
93 95
94 void RegisterLocalState(PrefService* local_state) { 96 void RegisterLocalState(PrefService* local_state) {
95 // Prefs in Local State 97 // Prefs in Local State
96 local_state->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0); 98 local_state->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0);
97 AppsPromo::RegisterPrefs(local_state); 99 AppsPromo::RegisterPrefs(local_state);
98 Browser::RegisterPrefs(local_state); 100 Browser::RegisterPrefs(local_state);
99 FlagsUI::RegisterPrefs(local_state); 101 FlagsUI::RegisterPrefs(local_state);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 NetPrefObserver::RegisterPrefs(user_prefs); 180 NetPrefObserver::RegisterPrefs(user_prefs);
179 ProtocolHandlerRegistry::RegisterPrefs(user_prefs); 181 ProtocolHandlerRegistry::RegisterPrefs(user_prefs);
180 #if defined(OS_MACOSX) 182 #if defined(OS_MACOSX)
181 PresentationModePrefs::RegisterUserPrefs(user_prefs); 183 PresentationModePrefs::RegisterUserPrefs(user_prefs);
182 #endif 184 #endif
183 #if defined(ENABLE_CONFIGURATION_POLICY) 185 #if defined(ENABLE_CONFIGURATION_POLICY)
184 policy::URLBlacklistManager::RegisterPrefs(user_prefs); 186 policy::URLBlacklistManager::RegisterPrefs(user_prefs);
185 #endif 187 #endif
186 SyncPromoUI::RegisterUserPrefs(user_prefs); 188 SyncPromoUI::RegisterUserPrefs(user_prefs);
187 chrome_browser_net::HttpServerPropertiesManager::RegisterPrefs(user_prefs); 189 chrome_browser_net::HttpServerPropertiesManager::RegisterPrefs(user_prefs);
190 #if !defined(OS_CHROMEOS)
191 default_apps::RegisterUserPrefs(user_prefs);
192 #endif
188 } 193 }
189 194
190 void MigrateBrowserPrefs(PrefService* user_prefs, PrefService* local_state) { 195 void MigrateBrowserPrefs(PrefService* user_prefs, PrefService* local_state) {
191 // Copy pref values which have been migrated to user_prefs from local_state, 196 // Copy pref values which have been migrated to user_prefs from local_state,
192 // or remove them from local_state outright, if copying is not required. 197 // or remove them from local_state outright, if copying is not required.
193 int current_version = 198 int current_version =
194 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); 199 local_state->GetInteger(prefs::kMultipleProfilePrefMigration);
195 200
196 if ((current_version & WINDOWS_PREFS) == 0) { 201 if ((current_version & WINDOWS_PREFS) == 0) {
197 // Migrate the devtools split location preference. 202 // Migrate the devtools split location preference.
(...skipping 13 matching lines...) Expand all
211 user_prefs->Set(prefs::kBrowserWindowPlacement, *(pref->GetValue())); 216 user_prefs->Set(prefs::kBrowserWindowPlacement, *(pref->GetValue()));
212 } 217 }
213 local_state->ClearPref(prefs::kBrowserWindowPlacement); 218 local_state->ClearPref(prefs::kBrowserWindowPlacement);
214 219
215 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, 220 local_state->SetInteger(prefs::kMultipleProfilePrefMigration,
216 current_version | WINDOWS_PREFS); 221 current_version | WINDOWS_PREFS);
217 } 222 }
218 } 223 }
219 224
220 } // namespace browser 225 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_extension_provider_impl.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698