Chromium Code Reviews| 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 |