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

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

Issue 8319008: aura: brightness and volume bubble. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update comments Created 9 years, 1 month 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/setting_level_bubble_view.h" 5 #include "chrome/browser/chromeos/setting_level_bubble_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 12 matching lines...) Expand all
23 const int kProgressBarWidth = 211; 23 const int kProgressBarWidth = 211;
24 const int kProgressBarHeight = 17; 24 const int kProgressBarHeight = 17;
25 25
26 } // namespace 26 } // namespace
27 27
28 namespace chromeos { 28 namespace chromeos {
29 29
30 SettingLevelBubbleView::SettingLevelBubbleView() 30 SettingLevelBubbleView::SettingLevelBubbleView()
31 : progress_bar_(NULL), 31 : progress_bar_(NULL),
32 icon_(NULL) { 32 icon_(NULL) {
33 progress_bar_ = new views::ProgressBar();
34 AddChildView(progress_bar_);
msw 2011/10/26 18:51:42 Why are you moving this out of init?
alicet1 2011/10/27 00:34:51 the view is created as part of bubble delegate ini
Daniel Erat 2011/10/27 00:40:21 Init() should still just be getting called once, r
alicet1 2011/10/27 15:20:06 init is still called only once (per lifetime of th
33 } 35 }
34 36
35 void SettingLevelBubbleView::Init(SkBitmap* icon, double level, bool enabled) { 37 void SettingLevelBubbleView::Init(SkBitmap* icon, double level, bool enabled) {
36 DCHECK(icon); 38 DCHECK(icon);
37 icon_ = icon; 39 icon_ = icon;
38 progress_bar_ = new views::ProgressBar();
39 AddChildView(progress_bar_);
40 progress_bar_->SetDisplayRange(0.0, 100.0); 40 progress_bar_->SetDisplayRange(0.0, 100.0);
41 progress_bar_->EnableCanvasFlippingForRTLUI(true); 41 progress_bar_->EnableCanvasFlippingForRTLUI(true);
42 EnableCanvasFlippingForRTLUI(true); 42 EnableCanvasFlippingForRTLUI(true);
43 SetLevel(level); 43 SetLevel(level);
44 SetEnabled(enabled); 44 SetEnabled(enabled);
45 } 45 }
46 46
47 void SettingLevelBubbleView::SetIcon(SkBitmap* icon) { 47 void SettingLevelBubbleView::SetIcon(SkBitmap* icon) {
48 DCHECK(icon); 48 DCHECK(icon);
49 icon_ = icon; 49 icon_ = icon;
(...skipping 17 matching lines...) Expand all
67 progress_bar_->SetBounds(width() - kPadding - kProgressBarWidth, 67 progress_bar_->SetBounds(width() - kPadding - kProgressBarWidth,
68 (height() - kProgressBarHeight) / 2, 68 (height() - kProgressBarHeight) / 2,
69 kProgressBarWidth, kProgressBarHeight); 69 kProgressBarWidth, kProgressBarHeight);
70 } 70 }
71 71
72 gfx::Size SettingLevelBubbleView::GetPreferredSize() { 72 gfx::Size SettingLevelBubbleView::GetPreferredSize() {
73 return gfx::Size(kWidth, kHeight); 73 return gfx::Size(kWidth, kHeight);
74 } 74 }
75 75
76 } // namespace chromeos 76 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698