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/command_line.h" | 10 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
11 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
12 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
13 #include "chrome/browser/browser_process_impl.h" | 14 #include "chrome/browser/browser_process_impl.h" |
14 #include "chrome/browser/chromeos/audio/audio_handler.h" | 15 #include "chrome/browser/chromeos/audio/audio_handler.h" |
15 #include "chrome/browser/chromeos/boot_times_loader.h" | 16 #include "chrome/browser/chromeos/boot_times_loader.h" |
16 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
17 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" | 18 #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" |
18 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 19 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
(...skipping 12 matching lines...) Expand all Loading... |
31 #include "chrome/browser/chromeos/login/ownership_service.h" | 32 #include "chrome/browser/chromeos/login/ownership_service.h" |
32 #include "chrome/browser/chromeos/login/screen_locker.h" | 33 #include "chrome/browser/chromeos/login/screen_locker.h" |
33 #include "chrome/browser/chromeos/login/session_manager_observer.h" | 34 #include "chrome/browser/chromeos/login/session_manager_observer.h" |
34 #include "chrome/browser/chromeos/login/user_manager.h" | 35 #include "chrome/browser/chromeos/login/user_manager.h" |
35 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" | 36 #include "chrome/browser/chromeos/net/cros_network_change_notifier_factory.h" |
36 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" | 37 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
37 #include "chrome/browser/chromeos/power/brightness_observer.h" | 38 #include "chrome/browser/chromeos/power/brightness_observer.h" |
38 #include "chrome/browser/chromeos/power/resume_observer.h" | 39 #include "chrome/browser/chromeos/power/resume_observer.h" |
39 #include "chrome/browser/chromeos/power/screen_lock_observer.h" | 40 #include "chrome/browser/chromeos/power/screen_lock_observer.h" |
40 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" | 41 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" |
41 #include "chrome/browser/chromeos/system/runtime_environment.h" | |
42 #include "chrome/browser/chromeos/system/statistics_provider.h" | 42 #include "chrome/browser/chromeos/system/statistics_provider.h" |
43 #include "chrome/browser/chromeos/system_key_event_listener.h" | 43 #include "chrome/browser/chromeos/system_key_event_listener.h" |
44 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" | 44 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" |
45 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | 45 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" |
46 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" | 46 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
47 #include "chrome/browser/defaults.h" | 47 #include "chrome/browser/defaults.h" |
48 #include "chrome/browser/metrics/metrics_service.h" | 48 #include "chrome/browser/metrics/metrics_service.h" |
49 #include "chrome/browser/oom_priority_manager.h" | 49 #include "chrome/browser/oom_priority_manager.h" |
50 #include "chrome/browser/policy/browser_policy_connector.h" | 50 #include "chrome/browser/policy/browser_policy_connector.h" |
51 #include "chrome/browser/prefs/pref_service.h" | 51 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 // Initialize the network change notifier for Chrome OS. The network | 300 // Initialize the network change notifier for Chrome OS. The network |
301 // change notifier starts to monitor changes from the power manager and | 301 // change notifier starts to monitor changes from the power manager and |
302 // the network manager. | 302 // the network manager. |
303 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); | 303 chromeos::CrosNetworkChangeNotifierFactory::GetInstance()->Init(); |
304 | 304 |
305 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade | 305 // Likewise, initialize the upgrade detector for Chrome OS. The upgrade |
306 // detector starts to monitor changes from the update engine. | 306 // detector starts to monitor changes from the update engine. |
307 UpgradeDetectorChromeos::GetInstance()->Init(); | 307 UpgradeDetectorChromeos::GetInstance()->Init(); |
308 | 308 |
309 if (chromeos::system::runtime_environment::IsRunningOnChromeOS()) { | 309 if (base::chromeos::IsRunningOnChromeOS()) { |
310 // Enable Num Lock on X start up for http://crosbug.com/p/5795 and | 310 // Enable Num Lock on X start up for http://crosbug.com/p/5795 and |
311 // http://crosbug.com/p/6245. We don't do this for Chromium OS since many | 311 // http://crosbug.com/p/6245. We don't do this for Chromium OS since many |
312 // netbooks do not work as intended when Num Lock is on (e.g. On a netbook | 312 // netbooks do not work as intended when Num Lock is on (e.g. On a netbook |
313 // with a small keyboard, u, i, o, p, ... keys might be repurposed as | 313 // with a small keyboard, u, i, o, p, ... keys might be repurposed as |
314 // cursor keys when Num Lock is on). | 314 // cursor keys when Num Lock is on). |
315 #if defined(GOOGLE_CHROME_BUILD) | 315 #if defined(GOOGLE_CHROME_BUILD) |
316 chromeos::input_method::InputMethodManager::GetInstance()-> | 316 chromeos::input_method::InputMethodManager::GetInstance()-> |
317 GetXKeyboard()->SetNumLockEnabled(true); | 317 GetXKeyboard()->SetNumLockEnabled(true); |
318 #endif | 318 #endif |
319 | 319 |
320 #if defined(USE_AURA) | 320 #if defined(USE_AURA) |
321 initial_browser_window_observer_.reset( | 321 initial_browser_window_observer_.reset( |
322 new chromeos::InitialBrowserWindowObserver); | 322 new chromeos::InitialBrowserWindowObserver); |
323 #endif | 323 #endif |
324 } | 324 } |
325 | 325 |
326 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); | 326 ChromeBrowserMainPartsLinux::PostMainMessageLoopStart(); |
327 } | 327 } |
328 | 328 |
329 // Threads are initialized MainMessageLoopStart and MainMessageLoopRun. | 329 // Threads are initialized MainMessageLoopStart and MainMessageLoopRun. |
330 | 330 |
331 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { | 331 void ChromeBrowserMainPartsChromeos::PreMainMessageLoopRun() { |
332 chromeos::AudioHandler::Initialize(); | 332 chromeos::AudioHandler::Initialize(); |
333 chromeos::imageburner::BurnManager::Initialize(); | 333 chromeos::imageburner::BurnManager::Initialize(); |
334 | 334 |
335 // Listen for system key events so that the user will be able to adjust the | 335 // Listen for system key events so that the user will be able to adjust the |
336 // volume on the login screen, if Chrome is running on Chrome OS | 336 // volume on the login screen, if Chrome is running on Chrome OS |
337 // (i.e. not Linux desktop), and in non-test mode. | 337 // (i.e. not Linux desktop), and in non-test mode. |
338 // Note: SystemKeyEventListener depends on the DBus thread. | 338 // Note: SystemKeyEventListener depends on the DBus thread. |
339 if (chromeos::system::runtime_environment::IsRunningOnChromeOS() && | 339 if (base::chromeos::IsRunningOnChromeOS() && |
340 !parameters().ui_task) { // ui_task is non-NULL when running tests. | 340 !parameters().ui_task) { // ui_task is non-NULL when running tests. |
341 chromeos::SystemKeyEventListener::Initialize(); | 341 chromeos::SystemKeyEventListener::Initialize(); |
342 } | 342 } |
343 | 343 |
344 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); | 344 ChromeBrowserMainPartsLinux::PreMainMessageLoopRun(); |
345 } | 345 } |
346 | 346 |
347 void ChromeBrowserMainPartsChromeos::PreProfileInit() { | 347 void ChromeBrowserMainPartsChromeos::PreProfileInit() { |
348 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() | 348 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() |
349 // -- immediately before Profile creation(). | 349 // -- immediately before Profile creation(). |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell | 542 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell |
543 // singleton before the shell is destroyed. | 543 // singleton before the shell is destroyed. |
544 video_property_writer_.reset(); | 544 video_property_writer_.reset(); |
545 // Remove PowerButtonObserver attached to a D-Bus client before | 545 // Remove PowerButtonObserver attached to a D-Bus client before |
546 // DBusThreadManager is shut down. | 546 // DBusThreadManager is shut down. |
547 power_button_observer_.reset(); | 547 power_button_observer_.reset(); |
548 #endif | 548 #endif |
549 | 549 |
550 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); | 550 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); |
551 } | 551 } |
OLD | NEW |