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

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

Issue 7566018: chromeos: Update volume key behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 4 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_view.cc
diff --git a/chrome/browser/chromeos/setting_level_bubble_view.cc b/chrome/browser/chromeos/setting_level_bubble_view.cc
index 5395403da377774c3da5ea731ca88f44c31a294e..a7faa2805908c5450049453040cb655da163b709 100644
--- a/chrome/browser/chromeos/setting_level_bubble_view.cc
+++ b/chrome/browser/chromeos/setting_level_bubble_view.cc
@@ -32,15 +32,18 @@ SettingLevelBubbleView::SettingLevelBubbleView()
icon_(NULL) {
}
-void SettingLevelBubbleView::Init(SkBitmap* icon, int level_percent) {
+void SettingLevelBubbleView::Init(SkBitmap* icon,
+ int level_percent,
+ bool enabled) {
DCHECK(icon);
DCHECK(level_percent >= 0 && level_percent <= 100);
icon_ = icon;
progress_bar_ = new views::ProgressBar();
AddChildView(progress_bar_);
- Update(level_percent);
progress_bar_->EnableCanvasFlippingForRTLUI(true);
EnableCanvasFlippingForRTLUI(true);
+ SetLevel(level_percent);
+ SetEnabled(enabled);
}
void SettingLevelBubbleView::SetIcon(SkBitmap* icon) {
@@ -49,11 +52,15 @@ void SettingLevelBubbleView::SetIcon(SkBitmap* icon) {
SchedulePaint();
}
-void SettingLevelBubbleView::Update(int level_percent) {
+void SettingLevelBubbleView::SetLevel(int level_percent) {
DCHECK(level_percent >= 0 && level_percent <= 100);
progress_bar_->SetProgress(level_percent);
}
+void SettingLevelBubbleView::SetEnabled(bool enabled) {
+ progress_bar_->SetEnabled(enabled);
+}
+
void SettingLevelBubbleView::OnPaint(gfx::Canvas* canvas) {
views::View::OnPaint(canvas);
canvas->DrawBitmapInt(*icon_, kPadding, (height() - icon_->height()) / 2);
« no previous file with comments | « chrome/browser/chromeos/setting_level_bubble_view.h ('k') | chrome/browser/chromeos/system_key_event_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698