Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / ash / caps_lock_delegate_chromeos.h
bloba514fe61764cf15ecd055e82638157db12c596ce
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ASH_CAPS_LOCK_DELEGATE_CHROMEOS_H_
6 #define CHROME_BROWSER_UI_ASH_CAPS_LOCK_DELEGATE_CHROMEOS_H_
8 #include "ash/caps_lock_delegate.h"
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/chromeos/system_key_event_listener.h"
13 namespace chromeos {
14 namespace input_method {
15 class XKeyboard;
16 } // namespace input_method
17 } // namespace chromeos
19 // A class which toggles Caps Lock state when the hotkey for Caps Lock
20 // is pressed.
21 class CapsLockDelegate
22 : public ash::CapsLockDelegate,
23 public chromeos::SystemKeyEventListener::CapsLockObserver {
24 public:
25 explicit CapsLockDelegate(chromeos::input_method::XKeyboard* xkeyboard);
26 virtual ~CapsLockDelegate();
28 // Overridden from ash::CapsLockDelegate:
29 virtual bool IsCapsLockEnabled() const OVERRIDE;
30 virtual void SetCapsLockEnabled(bool enabled) OVERRIDE;
31 virtual void ToggleCapsLock() OVERRIDE;
33 // Overridden from chromeos::SystemKeyEventListener::CapsLockObserver:
34 virtual void OnCapsLockChange(bool enabled) OVERRIDE;
36 void set_is_running_on_chromeos_for_test(bool is_running_on_chromeos) {
37 is_running_on_chromeos_ = is_running_on_chromeos;
40 bool caps_lock_is_on_for_test() const { return caps_lock_is_on_; }
42 private:
43 chromeos::input_method::XKeyboard* xkeyboard_;
44 bool is_running_on_chromeos_;
45 bool caps_lock_is_on_;
47 DISALLOW_COPY_AND_ASSIGN(CapsLockDelegate);
50 #endif // CHROME_BROWSER_UI_ASH_CAPS_LOCK_DELEGATE_CHROMEOS_H_