summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/status/caps_lock_menu_button.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/chromeos/status/caps_lock_menu_button.h')
-rw-r--r--chrome/browser/chromeos/status/caps_lock_menu_button.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/chrome/browser/chromeos/status/caps_lock_menu_button.h b/chrome/browser/chromeos/status/caps_lock_menu_button.h
index 2960116..f0ca1cd 100644
--- a/chrome/browser/chromeos/status/caps_lock_menu_button.h
+++ b/chrome/browser/chromeos/status/caps_lock_menu_button.h
@@ -12,8 +12,13 @@
#include "chrome/browser/chromeos/system_key_event_listener.h"
#include "chrome/browser/prefs/pref_member.h"
#include "content/common/notification_observer.h"
+#include "views/controls/menu/menu_delegate.h"
#include "views/controls/menu/view_menu_delegate.h"
+namespace views {
+class MenuRunner;
+}
+
namespace chromeos {
class StatusAreaHost;
@@ -22,6 +27,7 @@ class StatusAreaHost;
// lock is active.
class CapsLockMenuButton : public NotificationObserver,
public StatusAreaButton,
+ public views::MenuDelegate,
public views::ViewMenuDelegate,
public SystemKeyEventListener::CapsLockObserver {
public:
@@ -31,6 +37,10 @@ class CapsLockMenuButton : public NotificationObserver,
// views::View implementation.
virtual void OnLocaleChanged();
+ // views::MenuDelegate implementation.
+ virtual string16 GetLabel(int id) const;
+ virtual bool IsCommandEnabled(int id) const;
+
// views::ViewMenuDelegate implementation.
virtual void RunMenu(views::View* unused_source, const gfx::Point& pt);
@@ -42,15 +52,27 @@ class CapsLockMenuButton : public NotificationObserver,
const NotificationSource& source,
const NotificationDetails& details);
- // Updates the tooltip text and the accessible name.
- void UpdateTooltip();
+ // Updates the accessible name.
+ void UpdateAccessibleName();
+
+ // Gets the text for the drop-down menu.
+ string16 GetText() const;
+
// Updates the UI from the current state.
void UpdateUIFromCurrentCapsLock(bool enabled);
private:
+ class StatusView;
+
PrefService* prefs_;
IntegerPrefMember remap_search_key_to_;
+ // The currently showing status view. NULL if menu is not being displayed.
+ StatusView* status_;
+
+ // If non-null the menu is showing.
+ scoped_ptr<views::MenuRunner> menu_runner_;
+
DISALLOW_COPY_AND_ASSIGN(CapsLockMenuButton);
};