| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "chrome/browser/chromeos/accessibility/system_event_observer.h" |
| 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" | 13 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" |
| 13 #include "chrome/browser/chromeos/boot_times_loader.h" | 14 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 14 #include "chrome/browser/chromeos/brightness_observer.h" | 15 #include "chrome/browser/chromeos/brightness_observer.h" |
| 15 #include "chrome/browser/chromeos/cros/cros_library.h" | 16 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 16 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 17 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 17 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 18 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 18 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 19 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
| 19 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | 20 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
| 20 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 21 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 21 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 22 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 109 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| 109 RemoveObserver(session_manager_observer_.get()); | 110 RemoveObserver(session_manager_observer_.get()); |
| 110 } | 111 } |
| 111 if (brightness_observer_.get()) { | 112 if (brightness_observer_.get()) { |
| 112 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() | 113 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() |
| 113 ->RemoveObserver(brightness_observer_.get()); | 114 ->RemoveObserver(brightness_observer_.get()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 chromeos::DBusThreadManager::Shutdown(); | 117 chromeos::DBusThreadManager::Shutdown(); |
| 117 | 118 |
| 119 chromeos::accessibility::SystemEventObserver::Shutdown(); |
| 120 |
| 118 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) | 121 if (!parameters().ui_task && chromeos::CrosLibrary::Get()) |
| 119 chromeos::CrosLibrary::Shutdown(); | 122 chromeos::CrosLibrary::Shutdown(); |
| 120 | 123 |
| 121 // To be precise, logout (browser shutdown) is not yet done, but the | 124 // To be precise, logout (browser shutdown) is not yet done, but the |
| 122 // remaining work is negligible, hence we say LogoutDone here. | 125 // remaining work is negligible, hence we say LogoutDone here. |
| 123 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 126 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
| 124 false); | 127 false); |
| 125 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 128 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
| 126 } | 129 } |
| 127 | 130 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 141 // Initialize CrosLibrary only for the browser, unless running tests | 144 // Initialize CrosLibrary only for the browser, unless running tests |
| 142 // (which do their own CrosLibrary setup). | 145 // (which do their own CrosLibrary setup). |
| 143 if (!parameters().ui_task) { | 146 if (!parameters().ui_task) { |
| 144 bool use_stub = parameters().command_line.HasSwitch(switches::kStubCros); | 147 bool use_stub = parameters().command_line.HasSwitch(switches::kStubCros); |
| 145 chromeos::CrosLibrary::Initialize(use_stub); | 148 chromeos::CrosLibrary::Initialize(use_stub); |
| 146 } | 149 } |
| 147 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific | 150 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific |
| 148 // implementation. | 151 // implementation. |
| 149 net::NetworkChangeNotifier::SetFactory( | 152 net::NetworkChangeNotifier::SetFactory( |
| 150 new chromeos::CrosNetworkChangeNotifierFactory()); | 153 new chromeos::CrosNetworkChangeNotifierFactory()); |
| 154 |
| 155 chromeos::accessibility::SystemEventObserver::Initialize(); |
| 151 } | 156 } |
| 152 | 157 |
| 153 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 158 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
| 154 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun(). | 159 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun(). |
| 155 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 160 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
| 156 // Get the statistics provider instance here to start loading statistcs | 161 // Get the statistics provider instance here to start loading statistcs |
| 157 // on the background FILE thread. | 162 // on the background FILE thread. |
| 158 chromeos::system::StatisticsProvider::GetInstance(); | 163 chromeos::system::StatisticsProvider::GetInstance(); |
| 159 | 164 |
| 160 // Initialize the Chrome OS bluetooth subsystem. | 165 // Initialize the Chrome OS bluetooth subsystem. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Enable Num Lock on X start up. | 210 // Enable Num Lock on X start up. |
| 206 chromeos::input_method::InputMethodManager::GetInstance()-> | 211 chromeos::input_method::InputMethodManager::GetInstance()-> |
| 207 GetXKeyboard()->SetNumLockEnabled(true); | 212 GetXKeyboard()->SetNumLockEnabled(true); |
| 208 | 213 |
| 209 #if defined(USE_AURA) | 214 #if defined(USE_AURA) |
| 210 initial_browser_window_observer_.reset( | 215 initial_browser_window_observer_.reset( |
| 211 new chromeos::InitialBrowserWindowObserver); | 216 new chromeos::InitialBrowserWindowObserver); |
| 212 #endif | 217 #endif |
| 213 } | 218 } |
| 214 } | 219 } |
| OLD | NEW |