Index: chrome/browser/chromeos/brightness_bubble.h |
diff --git a/chrome/browser/chromeos/brightness_bubble.h b/chrome/browser/chromeos/brightness_bubble.h |
index 7b5ed8c5cf9a47d2b7d197fba0829fb24dda93e3..ece8f029628188d0169406ca2fd957ff12423d47 100644 |
--- a/chrome/browser/chromeos/brightness_bubble.h |
+++ b/chrome/browser/chromeos/brightness_bubble.h |
@@ -8,21 +8,49 @@ |
#include "base/basictypes.h" |
#include "chrome/browser/chromeos/setting_level_bubble.h" |
+#include "views/widget/widget.h" |
template <typename T> struct DefaultSingletonTraits; |
namespace chromeos { |
// Singleton class controlling brightness bubble. |
-class BrightnessBubble : public SettingLevelBubble { |
+class BrightnessBubble : public views::Widget::Observer { |
public: |
+ // Returns the singleton brightness bubble instance. |
static BrightnessBubble* GetInstance(); |
+ // views::Widget::Observer overrides: |
+ void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
+ |
+ // Updates the target |percent| and icon to be used, sets |
+ // the bubble to |enabled| and shows the bubble. |
+ void ShowBubble(double percent, bool enabled); |
+ |
+ // Update the bubble |percent| and |enabled| state. See |
Daniel Erat
2011/10/24 15:52:10
nit: s/Update/Updates/
alicet1
2011/10/24 17:41:36
Done.
|
+ // comments at setting_level_bubble.h. |
+ void UpdateWithoutShowingBubble(double percent, bool enabled); |
+ |
+ // Hides the bubble. |
+ void HideBubble(); |
+ |
private: |
friend struct DefaultSingletonTraits<BrightnessBubble>; |
BrightnessBubble(); |
- virtual ~BrightnessBubble() {} |
+ virtual ~BrightnessBubble(); |
+ |
+ // Check that widget has been created or is not closed. |
Daniel Erat
2011/10/24 15:52:10
nit: Checks
alicet1
2011/10/24 17:41:36
Done.
|
+ // Create widget if needed. |
Daniel Erat
2011/10/24 15:52:10
nit: Creates
alicet1
2011/10/24 17:41:36
Done.
|
+ void MaybeCreateWidget(double percent, bool enabled); |
+ |
+ // Bubble widget. |
+ views::Widget* widget_; |
+ |
+ // Whether the bubble widget is closed. |
+ bool widget_closed_; |
+ |
+ FRIEND_TEST_ALL_PREFIXES(BrightnessBubbleTest, UpdateWithoutShowing); |
DISALLOW_COPY_AND_ASSIGN(BrightnessBubble); |
}; |