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

Unified Diff: chrome/browser/chromeos/status/caps_lock_menu_button.h

Issue 8330016: Implement the final UI for the CAPS LOCK indicator (part 3 of 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/caps_lock_menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/status/caps_lock_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698