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

Unified Diff: chrome/browser/chromeos/setting_level_bubble.h

Issue 8319008: aura: brightness and volume bubble. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update 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
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_;

Powered by Google App Engine
This is Rietveld 408576698