| Index: chrome/browser/chromeos/status/caps_lock_menu_button.h
|
| diff --git a/chrome/browser/chromeos/status/caps_lock_menu_button.h b/chrome/browser/chromeos/status/caps_lock_menu_button.h
|
| index 0db2d1fa38da8ae5e752e68b0cac17e40c3a4f74..053623b42156515cdfe69f99111fe675ca0d87c7 100644
|
| --- a/chrome/browser/chromeos/status/caps_lock_menu_button.h
|
| +++ b/chrome/browser/chromeos/status/caps_lock_menu_button.h
|
| @@ -8,6 +8,7 @@
|
|
|
| #include <string>
|
|
|
| +#include "base/timer.h"
|
| #include "chrome/browser/chromeos/status/status_area_button.h"
|
| #include "chrome/browser/chromeos/system_key_event_listener.h"
|
| #include "chrome/browser/prefs/pref_member.h"
|
| @@ -15,6 +16,8 @@
|
| #include "views/controls/menu/menu_delegate.h"
|
| #include "views/controls/menu/view_menu_delegate.h"
|
|
|
| +class Bubble;
|
| +
|
| namespace views {
|
| class MenuRunner;
|
| }
|
| @@ -55,24 +58,45 @@ class CapsLockMenuButton : public content::NotificationObserver,
|
| // Updates the accessible name.
|
| void UpdateAccessibleName();
|
|
|
| - // Gets the text for the drop-down menu.
|
| + // Gets the text for the drop-down menu and bubble.
|
| string16 GetText() const;
|
|
|
| - // Updates the UI from the current state.
|
| + // Updates the button from the current state.
|
| void UpdateUIFromCurrentCapsLock(bool enabled);
|
|
|
| private:
|
| class StatusView;
|
|
|
| + // Returns true if the Search key is assigned to Caps Lock.
|
| + bool HasCapsLock() const;
|
| +
|
| + bool IsMenuShown() const;
|
| + void HideMenu();
|
| +
|
| + bool IsBubbleShown() const;
|
| + void MaybeShowBubble();
|
| + void CreateAndShowBubble();
|
| + void HideBubble();
|
| +
|
| 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_;
|
|
|
| + // The currently showing bubble. NULL if bubble is not being displayed.
|
| + Bubble* bubble_;
|
| + // If true, |bubble_| is shown when both shift keys are pressed.
|
| + bool should_show_bubble_;
|
| + // # of times |bubble_| is shown.
|
| + size_t bubble_count_;
|
| + // TODO(yusukes): Save should_show_bubble_ and bubble_count_ in Preferences.
|
| +
|
| + // The timer for hiding the bubble.
|
| + base::OneShotTimer<CapsLockMenuButton> bubble_timer_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(CapsLockMenuButton);
|
| };
|
|
|
|
|