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

Unified Diff: chrome/browser/chromeos/brightness_bubble.cc

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/brightness_bubble.cc
diff --git a/chrome/browser/chromeos/brightness_bubble.cc b/chrome/browser/chromeos/brightness_bubble.cc
index 7c149aacde2b3e23cb1fcf20960756688df41a0c..9379d652e364f228729f22ad4274c36b017103c4 100644
--- a/chrome/browser/chromeos/brightness_bubble.cc
+++ b/chrome/browser/chromeos/brightness_bubble.cc
@@ -7,17 +7,39 @@
#include "base/memory/singleton.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
+#include "views/widget/widget.h"
namespace chromeos {
-BrightnessBubble::BrightnessBubble()
- : SettingLevelBubble(
- ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_BRIGHTNESS_BUBBLE_ICON),
- ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_BRIGHTNESS_BUBBLE_ICON),
- ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_BRIGHTNESS_BUBBLE_ICON)) {
+BrightnessBubble::BrightnessBubble() : widget_(NULL) {}
msw 2011/10/21 02:42:06 Move the ctor and dtor below the public functions,
alicet1 2011/10/21 18:11:36 Done.
+
+BrightnessBubble::~BrightnessBubble() {
+ delete widget_;
+ widget_ = NULL;
+}
+
+void BrightnessBubble::ShowBubble(double percent, bool enabled) {
+ widget_= SettingLevelBubble::ShowBubble(
Daniel Erat 2011/10/21 00:25:21 nit: space between 'widget_' and '='
alicet1 2011/10/21 18:11:36 Done.
+ widget_,
+ ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_BRIGHTNESS_BUBBLE_ICON),
+ ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_BRIGHTNESS_BUBBLE_ICON),
+ ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_BRIGHTNESS_BUBBLE_ICON),
+ percent,
+ enabled);
+}
+
+void BrightnessBubble::UpdateWithoutShowingBubble(int level, bool enabled) {
+ if (widget_)
+ static_cast<SettingLevelBubble*>(widget_->widget_delegate())
+ ->UpdateWithoutShowingBubble(level, enabled);
+}
+
+void BrightnessBubble::HideBubble() {
+ if (widget_)
+ widget_->Close();
}
// static

Powered by Google App Engine
This is Rietveld 408576698