| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // Trigger prefetching of ownership status. | 462 // Trigger prefetching of ownership status. |
| 463 DeviceSettingsService::Get()->Load(); | 463 DeviceSettingsService::Get()->Load(); |
| 464 | 464 |
| 465 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 465 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
| 466 // -- just before CreateProfile(). | 466 // -- just before CreateProfile(). |
| 467 | 467 |
| 468 UserManager::Initialize(); | 468 UserManager::Initialize(); |
| 469 | 469 |
| 470 // Initialize the screen locker now so that it can receive | 470 // Initialize the screen locker now so that it can receive |
| 471 // LOGIN_USER_CHANGED notification from UserManager. | 471 // LOGIN_USER_CHANGED notification from UserManager. |
| 472 if (KioskModeSettings::Get()->IsKioskModeEnabled()) { | 472 if (KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 473 KioskModeIdleLogout::Initialize(); | 473 KioskModeIdleLogout::Initialize(); |
| 474 } else { | 474 else |
| 475 ScreenLocker::InitClass(); | 475 ScreenLocker::InitClass(); |
| 476 } | |
| 477 | 476 |
| 478 // This forces the ProfileManager to be created and register for the | 477 // This forces the ProfileManager to be created and register for the |
| 479 // notification it needs to track the logged in user. | 478 // notification it needs to track the logged in user. |
| 480 g_browser_process->profile_manager(); | 479 g_browser_process->profile_manager(); |
| 481 | 480 |
| 482 // ProfileHelper has to be initialized after UserManager instance is created. | 481 // ProfileHelper has to be initialized after UserManager instance is created. |
| 483 g_browser_process->platform_part()->profile_helper()->Initialize(); | 482 g_browser_process->platform_part()->profile_helper()->Initialize(); |
| 484 | 483 |
| 485 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 484 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
| 486 // Allow access to file:// on ChromeOS for tests. | 485 // Allow access to file:// on ChromeOS for tests. |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 DeviceSettingsService::Get()->UnsetSessionManager(); | 771 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 773 | 772 |
| 774 // We should remove observers attached to D-Bus clients before | 773 // We should remove observers attached to D-Bus clients before |
| 775 // DBusThreadManager is shut down. | 774 // DBusThreadManager is shut down. |
| 776 extension_system_event_observer_.reset(); | 775 extension_system_event_observer_.reset(); |
| 777 retail_mode_power_save_blocker_.reset(); | 776 retail_mode_power_save_blocker_.reset(); |
| 778 peripheral_battery_observer_.reset(); | 777 peripheral_battery_observer_.reset(); |
| 779 power_prefs_.reset(); | 778 power_prefs_.reset(); |
| 780 event_rewriter_.reset(); | 779 event_rewriter_.reset(); |
| 781 | 780 |
| 781 // Let the ScreenLocker unregister itself from SessionManagerClient before |
| 782 // DBusThreadManager is shut down. |
| 783 if (!KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 784 ScreenLocker::ShutDownClass(); |
| 785 |
| 782 // The XInput2 event listener needs to be shut down earlier than when | 786 // The XInput2 event listener needs to be shut down earlier than when |
| 783 // Singletons are finally destroyed in AtExitManager. | 787 // Singletons are finally destroyed in AtExitManager. |
| 784 XInputHierarchyChangedEventListener::GetInstance()->Stop(); | 788 XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| 785 | 789 |
| 786 #if defined(USE_X11) | 790 #if defined(USE_X11) |
| 787 DeviceUMA::GetInstance()->Stop(); | 791 DeviceUMA::GetInstance()->Stop(); |
| 788 #endif | 792 #endif |
| 789 | 793 |
| 790 // SystemKeyEventListener::Shutdown() is always safe to call, | 794 // SystemKeyEventListener::Shutdown() is always safe to call, |
| 791 // even if Initialize() wasn't called. | 795 // even if Initialize() wasn't called. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 // Destroy DBus services immediately after threads are stopped. | 842 // Destroy DBus services immediately after threads are stopped. |
| 839 dbus_services_.reset(); | 843 dbus_services_.reset(); |
| 840 | 844 |
| 841 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 845 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 842 | 846 |
| 843 // Destroy DeviceSettingsService after g_browser_process. | 847 // Destroy DeviceSettingsService after g_browser_process. |
| 844 DeviceSettingsService::Shutdown(); | 848 DeviceSettingsService::Shutdown(); |
| 845 } | 849 } |
| 846 | 850 |
| 847 } // namespace chromeos | 851 } // namespace chromeos |
| OLD | NEW |