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

Side by Side Diff: chrome/browser/chromeos/volume_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/volume_bubble_view_views.h"
6
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/chromeos/setting_level_bubble_view_views.h"
9 #include "grit/theme_resources.h"
10 #include "ui/base/resource/resource_bundle.h"
11 #include "views/widget/widget.h"
12
13 namespace chromeos {
14
15 views::Widget* VolumeBubble::widget_ = NULL;
16
17 VolumeBubble::VolumeBubble() {}
18
19 void VolumeBubble::ShowBubble(double percent, bool enabled) {
20 if (!widget_) {
21 widget_= SettingLevelBubbleViewViews::ConstructSettingLevelBubble(
22 ResourceBundle::GetSharedInstance().GetBitmapNamed(
23 IDR_VOLUME_BUBBLE_UP_ICON),
24 ResourceBundle::GetSharedInstance().GetBitmapNamed(
25 IDR_VOLUME_BUBBLE_DOWN_ICON),
26 ResourceBundle::GetSharedInstance().GetBitmapNamed(
27 IDR_VOLUME_BUBBLE_MUTE_ICON),
28 percent, enabled);
29 } else {
30 static_cast<SettingLevelBubbleViewViews*>(widget_->widget_delegate())
31 ->UpdateSettingLevel(percent, enabled);
32 }
33 widget_->Show();
34 static_cast<SettingLevelBubbleViewViews*>(widget_->widget_delegate())
35 ->StartHideTimer();
36 }
37
38 void VolumeBubble::HideBubble() {
39 if (widget_)
40 widget_->Close();
41 }
42
43 // static
44 VolumeBubble* VolumeBubble::GetInstance() {
45 return Singleton<VolumeBubble>::get();
46 }
47 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698