Commit c82c9941 authored by satorux@chromium.org's avatar satorux@chromium.org

chromeos: Silence log spam from x11_util.cc.

The log spam happens when running browser_tests on Chrome OS, or running
Chrome for Chrome OS on Linux desktop.

The source of the spam was XGrabKey in
chrome/browser/chromeos/system_key_event_listener.cc.

We should use this class only when Chrome is running on Chrome OS in
non-test mode.

TEST=the log spam is gone from linux desktop, and function keys work on Chrome OS as before.
BUG=chromium-os:21331

Review URL: http://codereview.chromium.org/8380011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106994 0039d316-1c4b-4281-b951-d872f2087c98
parent 2f603cd6
...@@ -1823,8 +1823,12 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunInternal() { ...@@ -1823,8 +1823,12 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunInternal() {
chromeos::AudioHandler::Initialize(); chromeos::AudioHandler::Initialize();
// Listen for system key events so that the user will be able to adjust the // Listen for system key events so that the user will be able to adjust the
// volume on the login screen. // volume on the login screen, if Chrome is running on Chrome OS
chromeos::SystemKeyEventListener::Initialize(); // (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. // Listen for XI_HierarchyChanged events.
chromeos::XInputHierarchyChangedEventListener::GetInstance(); chromeos::XInputHierarchyChangedEventListener::GetInstance();
...@@ -2045,6 +2049,8 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() { ...@@ -2045,6 +2049,8 @@ void ChromeBrowserMainParts::PostMainMessageLoopRun() {
// Singletons are finally destroyed in AtExitManager. // Singletons are finally destroyed in AtExitManager.
chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop(); chromeos::XInputHierarchyChangedEventListener::GetInstance()->Stop();
// chromeos::SystemKeyEventListener::Shutdown() is always safe to call,
// even if Initialize() wasn't called.
chromeos::SystemKeyEventListener::Shutdown(); chromeos::SystemKeyEventListener::Shutdown();
chromeos::AudioHandler::Shutdown(); chromeos::AudioHandler::Shutdown();
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment