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