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

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

Issue 18199003: Allow Chrome OS login profile to have different default pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 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
« no previous file with comments | « chrome/browser/prefs/browser_prefs.h ('k') | chrome/browser/prefs/incognito_mode_prefs.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/prefs/browser_prefs.h" 5 #include "chrome/browser/prefs/browser_prefs.h"
6 6
7 #include "apps/prefs.h" 7 #include "apps/prefs.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 policy::AutoEnrollmentClient::RegisterPrefs(registry); 272 policy::AutoEnrollmentClient::RegisterPrefs(registry);
273 policy::DeviceCloudPolicyManagerChromeOS::RegisterPrefs(registry); 273 policy::DeviceCloudPolicyManagerChromeOS::RegisterPrefs(registry);
274 policy::DeviceStatusCollector::RegisterPrefs(registry); 274 policy::DeviceStatusCollector::RegisterPrefs(registry);
275 #endif 275 #endif
276 276
277 #if defined(OS_MACOSX) 277 #if defined(OS_MACOSX)
278 confirm_quit::RegisterLocalState(registry); 278 confirm_quit::RegisterLocalState(registry);
279 #endif 279 #endif
280 } 280 }
281 281
282 void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) { 282 // Register prefs applicable to all profiles.
283 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
283 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs"); 284 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs");
284 // User prefs. Please keep this list alphabetized. 285 // User prefs. Please keep this list alphabetized.
285 AlternateErrorPageTabObserver::RegisterUserPrefs(registry); 286 AlternateErrorPageTabObserver::RegisterProfilePrefs(registry);
286 apps::RegisterUserPrefs(registry); 287 apps::RegisterProfilePrefs(registry);
287 autofill::AutofillDialogControllerImpl::RegisterUserPrefs(registry); 288 autofill::AutofillDialogControllerImpl::RegisterProfilePrefs(registry);
288 autofill::AutofillManager::RegisterUserPrefs(registry); 289 autofill::AutofillManager::RegisterProfilePrefs(registry);
289 BookmarkPromptPrefs::RegisterUserPrefs(registry); 290 BookmarkPromptPrefs::RegisterProfilePrefs(registry);
290 bookmark_utils::RegisterUserPrefs(registry); 291 bookmark_utils::RegisterProfilePrefs(registry);
291 browser_sync::SyncPrefs::RegisterUserPrefs(registry); 292 browser_sync::SyncPrefs::RegisterProfilePrefs(registry);
292 chrome::RegisterInstantUserPrefs(registry); 293 chrome::RegisterInstantUserPrefs(registry);
293 ChromeContentBrowserClient::RegisterUserPrefs(registry); 294 ChromeContentBrowserClient::RegisterProfilePrefs(registry);
294 ChromeVersionService::RegisterUserPrefs(registry); 295 ChromeVersionService::RegisterProfilePrefs(registry);
295 chrome_browser_net::HttpServerPropertiesManager::RegisterUserPrefs( 296 chrome_browser_net::HttpServerPropertiesManager::RegisterProfilePrefs(
296 registry); 297 registry);
297 chrome_browser_net::Predictor::RegisterUserPrefs(registry); 298 chrome_browser_net::Predictor::RegisterProfilePrefs(registry);
298 DownloadPrefs::RegisterUserPrefs(registry); 299 DownloadPrefs::RegisterProfilePrefs(registry);
299 extensions::ExtensionPrefs::RegisterUserPrefs(registry); 300 extensions::ExtensionPrefs::RegisterProfilePrefs(registry);
300 ExtensionWebUI::RegisterUserPrefs(registry); 301 ExtensionWebUI::RegisterProfilePrefs(registry);
301 first_run::RegisterUserPrefs(registry); 302 first_run::RegisterProfilePrefs(registry);
302 HostContentSettingsMap::RegisterUserPrefs(registry); 303 HostContentSettingsMap::RegisterProfilePrefs(registry);
303 IncognitoModePrefs::RegisterUserPrefs(registry); 304 IncognitoModePrefs::RegisterProfilePrefs(registry);
304 InstantUI::RegisterUserPrefs(registry); 305 InstantUI::RegisterProfilePrefs(registry);
305 MediaCaptureDevicesDispatcher::RegisterUserPrefs(registry); 306 MediaCaptureDevicesDispatcher::RegisterProfilePrefs(registry);
306 MediaStreamDevicesController::RegisterUserPrefs(registry); 307 MediaStreamDevicesController::RegisterProfilePrefs(registry);
307 NetPrefObserver::RegisterUserPrefs(registry); 308 NetPrefObserver::RegisterProfilePrefs(registry);
308 NewTabUI::RegisterUserPrefs(registry); 309 NewTabUI::RegisterProfilePrefs(registry);
309 PasswordGenerationManager::RegisterUserPrefs(registry); 310 PasswordGenerationManager::RegisterProfilePrefs(registry);
310 PasswordManager::RegisterUserPrefs(registry); 311 PasswordManager::RegisterProfilePrefs(registry);
311 PrefProxyConfigTrackerImpl::RegisterUserPrefs(registry); 312 PrefProxyConfigTrackerImpl::RegisterProfilePrefs(registry);
312 PrefsTabHelper::RegisterUserPrefs(registry); 313 PrefsTabHelper::RegisterProfilePrefs(registry);
313 Profile::RegisterUserPrefs(registry); 314 Profile::RegisterProfilePrefs(registry);
314 ProfileImpl::RegisterUserPrefs(registry); 315 ProfileImpl::RegisterProfilePrefs(registry);
315 PromoResourceService::RegisterUserPrefs(registry); 316 PromoResourceService::RegisterProfilePrefs(registry);
316 ProtocolHandlerRegistry::RegisterUserPrefs(registry); 317 ProtocolHandlerRegistry::RegisterProfilePrefs(registry);
317 RegisterBrowserUserPrefs(registry); 318 RegisterBrowserUserPrefs(registry);
318 SessionStartupPref::RegisterUserPrefs(registry); 319 SessionStartupPref::RegisterProfilePrefs(registry);
319 TemplateURLPrepopulateData::RegisterUserPrefs(registry); 320 TemplateURLPrepopulateData::RegisterProfilePrefs(registry);
320 TranslatePrefs::RegisterUserPrefs(registry); 321 TranslatePrefs::RegisterProfilePrefs(registry);
321 322
322 #if defined(ENABLE_CONFIGURATION_POLICY) 323 #if defined(ENABLE_CONFIGURATION_POLICY)
323 policy::URLBlacklistManager::RegisterUserPrefs(registry); 324 policy::URLBlacklistManager::RegisterProfilePrefs(registry);
324 #endif 325 #endif
325 326
326 #if defined(ENABLE_MANAGED_USERS) 327 #if defined(ENABLE_MANAGED_USERS)
327 ManagedUserService::RegisterUserPrefs(registry); 328 ManagedUserService::RegisterProfilePrefs(registry);
328 ManagedUserRegistrationService::RegisterUserPrefs(registry); 329 ManagedUserRegistrationService::RegisterProfilePrefs(registry);
329 #endif 330 #endif
330 331
331 #if defined(ENABLE_NOTIFICATIONS) 332 #if defined(ENABLE_NOTIFICATIONS)
332 DesktopNotificationService::RegisterUserPrefs(registry); 333 DesktopNotificationService::RegisterProfilePrefs(registry);
333 #endif 334 #endif
334 335
335 #if defined(TOOLKIT_VIEWS) 336 #if defined(TOOLKIT_VIEWS)
336 RegisterInvertBubbleUserPrefs(registry); 337 RegisterInvertBubbleUserPrefs(registry);
337 #elif defined(TOOLKIT_GTK) 338 #elif defined(TOOLKIT_GTK)
338 BrowserWindowGtk::RegisterUserPrefs(registry); 339 BrowserWindowGtk::RegisterProfilePrefs(registry);
339 #endif 340 #endif
340 341
341 #if defined(OS_ANDROID) 342 #if defined(OS_ANDROID)
342 PromoHandler::RegisterUserPrefs(registry); 343 PromoHandler::RegisterProfilePrefs(registry);
343 #endif 344 #endif
344 345
345 #if defined(USE_ASH) 346 #if defined(USE_ASH)
346 ash::RegisterChromeLauncherUserPrefs(registry); 347 ash::RegisterChromeLauncherUserPrefs(registry);
347 #endif 348 #endif
348 349
349 #if !defined(OS_ANDROID) 350 #if !defined(OS_ANDROID)
350 extensions::TabsCaptureVisibleTabFunction::RegisterUserPrefs(registry); 351 extensions::TabsCaptureVisibleTabFunction::RegisterProfilePrefs(registry);
351 ChromeToMobileService::RegisterUserPrefs(registry); 352 ChromeToMobileService::RegisterProfilePrefs(registry);
352 DeviceIDFetcher::RegisterUserPrefs(registry); 353 DeviceIDFetcher::RegisterProfilePrefs(registry);
353 DevToolsWindow::RegisterUserPrefs(registry); 354 DevToolsWindow::RegisterProfilePrefs(registry);
354 extensions::CommandService::RegisterUserPrefs(registry); 355 extensions::CommandService::RegisterProfilePrefs(registry);
355 ExtensionSettingsHandler::RegisterUserPrefs(registry); 356 ExtensionSettingsHandler::RegisterProfilePrefs(registry);
356 PepperFlashSettingsManager::RegisterUserPrefs(registry); 357 PepperFlashSettingsManager::RegisterProfilePrefs(registry);
357 PinnedTabCodec::RegisterUserPrefs(registry); 358 PinnedTabCodec::RegisterProfilePrefs(registry);
358 PluginsUI::RegisterUserPrefs(registry); 359 PluginsUI::RegisterProfilePrefs(registry);
359 CloudPrintURL::RegisterUserPrefs(registry); 360 CloudPrintURL::RegisterProfilePrefs(registry);
360 print_dialog_cloud::RegisterUserPrefs(registry); 361 print_dialog_cloud::RegisterProfilePrefs(registry);
361 printing::StickySettings::RegisterUserPrefs(registry); 362 printing::StickySettings::RegisterProfilePrefs(registry);
362 RegisterAutolaunchUserPrefs(registry); 363 RegisterAutolaunchUserPrefs(registry);
363 SyncPromoUI::RegisterUserPrefs(registry); 364 SyncPromoUI::RegisterProfilePrefs(registry);
364 #endif 365 #endif
365 366
366 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) 367 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
367 default_apps::RegisterUserPrefs(registry); 368 default_apps::RegisterProfilePrefs(registry);
368 #endif 369 #endif
369 370
370 #if defined(OS_CHROMEOS) 371 #if defined(OS_CHROMEOS)
371 chromeos::OAuth2LoginManager::RegisterUserPrefs(registry); 372 chromeos::OAuth2LoginManager::RegisterProfilePrefs(registry);
372 chromeos::Preferences::RegisterUserPrefs(registry); 373 chromeos::Preferences::RegisterProfilePrefs(registry);
373 chromeos::ProxyConfigServiceImpl::RegisterUserPrefs(registry); 374 chromeos::ProxyConfigServiceImpl::RegisterProfilePrefs(registry);
374 extensions::EnterprisePlatformKeysPrivateChallengeUserKeyFunction:: 375 extensions::EnterprisePlatformKeysPrivateChallengeUserKeyFunction::
375 RegisterUserPrefs(registry); 376 RegisterProfilePrefs(registry);
376 FlagsUI::RegisterUserPrefs(registry); 377 FlagsUI::RegisterProfilePrefs(registry);
377 #endif 378 #endif
378 379
379 #if defined(OS_WIN) 380 #if defined(OS_WIN)
380 NetworkProfileBubble::RegisterUserPrefs(registry); 381 NetworkProfileBubble::RegisterProfilePrefs(registry);
381 #endif 382 #endif
382 383
383 // Prefs registered only for migration (clearing or moving to a new 384 // Prefs registered only for migration (clearing or moving to a new
384 // key) go here. 385 // key) go here.
385 registry->RegisterDictionaryPref( 386 registry->RegisterDictionaryPref(
386 kBackupPref, 387 kBackupPref,
387 new DictionaryValue(), 388 new DictionaryValue(),
388 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); 389 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
389 } 390 }
390 391
392 void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
393 RegisterProfilePrefs(registry);
394 }
395
396 #if defined(OS_CHROMEOS)
397 void RegisterLoginProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
398 RegisterProfilePrefs(registry);
399 }
400 #endif
401
391 void MigrateUserPrefs(Profile* profile) { 402 void MigrateUserPrefs(Profile* profile) {
392 PrefService* prefs = profile->GetPrefs(); 403 PrefService* prefs = profile->GetPrefs();
393 404
394 // Cleanup prefs from now-removed protector feature. 405 // Cleanup prefs from now-removed protector feature.
395 prefs->ClearPref(kBackupPref); 406 prefs->ClearPref(kBackupPref);
396 407
397 PrefsTabHelper::MigrateUserPrefs(prefs); 408 PrefsTabHelper::MigrateUserPrefs(prefs);
398 PromoResourceService::MigrateUserPrefs(prefs); 409 PromoResourceService::MigrateUserPrefs(prefs);
399 TranslatePrefs::MigrateUserPrefs(prefs); 410 TranslatePrefs::MigrateUserPrefs(prefs);
400 } 411 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 475 }
465 local_state->ClearPref(prefs::kLastPromptedGoogleURL); 476 local_state->ClearPref(prefs::kLastPromptedGoogleURL);
466 477
467 current_version |= GOOGLE_URL_TRACKER_PREFS; 478 current_version |= GOOGLE_URL_TRACKER_PREFS;
468 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, 479 local_state->SetInteger(prefs::kMultipleProfilePrefMigration,
469 current_version); 480 current_version);
470 } 481 }
471 } 482 }
472 483
473 } // namespace chrome 484 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.h ('k') | chrome/browser/prefs/incognito_mode_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698