summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 18:38:05 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 18:38:05 +0000
commit30f58c9752744814e38d844a11c68302ac1a4bf2 (patch)
tree8ffd3370a16c5eb719cf018b28316d10990849bb /chrome
parent64d8d39667043c562e0e1b0384c1e662b1accfc1 (diff)
downloadchromium_src-30f58c9752744814e38d844a11c68302ac1a4bf2.zip
chromium_src-30f58c9752744814e38d844a11c68302ac1a4bf2.tar.gz
chromium_src-30f58c9752744814e38d844a11c68302ac1a4bf2.tar.bz2
Move keyboard brightness controller to ash/system/chromeos.
BUG=119298 R=stevenjb@chromium.org,oshima@chromium.org Review URL: https://chromiumcodereview.appspot.com/11150020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163616 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/ash/ash_init.cc5
-rw-r--r--chrome/browser/ui/ash/chrome_shell_delegate.cc8
-rw-r--r--chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.cc34
-rw-r--r--chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h31
-rw-r--r--chrome/chrome_browser_ui.gypi2
5 files changed, 8 insertions, 72 deletions
diff --git a/chrome/browser/ui/ash/ash_init.cc b/chrome/browser/ui/ash/ash_init.cc
index 5b55217..27c6171 100644
--- a/chrome/browser/ui/ash/ash_init.cc
+++ b/chrome/browser/ui/ash/ash_init.cc
@@ -29,12 +29,10 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/ui/ash/brightness_controller_chromeos.h"
#include "chrome/browser/ui/ash/ime_controller_chromeos.h"
-#include "chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h"
#include "chrome/browser/ui/ash/volume_controller_chromeos.h"
#include "ui/base/x/x11_util.h"
#endif
-
namespace chrome {
bool ShouldOpenAshOnStartup() {
@@ -83,9 +81,6 @@ void OpenAsh() {
new BrightnessController).Pass());
shell->accelerator_controller()->SetImeControlDelegate(
scoped_ptr<ash::ImeControlDelegate>(new ImeController).Pass());
- shell->accelerator_controller()->SetKeyboardBrightnessControlDelegate(
- scoped_ptr<ash::KeyboardBrightnessControlDelegate>(
- new KeyboardBrightnessController).Pass());
ash::Shell::GetInstance()->high_contrast_controller()->SetEnabled(
chromeos::accessibility::IsHighContrastEnabled());
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index f54065d..a24e499 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -415,6 +415,14 @@ void ChromeShellDelegate::RecordUserMetricsAction(
case ash::UMA_LAUNCHER_CLICK_ON_APP:
content::RecordAction(content::UserMetricsAction("Launcher_ClickOnApp"));
break;
+ case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6:
+ content::RecordAction(
+ content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6"));
+ break;
+ case ash::UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7:
+ content::RecordAction(
+ content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7"));
+ break;
}
}
diff --git a/chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.cc b/chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.cc
deleted file mode 100644
index 535b1ca..0000000
--- a/chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h"
-
-#include "chromeos/dbus/dbus_thread_manager.h"
-#include "chromeos/dbus/power_manager_client.h"
-#include "content/public/browser/user_metrics.h"
-#include "ui/base/accelerators/accelerator.h"
-
-bool KeyboardBrightnessController::HandleKeyboardBrightnessDown(
- const ui::Accelerator& accelerator) {
- if (accelerator.key_code() == ui::VKEY_F6) {
- content::RecordAction(
- content::UserMetricsAction("Accel_KeyboardBrightnessDown_F6"));
- }
-
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
- DecreaseKeyboardBrightness();
- return true;
-}
-
-bool KeyboardBrightnessController::HandleKeyboardBrightnessUp(
- const ui::Accelerator& accelerator) {
- if (accelerator.key_code() == ui::VKEY_F7) {
- content::RecordAction(
- content::UserMetricsAction("Accel_KeyboardBrightnessUp_F7"));
- }
-
- chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
- IncreaseKeyboardBrightness();
- return true;
-}
diff --git a/chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h b/chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h
deleted file mode 100644
index 97228f6..0000000
--- a/chrome/browser/ui/ash/keyboard_brightness_controller_chromeos.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_ASH_KEYBOARD_BRIGHTNESS_CONTROLLER_CHROMEOS_H_
-#define CHROME_BROWSER_UI_ASH_KEYBOARD_BRIGHTNESS_CONTROLLER_CHROMEOS_H_
-
-#include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h"
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-
-// A class which controls keyboard brightness when Alt+F6, Alt+F7 or a
-// multimedia key for keyboard brightness is pressed.
-class KeyboardBrightnessController
- : public ash::KeyboardBrightnessControlDelegate {
- public:
- KeyboardBrightnessController() {}
- virtual ~KeyboardBrightnessController() {}
-
- private:
- // Overridden from ash::KeyboardBrightnessControlDelegate:
- virtual bool HandleKeyboardBrightnessDown(
- const ui::Accelerator& accelerator) OVERRIDE;
- virtual bool HandleKeyboardBrightnessUp(
- const ui::Accelerator& accelerator) OVERRIDE;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(KeyboardBrightnessController);
-};
-
-#endif // CHROME_BROWSER_UI_ASH_KEYBOARD_BRIGHTNESS_CONTROLLER_CHROMEOS_H_
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 643b6ca6..d284eaa 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -159,8 +159,6 @@
'browser/ui/ash/extension_utils.h',
'browser/ui/ash/ime_controller_chromeos.cc',
'browser/ui/ash/ime_controller_chromeos.h',
- 'browser/ui/ash/keyboard_brightness_controller_chromeos.cc',
- 'browser/ui/ash/keyboard_brightness_controller_chromeos.h',
'browser/ui/ash/launcher/browser_launcher_item_controller.cc',
'browser/ui/ash/launcher/browser_launcher_item_controller.h',
'browser/ui/ash/launcher/chrome_launcher_controller.cc',