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/session_manager_client.h" | 18 #include "chrome/browser/chromeos/dbus/session_manager_client.h" |
18 #include "chrome/browser/chromeos/login/session_manager_observer.h" | 19 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
19 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 20 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
20 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 21 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
21 #include "chrome/browser/chromeos/system/statistics_provider.h" | 22 #include "chrome/browser/chromeos/system/statistics_provider.h" |
22 #include "chrome/browser/defaults.h" | 23 #include "chrome/browser/defaults.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "content/public/common/main_function_params.h" | 25 #include "content/public/common/main_function_params.h" |
25 #include "net/base/network_change_notifier.h" | 26 #include "net/base/network_change_notifier.h" |
26 | 27 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 | 116 |
116 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { | 117 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { |
117 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); | 118 ChromeBrowserMainPartsLinux::PreMainMessageLoopStart(); |
118 // Initialize CrosLibrary only for the browser, unless running tests | 119 // Initialize CrosLibrary only for the browser, unless running tests |
119 // (which do their own CrosLibrary setup). | 120 // (which do their own CrosLibrary setup). |
120 if (!parameters().ui_task) { | 121 if (!parameters().ui_task) { |
121 bool use_stub = parameters().command_line.HasSwitch(switches::kStubCros); | 122 bool use_stub = parameters().command_line.HasSwitch(switches::kStubCros); |
122 chromeos::CrosLibrary::Initialize(use_stub); | 123 chromeos::CrosLibrary::Initialize(use_stub); |
123 } | 124 } |
124 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific | 125 // Replace the default NetworkChangeNotifierFactory with ChromeOS specific |
125 // implementation. | 126 // implementation. This should be done after DBusThreadManager init. |
satorux1
2011/11/04 22:52:30
" This should be done after DBusThreadManager ini
Simon Que
2011/11/04 22:57:59
Done.
| |
126 net::NetworkChangeNotifier::SetFactory( | 127 net::NetworkChangeNotifier::SetFactory( |
127 new chromeos::CrosNetworkChangeNotifierFactory()); | 128 new chromeos::CrosNetworkChangeNotifierFactory()); |
128 } | 129 } |
129 | 130 |
130 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 131 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
131 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun(). | 132 // FILE thread is created in ChromeBrowserMainParts::PreMainMessageLoopRun(). |
132 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 133 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
133 // Get the statistics provider instance here to start loading statistcs | 134 // Get the statistics provider instance here to start loading statistcs |
134 // on the background FILE thread. | 135 // on the background FILE thread. |
135 chromeos::system::StatisticsProvider::GetInstance(); | 136 chromeos::system::StatisticsProvider::GetInstance(); |
(...skipping 22 matching lines...) Expand all Loading... | |
158 // Initialize the Chrome OS bluetooth subsystem | 159 // Initialize the Chrome OS bluetooth subsystem |
159 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { | 160 if (parsed_command_line().HasSwitch(switches::kEnableBluetooth)) { |
160 chromeos::BluetoothManager::Initialize(); | 161 chromeos::BluetoothManager::Initialize(); |
161 } | 162 } |
162 | 163 |
163 // Initialize the network change notifier for Chrome OS. The network | 164 // Initialize the network change notifier for Chrome OS. The network |
164 // change notifier starts to monitor changes from the power manager and | 165 // change notifier starts to monitor changes from the power manager and |
165 // the network manager. | 166 // the network manager. |
166 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); | 167 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); |
167 } | 168 } |
OLD | NEW |