| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 CrosDBusService::Initialize(); | 156 CrosDBusService::Initialize(); |
| 157 | 157 |
| 158 // Initialize PowerDataCollector after DBusThreadManager is initialized. | 158 // Initialize PowerDataCollector after DBusThreadManager is initialized. |
| 159 PowerDataCollector::Initialize(); | 159 PowerDataCollector::Initialize(); |
| 160 | 160 |
| 161 LoginState::Initialize(); | 161 LoginState::Initialize(); |
| 162 SystemSaltGetter::Initialize(); | 162 SystemSaltGetter::Initialize(); |
| 163 TPMTokenLoader::Initialize(); | 163 TPMTokenLoader::Initialize(); |
| 164 CertLoader::Initialize(); | 164 CertLoader::Initialize(); |
| 165 | 165 |
| 166 // This function and SystemKeyEventListener use InputMethodManager. | |
| 167 chromeos::input_method::Initialize( | |
| 168 content::BrowserThread::GetMessageLoopProxyForThread( | |
| 169 content::BrowserThread::UI), | |
| 170 content::BrowserThread::GetMessageLoopProxyForThread( | |
| 171 content::BrowserThread::FILE)); | |
| 172 disks::DiskMountManager::Initialize(); | 166 disks::DiskMountManager::Initialize(); |
| 173 cryptohome::AsyncMethodCaller::Initialize(); | 167 cryptohome::AsyncMethodCaller::Initialize(); |
| 174 cryptohome::HomedirMethods::Initialize(); | 168 cryptohome::HomedirMethods::Initialize(); |
| 175 | 169 |
| 176 NetworkHandler::Initialize(); | 170 NetworkHandler::Initialize(); |
| 177 CertLibrary::Initialize(); | 171 CertLibrary::Initialize(); |
| 178 | 172 |
| 179 // Initialize the network change notifier for Chrome OS. The network | 173 // Initialize the network change notifier for Chrome OS. The network |
| 180 // change notifier starts to monitor changes from the power manager and | 174 // change notifier starts to monitor changes from the power manager and |
| 181 // the network manager. | 175 // the network manager. |
| 182 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); | 176 NetworkChangeNotifierFactoryChromeos::GetInstance()->Initialize(); |
| 183 | 177 |
| 184 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade | 178 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade |
| 185 // detector starts to monitor changes from the update engine. | 179 // detector starts to monitor changes from the update engine. |
| 186 UpgradeDetectorChromeos::GetInstance()->Init(); | 180 UpgradeDetectorChromeos::GetInstance()->Init(); |
| 187 | 181 |
| 188 if (base::SysInfo::IsRunningOnChromeOS()) { | |
| 189 // Disable Num Lock on X start up for http://crosbug.com/29169. | |
| 190 input_method::InputMethodManager::Get() | |
| 191 ->GetImeKeyboard() | |
| 192 ->DisableNumLock(); | |
| 193 } | |
| 194 | |
| 195 // Initialize the device settings service so that we'll take actions per | 182 // Initialize the device settings service so that we'll take actions per |
| 196 // signals sent from the session manager. This needs to happen before | 183 // signals sent from the session manager. This needs to happen before |
| 197 // g_browser_process initializes BrowserPolicyConnector. | 184 // g_browser_process initializes BrowserPolicyConnector. |
| 198 DeviceSettingsService::Initialize(); | 185 DeviceSettingsService::Initialize(); |
| 199 DeviceSettingsService::Get()->SetSessionManager( | 186 DeviceSettingsService::Get()->SetSessionManager( |
| 200 DBusThreadManager::Get()->GetSessionManagerClient(), | 187 DBusThreadManager::Get()->GetSessionManagerClient(), |
| 201 OwnerKeyUtil::Create()); | 188 OwnerKeyUtil::Create()); |
| 202 } | 189 } |
| 203 | 190 |
| 204 ~DBusServices() { | 191 ~DBusServices() { |
| 205 CertLibrary::Shutdown(); | 192 CertLibrary::Shutdown(); |
| 206 NetworkHandler::Shutdown(); | 193 NetworkHandler::Shutdown(); |
| 207 | 194 |
| 208 cryptohome::AsyncMethodCaller::Shutdown(); | 195 cryptohome::AsyncMethodCaller::Shutdown(); |
| 209 disks::DiskMountManager::Shutdown(); | 196 disks::DiskMountManager::Shutdown(); |
| 210 input_method::Shutdown(); | |
| 211 | 197 |
| 212 SystemSaltGetter::Shutdown(); | 198 SystemSaltGetter::Shutdown(); |
| 213 LoginState::Shutdown(); | 199 LoginState::Shutdown(); |
| 214 CertLoader::Shutdown(); | 200 CertLoader::Shutdown(); |
| 215 TPMTokenLoader::Shutdown(); | 201 TPMTokenLoader::Shutdown(); |
| 216 | 202 |
| 217 CrosDBusService::Shutdown(); | 203 CrosDBusService::Shutdown(); |
| 218 | 204 |
| 219 // Shutdown the PowerDataCollector before shutting down DBusThreadManager. | 205 // Shutdown the PowerDataCollector before shutting down DBusThreadManager. |
| 220 PowerDataCollector::Shutdown(); | 206 PowerDataCollector::Shutdown(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // LOGIN_USER_CHANGED notification from UserManager. | 346 // LOGIN_USER_CHANGED notification from UserManager. |
| 361 if (KioskModeSettings::Get()->IsKioskModeEnabled()) | 347 if (KioskModeSettings::Get()->IsKioskModeEnabled()) |
| 362 KioskModeIdleLogout::Initialize(); | 348 KioskModeIdleLogout::Initialize(); |
| 363 else | 349 else |
| 364 ScreenLocker::InitClass(); | 350 ScreenLocker::InitClass(); |
| 365 | 351 |
| 366 // This forces the ProfileManager to be created and register for the | 352 // This forces the ProfileManager to be created and register for the |
| 367 // notification it needs to track the logged in user. | 353 // notification it needs to track the logged in user. |
| 368 g_browser_process->profile_manager(); | 354 g_browser_process->profile_manager(); |
| 369 | 355 |
| 356 // AccessibilityManager and SystemKeyEventListener use InputMethodManager. |
| 357 input_method::Initialize(); |
| 358 |
| 370 // ProfileHelper has to be initialized after UserManager instance is created. | 359 // ProfileHelper has to be initialized after UserManager instance is created. |
| 371 ProfileHelper::Get()->Initialize(); | 360 ProfileHelper::Get()->Initialize(); |
| 372 | 361 |
| 373 // TODO(abarth): Should this move to InitializeNetworkOptions()? | 362 // TODO(abarth): Should this move to InitializeNetworkOptions()? |
| 374 // Allow access to file:// on ChromeOS for tests. | 363 // Allow access to file:// on ChromeOS for tests. |
| 375 if (parsed_command_line().HasSwitch(::switches::kAllowFileAccess)) | 364 if (parsed_command_line().HasSwitch(::switches::kAllowFileAccess)) |
| 376 ChromeNetworkDelegate::AllowAccessToAllFiles(); | 365 ChromeNetworkDelegate::AllowAccessToAllFiles(); |
| 377 | 366 |
| 378 // If kLoginUser is passed this indicates that user has already | 367 // If kLoginUser is passed this indicates that user has already |
| 379 // logged in and we should behave accordingly. | 368 // logged in and we should behave accordingly. |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // per-Profile InvalidationServices and the device-global | 699 // per-Profile InvalidationServices and the device-global |
| 711 // invalidation::TiclInvalidationService it may have created as an observer of | 700 // invalidation::TiclInvalidationService it may have created as an observer of |
| 712 // the DeviceOAuth2TokenService that is about to be destroyed. | 701 // the DeviceOAuth2TokenService that is about to be destroyed. |
| 713 g_browser_process->platform_part()->browser_policy_connector_chromeos()-> | 702 g_browser_process->platform_part()->browser_policy_connector_chromeos()-> |
| 714 ShutdownInvalidator(); | 703 ShutdownInvalidator(); |
| 715 | 704 |
| 716 // We first call PostMainMessageLoopRun and then destroy UserManager, because | 705 // We first call PostMainMessageLoopRun and then destroy UserManager, because |
| 717 // Ash needs to be closed before UserManager is destroyed. | 706 // Ash needs to be closed before UserManager is destroyed. |
| 718 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 707 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
| 719 | 708 |
| 709 input_method::Shutdown(); |
| 710 |
| 720 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. | 711 // Stops all in-flight OAuth2 token fetchers before the IO thread stops. |
| 721 DeviceOAuth2TokenServiceFactory::Shutdown(); | 712 DeviceOAuth2TokenServiceFactory::Shutdown(); |
| 722 | 713 |
| 723 // Called after | 714 // Called after |
| 724 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() to be | 715 // ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() to be |
| 725 // executed after execution of chrome::CloseAsh(), because some | 716 // executed after execution of chrome::CloseAsh(), because some |
| 726 // parts of WebUI depends on NetworkPortalDetector. | 717 // parts of WebUI depends on NetworkPortalDetector. |
| 727 NetworkPortalDetector::Shutdown(); | 718 NetworkPortalDetector::Shutdown(); |
| 728 | 719 |
| 729 UserManager::Destroy(); | 720 UserManager::Destroy(); |
| 730 | 721 |
| 731 g_browser_process->platform_part()->ShutdownSessionManager(); | 722 g_browser_process->platform_part()->ShutdownSessionManager(); |
| 732 } | 723 } |
| 733 | 724 |
| 734 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { | 725 void ChromeBrowserMainPartsChromeos::PostDestroyThreads() { |
| 735 // Destroy DBus services immediately after threads are stopped. | 726 // Destroy DBus services immediately after threads are stopped. |
| 736 dbus_services_.reset(); | 727 dbus_services_.reset(); |
| 737 | 728 |
| 738 ChromeBrowserMainPartsLinux::PostDestroyThreads(); | 729 ChromeBrowserMainPartsLinux::PostDestroyThreads(); |
| 739 | 730 |
| 740 // Destroy DeviceSettingsService after g_browser_process. | 731 // Destroy DeviceSettingsService after g_browser_process. |
| 741 DeviceSettingsService::Shutdown(); | 732 DeviceSettingsService::Shutdown(); |
| 742 } | 733 } |
| 743 | 734 |
| 744 } // namespace chromeos | 735 } // namespace chromeos |
| OLD | NEW |