Index: chrome/browser/ui/views/aura/caps_lock_handler.h |
diff --git a/chrome/browser/ui/views/aura/caps_lock_handler.h b/chrome/browser/ui/views/aura/caps_lock_handler.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4d5244b9af2c4a5f673c627012d45bbaab6210e1 |
--- /dev/null |
+++ b/chrome/browser/ui/views/aura/caps_lock_handler.h |
@@ -0,0 +1,64 @@ |
+// 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_VIEWS_AURA_CAPS_LOCK_HANDLER_H_ |
+#define CHROME_BROWSER_UI_VIEWS_AURA_CAPS_LOCK_HANDLER_H_ |
+#pragma once |
+ |
+#include "ash/caps_lock_delegate.h" |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
+ |
+#if defined(OS_CHROMEOS) |
+#include "chrome/browser/chromeos/system_key_event_listener.h" |
+ |
+namespace chromeos { |
+namespace input_method { |
+class XKeyboard; |
+} // namespace input_method |
+} // namespace chromeos |
+#endif |
+ |
+// A class which toggles Caps Lock state when the hot key for Caps Lock |
Daniel Erat
2012/01/23 16:42:43
nit: s/hot key/hotkey/
Yusuke Sato
2012/01/24 09:03:19
Done.
|
+// is pressed. |
+class CapsLockHandler |
+ : public ash::CapsLockDelegate |
Daniel Erat
2012/01/23 16:42:43
this probably should be on the previous line, like
Yusuke Sato
2012/01/24 09:03:19
Done.
|
+#if defined(OS_CHROMEOS) |
+ , public chromeos::SystemKeyEventListener::CapsLockObserver |
+#endif |
+{ |
+ public: |
+ CapsLockHandler(); |
+#if defined(OS_CHROMEOS) |
+ explicit CapsLockHandler(chromeos::input_method::XKeyboard* xkeyboard); |
+#endif |
+ virtual ~CapsLockHandler(); |
+ |
+ // Overridden from ash::CapsLockHandler: |
+ virtual bool HandleToggleCapsLock() OVERRIDE; |
+ |
+#if defined(OS_CHROMEOS) |
+ // Overridden from chromeos::SystemKeyEventListener::CapsLockObserver: |
+ virtual void OnCapsLockChange(bool enabled) OVERRIDE; |
+#endif |
+ |
+ void set_is_running_on_chromeos_for_test(bool is_running_on_chromeos) { |
+ is_running_on_chromeos_ = is_running_on_chromeos; |
+ } |
+ |
+ bool caps_lock_is_on_for_test() const { |
+ return caps_lock_is_on_; |
+ } |
+ |
+ private: |
+#if defined(OS_CHROMEOS) |
+ chromeos::input_method::XKeyboard* xkeyboard_; |
+#endif |
+ bool is_running_on_chromeos_; |
+ bool caps_lock_is_on_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(CapsLockHandler); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_VIEWS_AURA_CAPS_LOCK_HANDLER_H_ |