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/shell.h" | 10 #include "ash/shell.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 // Disable Num Lock on X start up for http://crosbug.com/29169. | 304 // Disable Num Lock on X start up for http://crosbug.com/29169. |
305 input_method::GetInputMethodManager()->GetXKeyboard()-> | 305 input_method::GetInputMethodManager()->GetXKeyboard()-> |
306 SetNumLockEnabled(false); | 306 SetNumLockEnabled(false); |
307 } | 307 } |
308 | 308 |
309 // Initialize the device settings service so that we'll take actions per | 309 // Initialize the device settings service so that we'll take actions per |
310 // signals sent from the session manager. | 310 // signals sent from the session manager. |
311 DeviceSettingsService::Get()->Initialize( | 311 DeviceSettingsService::Get()->Initialize( |
312 DBusThreadManager::Get()->GetSessionManagerClient(), | 312 DBusThreadManager::Get()->GetSessionManagerClient(), |
313 OwnerKeyUtil::Create()); | 313 OwnerKeyUtil::Create()); |
| 314 chromeos::ConnectivityStateHelper::Initialize(); |
314 } | 315 } |
315 | 316 |
316 ~DBusServices() { | 317 ~DBusServices() { |
| 318 chromeos::ConnectivityStateHelper::Shutdown(); |
317 // CrosLibrary is shut down before DBusThreadManager even though it | 319 // CrosLibrary is shut down before DBusThreadManager even though it |
318 // is initialized first becuase some of its libraries depend on DBus | 320 // is initialized first becuase some of its libraries depend on DBus |
319 // clients. | 321 // clients. |
320 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. | 322 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. |
321 // (crosbug.com/26160) | 323 // (crosbug.com/26160) |
322 if (cros_initialized_ && CrosLibrary::Get()) | 324 if (cros_initialized_ && CrosLibrary::Get()) |
323 CrosLibrary::Shutdown(); | 325 CrosLibrary::Shutdown(); |
324 | 326 |
325 chromeos::ManagedNetworkConfigurationHandler::Shutdown(); | 327 chromeos::ManagedNetworkConfigurationHandler::Shutdown(); |
326 chromeos::NetworkConfigurationHandler::Shutdown(); | 328 chromeos::NetworkConfigurationHandler::Shutdown(); |
327 | 329 |
328 chromeos::ConnectivityStateHelper::Shutdown(); | |
329 chromeos::NetworkStateHandler::Shutdown(); | 330 chromeos::NetworkStateHandler::Shutdown(); |
330 chromeos::GeolocationHandler::Shutdown(); | 331 chromeos::GeolocationHandler::Shutdown(); |
331 chromeos::network_event_log::Shutdown(); | 332 chromeos::network_event_log::Shutdown(); |
332 | 333 |
333 cryptohome::AsyncMethodCaller::Shutdown(); | 334 cryptohome::AsyncMethodCaller::Shutdown(); |
334 disks::DiskMountManager::Shutdown(); | 335 disks::DiskMountManager::Shutdown(); |
335 input_method::Shutdown(); | 336 input_method::Shutdown(); |
336 CrosDBusService::Shutdown(); | 337 CrosDBusService::Shutdown(); |
337 // NOTE: This must only be called if Initialize() was called. | 338 // NOTE: This must only be called if Initialize() was called. |
338 DBusThreadManager::Shutdown(); | 339 DBusThreadManager::Shutdown(); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 message_loop->AddObserver(g_message_loop_observer.Pointer()); | 428 message_loop->AddObserver(g_message_loop_observer.Pointer()); |
428 | 429 |
429 dbus_services_.reset(new internal::DBusServices(parameters())); | 430 dbus_services_.reset(new internal::DBusServices(parameters())); |
430 | 431 |
431 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); | 432 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); |
432 } | 433 } |
433 | 434 |
434 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. | 435 // Threads are initialized between MainMessageLoopStart and MainMessageLoopRun. |
435 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. | 436 // about_flags settings are applied in ChromeBrowserMainParts::PreCreateThreads. |
436 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 437 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
437 // Must be called after about_flags settings are applied (see note above). | |
438 chromeos::ConnectivityStateHelper::Initialize(); | |
439 | |
440 AudioHandler::Initialize(); | 438 AudioHandler::Initialize(); |
441 imageburner::BurnManager::Initialize(); | 439 imageburner::BurnManager::Initialize(); |
442 | 440 |
443 // Listen for system key events so that the user will be able to adjust the | 441 // Listen for system key events so that the user will be able to adjust the |
444 // volume on the login screen, if Chrome is running on Chrome OS | 442 // volume on the login screen, if Chrome is running on Chrome OS |
445 // (i.e. not Linux desktop), and in non-test mode. | 443 // (i.e. not Linux desktop), and in non-test mode. |
446 // Note: SystemKeyEventListener depends on the DBus thread. | 444 // Note: SystemKeyEventListener depends on the DBus thread. |
447 if (base::chromeos::IsRunningOnChromeOS() && | 445 if (base::chromeos::IsRunningOnChromeOS() && |
448 !parameters().ui_task) { // ui_task is non-NULL when running tests. | 446 !parameters().ui_task) { // ui_task is non-NULL when running tests. |
449 SystemKeyEventListener::Initialize(); | 447 SystemKeyEventListener::Initialize(); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 return; | 849 return; |
852 | 850 |
853 // If failed to launch, go back to login screen. | 851 // If failed to launch, go back to login screen. |
854 LOG(ERROR) << "Failed to launch kiosk app. Fall back to login screen"; | 852 LOG(ERROR) << "Failed to launch kiosk app. Fall back to login screen"; |
855 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile()); | 853 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile()); |
856 | 854 |
857 // TODO(xiyuan): Show error message. | 855 // TODO(xiyuan): Show error message. |
858 } | 856 } |
859 | 857 |
860 } // namespace chromeos | 858 } // namespace chromeos |
OLD | NEW |