Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
| index 46c9926416695b1ab9e563177179c345de2d0c0e..e55c993fdc9f203285f1c28fe677f0b93ba17c79 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -143,6 +143,7 @@ |
| #include "chrome/browser/chromeos/login/ownership_service.h" |
| #include "chrome/browser/chromeos/login/screen_locker.h" |
| #include "chrome/browser/chromeos/login/user_manager.h" |
| +#include "chrome/browser/chromeos/system/runtime_environment.h" |
| #include "chrome/browser/chromeos/system_key_event_listener.h" |
| #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
| #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" |
| @@ -1817,8 +1818,12 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunInternal() { |
| chromeos::AudioHandler::Initialize(); |
| // Listen for system key events so that the user will be able to adjust the |
| - // volume on the login screen. |
| - chromeos::SystemKeyEventListener::Initialize(); |
| + // volume on the login screen, if Chrome is running on Chrome OS |
| + // (i.e. not Linux desktop), and in non-test mode. |
| + if (chromeos::system::runtime_environment::IsRunningOnChromeOS() && |
| + !parameters().ui_task) { // ui_task is non-NULL when running tests. |
| + chromeos::SystemKeyEventListener::Initialize(); |
| + } |
| // Listen for XI_HierarchyChanged events. |
| chromeos::XInputHierarchyChangedEventListener::GetInstance(); |
| @@ -2039,7 +2044,11 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() { |
| // Singletons are finally destroyed in AtExitManager. |
| chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); |
| - chromeos::SystemKeyEventListener::Shutdown(); |
| + // See comment at call to chromeos::SystemKeyEventListener::Initialize(). |
| + if (chromeos::system::runtime_environment::IsRunningOnChromeOS() && |
| + !parameters().ui_task) { |
|
stevenjb
2011/10/24 20:17:36
nit: SystemKeyEventListener::Shutdown() is always
satorux1
2011/10/24 20:27:28
Agreed. Removed the conditional and added some com
|
| + chromeos::SystemKeyEventListener::Shutdown(); |
| + } |
| chromeos::AudioHandler::Shutdown(); |
| #endif |