| OLD | NEW |
| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/chromeos/chromeos_version.h" | 9 #include "base/chromeos/chromeos_version.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "chrome/browser/browser_process_impl.h" | 14 #include "chrome/browser/browser_process_impl.h" |
| 15 #include "chrome/browser/chromeos/background/desktop_background_observer.h" | 15 #include "chrome/browser/chromeos/background/desktop_background_observer.h" |
| 16 #include "chrome/browser/chromeos/audio/audio_handler.h" | 16 #include "chrome/browser/chromeos/audio/audio_handler.h" |
| 17 #include "chrome/browser/chromeos/boot_times_loader.h" | 17 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 18 #include "chrome/browser/chromeos/cros/cros_library.h" | 18 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 19 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" | 19 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" |
| 20 #include "chrome/browser/chromeos/dbus/cros_dbus_service.h" |
| 20 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 21 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 21 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 22 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 22 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 23 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
| 23 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | 24 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
| 24 #include "chrome/browser/chromeos/external_metrics.h" | 25 #include "chrome/browser/chromeos/external_metrics.h" |
| 25 #include "chrome/browser/chromeos/imageburner/burn_manager.h" | 26 #include "chrome/browser/chromeos/imageburner/burn_manager.h" |
| 26 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 27 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 27 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 28 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" | 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_idle_logout.h" |
| 29 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" | 30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_screensaver.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 chromeos::disks::DiskMountManager::Shutdown(); | 201 chromeos::disks::DiskMountManager::Shutdown(); |
| 201 | 202 |
| 202 // CrosLibrary is shut down before DBusThreadManager even though the former | 203 // CrosLibrary is shut down before DBusThreadManager even though the former |
| 203 // is initialized before the latter becuase some of its libraries depend | 204 // is initialized before the latter becuase some of its libraries depend |
| 204 // on DBus clients. | 205 // on DBus clients. |
| 205 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. | 206 // TODO(hashimoto): Resolve this situation by removing CrosLibrary. |
| 206 // (crosbug.com/26160) | 207 // (crosbug.com/26160) |
| 207 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) | 208 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) |
| 208 chromeos::CrosLibrary::Shutdown(); | 209 chromeos::CrosLibrary::Shutdown(); |
| 209 | 210 |
| 211 chromeos::CrosDBusService::Shutdown(); |
| 210 chromeos::DBusThreadManager::Shutdown(); | 212 chromeos::DBusThreadManager::Shutdown(); |
| 211 | 213 |
| 212 // To be precise, logout (browser shutdown) is not yet done, but the | 214 // To be precise, logout (browser shutdown) is not yet done, but the |
| 213 // remaining work is negligible, hence we say LogoutDone here. | 215 // remaining work is negligible, hence we say LogoutDone here. |
| 214 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 216 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 215 false); | 217 false); |
| 216 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 218 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 217 } | 219 } |
| 218 | 220 |
| 219 // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- | 221 // content::BrowserMainParts and ChromeBrowserMainExtraParts overrides --------- |
| (...skipping 25 matching lines...) Expand all Loading... |
| 245 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); | 247 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); |
| 246 } | 248 } |
| 247 | 249 |
| 248 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { | 250 void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { |
| 249 MessageLoopForUI* message_loop = MessageLoopForUI::current(); | 251 MessageLoopForUI* message_loop = MessageLoopForUI::current(); |
| 250 message_loop->AddObserver(g_message_loop_observer.Pointer()); | 252 message_loop->AddObserver(g_message_loop_observer.Pointer()); |
| 251 | 253 |
| 252 // Initialize DBusThreadManager for the browser. This must be done after | 254 // Initialize DBusThreadManager for the browser. This must be done after |
| 253 // the main message loop is started, as it uses the message loop. | 255 // the main message loop is started, as it uses the message loop. |
| 254 chromeos::DBusThreadManager::Initialize(); | 256 chromeos::DBusThreadManager::Initialize(); |
| 257 chromeos::CrosDBusService::Initialize(); |
| 255 | 258 |
| 256 // Initialize the session manager observer so that we'll take actions | 259 // Initialize the session manager observer so that we'll take actions |
| 257 // per signals sent from the session manager. | 260 // per signals sent from the session manager. |
| 258 session_manager_observer_.reset(new chromeos::SessionManagerObserver); | 261 session_manager_observer_.reset(new chromeos::SessionManagerObserver); |
| 259 | 262 |
| 260 chromeos::disks::DiskMountManager::Initialize(); | 263 chromeos::disks::DiskMountManager::Initialize(); |
| 261 cryptohome::AsyncMethodCaller::Initialize(); | 264 cryptohome::AsyncMethodCaller::Initialize(); |
| 262 | 265 |
| 263 // Initialize the network change notifier for Chrome OS. The network | 266 // Initialize the network change notifier for Chrome OS. The network |
| 264 // change notifier starts to monitor changes from the power manager and | 267 // change notifier starts to monitor changes from the power manager and |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 | 493 |
| 491 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell | 494 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell |
| 492 // singleton before the shell is destroyed. | 495 // singleton before the shell is destroyed. |
| 493 video_property_writer_.reset(); | 496 video_property_writer_.reset(); |
| 494 // Remove PowerButtonObserver attached to a D-Bus client before | 497 // Remove PowerButtonObserver attached to a D-Bus client before |
| 495 // DBusThreadManager is shut down. | 498 // DBusThreadManager is shut down. |
| 496 power_button_observer_.reset(); | 499 power_button_observer_.reset(); |
| 497 | 500 |
| 498 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 501 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
| 499 } | 502 } |
| OLD | NEW |