Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1982)

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 10878058: Move functions for controlling Caps Lock to CapsLockDelegate from SystemTrayDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 89488511bf61c9636c06e28a9ff4c053ad8563e5..e5d7a856ee7a7cb9abe0af3c43412973ae7d7b5c 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -477,14 +477,12 @@ bool AcceleratorController::PerformAction(int action,
ash::Shell::GetInstance()->ToggleAppList();
return true;
case DISABLE_CAPS_LOCK:
- // TODO(mazda): Handle this using |caps_lock_delegate_|.
- if (shell->tray_delegate()->IsCapsLockOn())
- shell->tray_delegate()->SetCapsLockEnabled(false);
+ if (shell->caps_lock_delegate()->IsCapsLockEnabled())
+ shell->caps_lock_delegate()->SetCapsLockEnabled(false);
return true;
case TOGGLE_CAPS_LOCK:
- if (caps_lock_delegate_.get())
- return caps_lock_delegate_->HandleToggleCapsLock();
- break;
+ shell->caps_lock_delegate()->ToggleCapsLock();
+ return true;
case BRIGHTNESS_DOWN:
if (brightness_control_delegate_.get())
return brightness_control_delegate_->HandleBrightnessDown(accelerator);
@@ -682,11 +680,6 @@ void AcceleratorController::SetBrightnessControlDelegate(
brightness_control_delegate_.swap(brightness_control_delegate);
}
-void AcceleratorController::SetCapsLockDelegate(
- scoped_ptr<CapsLockDelegate> caps_lock_delegate) {
- caps_lock_delegate_.swap(caps_lock_delegate);
-}
-
void AcceleratorController::SetImeControlDelegate(
scoped_ptr<ImeControlDelegate> ime_control_delegate) {
ime_control_delegate_.swap(ime_control_delegate);

Powered by Google App Engine
This is Rietveld 408576698