Chromium Code Reviews| 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/bluetooth/bluetooth_manager.h" | 12 #include "chrome/browser/chromeos/bluetooth/bluetooth_manager.h" |
| 13 #include "chrome/browser/chromeos/boot_times_loader.h" | 13 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 14 #include "chrome/browser/chromeos/brightness_observer.h" | 14 #include "chrome/browser/chromeos/brightness_observer.h" |
| 15 #include "chrome/browser/chromeos/cros/cros_library.h" | 15 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 16 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 16 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
| 17 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 17 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
| 18 #include "chrome/browser/chromeos/dbus/session_manager_client.h" | 18 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
| 19 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" | |
| 19 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 20 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 20 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 21 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 21 #include "chrome/browser/chromeos/login/session_manager_observer.h" | 22 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
| 22 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 23 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
| 23 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 24 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
| 24 #include "chrome/browser/chromeos/system/runtime_environment.h" | 25 #include "chrome/browser/chromeos/system/runtime_environment.h" |
| 25 #include "chrome/browser/chromeos/system/statistics_provider.h" | 26 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 26 #include "chrome/browser/defaults.h" | 27 #include "chrome/browser/defaults.h" |
| 27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 28 #include "content/public/common/main_function_params.h" | 29 #include "content/public/common/main_function_params.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 : ChromeBrowserMainPartsLinux(parameters) { | 81 : ChromeBrowserMainPartsLinux(parameters) { |
| 81 } | 82 } |
| 82 | 83 |
| 83 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { | 84 ChromeBrowserMainPartsChromeos::~ChromeBrowserMainPartsChromeos() { |
| 84 // Shutdown the network change notifier for Chrome OS. The network | 85 // Shutdown the network change notifier for Chrome OS. The network |
| 85 // change notifier stops monitoring changes from the power manager and | 86 // change notifier stops monitoring changes from the power manager and |
| 86 // the network manager. | 87 // the network manager. |
| 87 if (chromeos::CrosNetworkChangeNotifierFactory::GetInstance()) | 88 if (chromeos::CrosNetworkChangeNotifierFactory::GetInstance()) |
| 88 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown(); | 89 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Shutdown(); |
| 89 | 90 |
| 91 chromeos::disks::DiskMountManager::Shutdown(); | |
| 92 | |
| 90 chromeos::BluetoothManager::Shutdown(); | 93 chromeos::BluetoothManager::Shutdown(); |
| 91 | 94 |
| 92 // We should remove observers attached to D-Bus clients before | 95 // We should remove observers attached to D-Bus clients before |
| 93 // DBusThreadManager is shut down. | 96 // DBusThreadManager is shut down. |
| 94 if (session_manager_observer_.get()) { | 97 if (session_manager_observer_.get()) { |
| 95 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 98 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| 96 RemoveObserver(session_manager_observer_.get()); | 99 RemoveObserver(session_manager_observer_.get()); |
| 97 } | 100 } |
| 98 if (brightness_observer_.get()) { | 101 if (brightness_observer_.get()) { |
| 99 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() | 102 chromeos::DBusThreadManager::Get()->GetPowerManagerClient() |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 // per signals sent from the session manager. | 166 // per signals sent from the session manager. |
| 164 session_manager_observer_.reset(new chromeos::SessionManagerObserver); | 167 session_manager_observer_.reset(new chromeos::SessionManagerObserver); |
| 165 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 168 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| 166 AddObserver(session_manager_observer_.get()); | 169 AddObserver(session_manager_observer_.get()); |
| 167 | 170 |
| 168 // Initialize the Chrome OS bluetooth subsystem | 171 // Initialize the Chrome OS bluetooth subsystem |
| 169 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { | 172 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { |
| 170 chromeos::BluetoothManager::Initialize(); | 173 chromeos::BluetoothManager::Initialize(); |
| 171 } | 174 } |
| 172 | 175 |
| 176 // Initialize the disk mount manager | |
|
satorux1
2011/11/15 21:20:24
a period is missing.
hashimoto
2011/11/16 04:28:15
Done.
| |
| 177 chromeos::disks::DiskMountManager::Initialize(); | |
| 178 | |
| 173 // Initialize the network change notifier for Chrome OS. The network | 179 // Initialize the network change notifier for Chrome OS. The network |
| 174 // change notifier starts to monitor changes from the power manager and | 180 // change notifier starts to monitor changes from the power manager and |
| 175 // the network manager. | 181 // the network manager. |
| 176 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); | 182 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); |
| 177 | 183 |
| 178 // For http://crosbug.com/p/5795 and http://crosbug.com/p/6245. | 184 // For http://crosbug.com/p/5795 and http://crosbug.com/p/6245. |
| 179 // Enable Num Lock on X start up. | 185 // Enable Num Lock on X start up. |
| 180 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { | 186 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { |
| 181 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard()-> | 187 chromeos::input_method::InputMethodManager::GetInstance()->GetXKeyboard()-> |
| 182 SetNumLockEnabled(true); | 188 SetNumLockEnabled(true); |
| 183 } | 189 } |
| 184 } | 190 } |
| OLD | NEW |