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

Side by Side Diff: chrome/browser/chromeos/brightness_bubble_view_views.cc

Issue 8319008: aura: brightness and volume bubble. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/brightness_bubble_view_views.h"
6
7 #include "base/memory/singleton.h"
8 #include "grit/theme_resources.h"
9 #include "ui/base/resource/resource_bundle.h"
10 #include "views/widget/widget.h"
11
12 namespace chromeos {
13
14 views::Widget* BrightnessBubble::widget_ = NULL;
15
16 BrightnessBubble::BrightnessBubble() {}
17
18 void BrightnessBubble::ShowBubble(double percent, bool enabled) {
19 if (!widget_) {
20 widget_= SettingLevelBubbleViewViews::ConstructSettingLevelBubble(
21 ResourceBundle::GetSharedInstance().GetBitmapNamed(
Daniel Erat 2011/10/18 17:55:12 nit: indent four spaces, not six
alicet1 2011/10/19 14:59:16 Done.
22 IDR_BRIGHTNESS_BUBBLE_ICON),
23 ResourceBundle::GetSharedInstance().GetBitmapNamed(
24 IDR_BRIGHTNESS_BUBBLE_ICON),
25 ResourceBundle::GetSharedInstance().GetBitmapNamed(
26 IDR_BRIGHTNESS_BUBBLE_ICON),
27 percent, enabled);
28 } else {
29 static_cast<SettingLevelBubbleViewViews*>(widget_->widget_delegate())
30 ->UpdateSettingLevel(percent, enabled);
31 }
32 widget_->Show();
33 static_cast<SettingLevelBubbleViewViews*>(widget_->widget_delegate())
34 ->StartHideTimer();
35 }
36
37 void BrightnessBubble::UpdateWithoutShowingBubble(int level, bool enabled) {
38 if (widget_)
39 static_cast<SettingLevelBubbleViewViews*>(widget_->widget_delegate())
40 ->UpdateWithoutShowingBubble(level, enabled);
41 }
42
43 void BrightnessBubble::HideBubble() {
44 if (widget_)
45 widget_->Close();
46 }
47
48 // static
49 BrightnessBubble* BrightnessBubble::GetInstance() {
50 return Singleton<BrightnessBubble>::get();
51 }
52
53 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698