Index: chrome/browser/chromeos/setting_level_bubble.h |
diff --git a/chrome/browser/chromeos/setting_level_bubble.h b/chrome/browser/chromeos/setting_level_bubble.h |
index 6496dde84c82efd9bbfa3c422986c87b0355c434..a5f6945b47f0f6eb3c90d80efb4436e094f3aa9c 100644 |
--- a/chrome/browser/chromeos/setting_level_bubble.h |
+++ b/chrome/browser/chromeos/setting_level_bubble.h |
@@ -9,7 +9,7 @@ |
#include "base/basictypes.h" |
#include "base/time.h" |
#include "base/timer.h" |
-#include "chrome/browser/ui/views/bubble/bubble.h" |
+#include "views/bubble/bubble_delegate.h" |
class SkBitmap; |
@@ -19,11 +19,27 @@ class SettingLevelBubbleView; |
// Singleton class controlling a bubble displaying a level-based setting like |
// volume or brightness. |
-class SettingLevelBubble : public BubbleDelegate { |
+class SettingLevelBubble : public views::BubbleDelegateView { |
public: |
- // Shows the bubble. |percent| should be in the range [0.0, 100.0]. |
- void ShowBubble(double percent, bool enabled); |
- void HideBubble(); |
+ // Create the bubble delegate and view. |
+ // |percent| should be in the range [0.0, 100.0]. |
+ static views::Widget* CreateSettingLevelBubble( |
Daniel Erat
2011/10/21 00:25:21
nit: CreateBubble()?
alicet1
2011/10/21 18:11:36
Done.
|
+ SkBitmap* increase_icon, |
+ SkBitmap* decrease_icon, |
+ SkBitmap* zero_icon, |
+ double percent, |
+ bool enabled); |
+ |
+ virtual ~SettingLevelBubble(); |
msw
2011/10/21 02:42:06
The destructor probably belongs below these static
alicet1
2011/10/21 18:11:36
Done.
|
+ |
+ // Show the setting level bubble for this |widget|, or if |widget| is |
+ // null, create and return it also. |
+ static views::Widget* ShowBubble(views::Widget* widget, |
Daniel Erat
2011/10/21 00:25:21
the semantics of this method seem strange. i'd re
alicet1
2011/10/21 18:11:36
Done.
|
+ SkBitmap* increase_icon, |
+ SkBitmap* decrease_icon, |
+ SkBitmap* disabled_icon, |
+ double percent, |
+ bool enabled); |
// Updates the bubble's current level without showing the bubble onscreen. |
// We _do_ still animate the level moving to |percent| in case the bubble is |
@@ -42,18 +58,25 @@ class SettingLevelBubble : public BubbleDelegate { |
// to 30%, rather than from 25% up to 30%. |
void UpdateWithoutShowingBubble(double percent, bool enabled); |
+ // Calculate target percent and icon to be used when setting level changes. |
+ void UpdateSetting(double percent, bool enabled); |
+ |
+ // Start the |hide_timer_| for this bubble. |
+ void StartHideTimer(); |
+ |
+ // BubbleDelegate overrides: |
Daniel Erat
2011/10/21 00:25:21
i think that other chrome code that i've seen usua
alicet1
2011/10/21 18:11:36
Done.
|
+ virtual void Init() OVERRIDE; |
+ gfx::Point GetAnchorPoint() OVERRIDE; |
+ |
+ // WidgetDeletgate overrides: |
Daniel Erat
2011/10/21 00:25:21
WidgetDeletgate -> WidgetDelegate
alicet1
2011/10/21 18:11:36
Done.
|
+ virtual void WindowClosing() OVERRIDE; |
+ |
protected: |
SettingLevelBubble(SkBitmap* increase_icon, |
SkBitmap* decrease_icon, |
SkBitmap* zero_icon); |
- virtual ~SettingLevelBubble(); |
private: |
- // Overridden from BubbleDelegate. |
- virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; |
- virtual bool CloseOnEscape() OVERRIDE; |
- virtual bool FadeInOnShow() OVERRIDE; |
- |
// Callback for |hide_timer_|. Closes the bubble. |
void OnHideTimeout(); |
@@ -89,9 +112,9 @@ class SettingLevelBubble : public BubbleDelegate { |
SkBitmap* increase_icon_; |
SkBitmap* decrease_icon_; |
SkBitmap* disabled_icon_; |
+ SkBitmap* current_icon_; |
- // Currently shown bubble or NULL. |
- Bubble* bubble_; |
+ bool enabled_; |
// Contents view owned by Bubble. |
SettingLevelBubbleView* view_; |