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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 10832035: Switch from SignedSettings to DeviceSettingsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More test fixing... Created 8 years, 4 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) 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/chromeos/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" 23 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h"
24 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" 24 #include "chrome/browser/chromeos/disks/disk_mount_manager.h"
25 #include "chrome/browser/chromeos/external_metrics.h" 25 #include "chrome/browser/chromeos/external_metrics.h"
26 #include "chrome/browser/chromeos/imageburner/burn_manager.h" 26 #include "chrome/browser/chromeos/imageburner/burn_manager.h"
27 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 27 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
28 #include "chrome/browser/chromeos/input_method/xkeyboard.h" 28 #include "chrome/browser/chromeos/input_method/xkeyboard.h"
29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h"
30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" 30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h"
31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
32 #include "chrome/browser/chromeos/login/authenticator.h" 32 #include "chrome/browser/chromeos/login/authenticator.h"
33 #include "chrome/browser/chromeos/login/device_settings_service.h"
33 #include "chrome/browser/chromeos/login/login_utils.h" 34 #include "chrome/browser/chromeos/login/login_utils.h"
34 #include "chrome/browser/chromeos/login/login_wizard.h" 35 #include "chrome/browser/chromeos/login/login_wizard.h"
35 #include "chrome/browser/chromeos/login/ownership_service.h" 36 #include "chrome/browser/chromeos/login/owner_key_util.h"
36 #include "chrome/browser/chromeos/login/screen_locker.h" 37 #include "chrome/browser/chromeos/login/screen_locker.h"
37 #include "chrome/browser/chromeos/login/session_manager_observer.h"
38 #include "chrome/browser/chromeos/login/user_manager.h" 38 #include "chrome/browser/chromeos/login/user_manager.h"
39 #include "chrome/browser/chromeos/login/wallpaper_manager.h" 39 #include "chrome/browser/chromeos/login/wallpaper_manager.h"
40 #include "chrome/browser/chromeos/low_memory_observer.h" 40 #include "chrome/browser/chromeos/low_memory_observer.h"
41 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" 41 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h"
42 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" 42 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h"
43 #include "chrome/browser/chromeos/oom_priority_manager.h" 43 #include "chrome/browser/chromeos/oom_priority_manager.h"
44 #include "chrome/browser/chromeos/power/brightness_observer.h" 44 #include "chrome/browser/chromeos/power/brightness_observer.h"
45 #include "chrome/browser/chromeos/power/output_observer.h" 45 #include "chrome/browser/chromeos/power/output_observer.h"
46 #include "chrome/browser/chromeos/power/power_button_controller_delegate_chromeo s.h" 46 #include "chrome/browser/chromeos/power/power_button_controller_delegate_chromeo s.h"
47 #include "chrome/browser/chromeos/power/power_button_observer.h" 47 #include "chrome/browser/chromeos/power/power_button_observer.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 // Initialize DBusThreadManager for the browser. This must be done after 284 // Initialize DBusThreadManager for the browser. This must be done after
285 // the main message loop is started, as it uses the message loop. 285 // the main message loop is started, as it uses the message loop.
286 chromeos::DBusThreadManager::Initialize(); 286 chromeos::DBusThreadManager::Initialize();
287 // Add PowerManagerClient observer for WallpaperManager. WallpaperManager 287 // Add PowerManagerClient observer for WallpaperManager. WallpaperManager
288 // is initialized before DBusThreadManager. 288 // is initialized before DBusThreadManager.
289 chromeos::WallpaperManager::Get()->AddPowerManagerClientObserver(); 289 chromeos::WallpaperManager::Get()->AddPowerManagerClientObserver();
290 290
291 chromeos::CrosDBusService::Initialize(); 291 chromeos::CrosDBusService::Initialize();
292 292
293 // Initialize the session manager observer so that we'll take actions 293 // Initialize the device settings service so that we'll take actions per
294 // per signals sent from the session manager. 294 // signals sent from the session manager.
295 session_manager_observer_.reset(new chromeos::SessionManagerObserver); 295 chromeos::DeviceSettingsService::Get()->Initialize(
296 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(),
297 chromeos::OwnerKeyUtil::Create());
296 298
297 chromeos::disks::DiskMountManager::Initialize(); 299 chromeos::disks::DiskMountManager::Initialize();
298 cryptohome::AsyncMethodCaller::Initialize(); 300 cryptohome::AsyncMethodCaller::Initialize();
299 301
300 // Initialize the network change notifier for Chrome OS. The network 302 // Initialize the network change notifier for Chrome OS. The network
301 // change notifier starts to monitor changes from the power manager and 303 // change notifier starts to monitor changes from the power manager and
302 // the network manager. 304 // the network manager.
303 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); 305 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init();
304 306
305 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade 307 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 } 339 }
338 340
339 void ChromeBrowserMainPartsChromeos::PreProfileInit() { 341 void ChromeBrowserMainPartsChromeos::PreProfileInit() {
340 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 342 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
341 // -- immediately before Profile creation(). 343 // -- immediately before Profile creation().
342 344
343 // Now that the file thread exists we can record our stats. 345 // Now that the file thread exists we can record our stats.
344 chromeos::BootTimesLoader::Get()->RecordChromeMainStats(); 346 chromeos::BootTimesLoader::Get()->RecordChromeMainStats();
345 347
346 // Trigger prefetching of ownership status. 348 // Trigger prefetching of ownership status.
347 chromeos::OwnershipService::GetSharedInstance()->Prewarm(); 349 chromeos::DeviceSettingsService::Get()->Load();
348 350
349 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 351 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
350 // -- just before CreateProfile(). 352 // -- just before CreateProfile().
351 353
352 // Initialize the screen locker now so that it can receive 354 // Initialize the screen locker now so that it can receive
353 // LOGIN_USER_CHANGED notification from UserManager. 355 // LOGIN_USER_CHANGED notification from UserManager.
354 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { 356 if (chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) {
355 chromeos::InitializeKioskModeIdleLogout(); 357 chromeos::InitializeKioskModeIdleLogout();
356 } else { 358 } else {
357 chromeos::ScreenLocker::InitClass(); 359 chromeos::ScreenLocker::InitClass();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 // stops monitoring changes from the update engine. 498 // stops monitoring changes from the update engine.
497 if (UpgradeDetectorChromeos::GetInstance()) 499 if (UpgradeDetectorChromeos::GetInstance())
498 UpgradeDetectorChromeos::GetInstance()->Shutdown(); 500 UpgradeDetectorChromeos::GetInstance()->Shutdown();
499 501
500 // Shutdown the network change notifier for Chrome OS. The network 502 // Shutdown the network change notifier for Chrome OS. The network
501 // change notifier stops monitoring changes from the power manager and 503 // change notifier stops monitoring changes from the power manager and
502 // the network manager. 504 // the network manager.
503 if (chromeos::CrosNetworkChangeNotifierFactory::GetInstance()) 505 if (chromeos::CrosNetworkChangeNotifierFactory::GetInstance())
504 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown(); 506 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown();
505 507
508 // Tell DeviceSettingsService to stop talking to session_manager.
509 chromeos::DeviceSettingsService::Get()->Shutdown();
510
506 // We should remove observers attached to D-Bus clients before 511 // We should remove observers attached to D-Bus clients before
507 // DBusThreadManager is shut down. 512 // DBusThreadManager is shut down.
508 session_manager_observer_.reset();
509 screen_lock_observer_.reset(); 513 screen_lock_observer_.reset();
510 resume_observer_.reset(); 514 resume_observer_.reset();
511 brightness_observer_.reset(); 515 brightness_observer_.reset();
512 output_observer_.reset(); 516 output_observer_.reset();
513 517
514 // The XInput2 event listener needs to be shut down earlier than when 518 // The XInput2 event listener needs to be shut down earlier than when
515 // Singletons are finally destroyed in AtExitManager. 519 // Singletons are finally destroyed in AtExitManager.
516 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); 520 chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop();
517 521
518 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call, 522 // chromeos::SystemKeyEventListener::Shutdown() is always safe to call,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 LOG(WARNING) << "low_mem: Part of '100MB' experiment"; 585 LOG(WARNING) << "low_mem: Part of '100MB' experiment";
582 chromeos::LowMemoryObserver::SetLowMemoryMargin(100); 586 chromeos::LowMemoryObserver::SetLowMemoryMargin(100);
583 } else if (trial->group() == margin_200mb) { 587 } else if (trial->group() == margin_200mb) {
584 LOG(WARNING) << "low_mem: Part of '200MB' experiment"; 588 LOG(WARNING) << "low_mem: Part of '200MB' experiment";
585 chromeos::LowMemoryObserver::SetLowMemoryMargin(200); 589 chromeos::LowMemoryObserver::SetLowMemoryMargin(200);
586 } else { 590 } else {
587 LOG(WARNING) << "low_mem: Part of 'default' experiment"; 591 LOG(WARNING) << "low_mem: Part of 'default' experiment";
588 } 592 }
589 } 593 }
590 } 594 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698