OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/system/audio/volume_view.h" | 5 #include "ash/system/audio/volume_view.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/system/audio/tray_audio.h" | 9 #include "ash/system/audio/tray_audio.h" |
10 #include "ash/system/audio/tray_audio_delegate.h" | 10 #include "ash/system/audio/tray_audio_delegate.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 gfx::ImageSkia image_skia = gfx::ImageSkiaOperations::ExtractSubset( | 66 gfx::ImageSkia image_skia = gfx::ImageSkiaOperations::ExtractSubset( |
67 *(image_.ToImageSkia()), region); | 67 *(image_.ToImageSkia()), region); |
68 SetImage(views::CustomButton::STATE_NORMAL, &image_skia); | 68 SetImage(views::CustomButton::STATE_NORMAL, &image_skia); |
69 image_index_ = image_index; | 69 image_index_ = image_index; |
70 } | 70 } |
71 SchedulePaint(); | 71 SchedulePaint(); |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 // Overridden from views::View. | 75 // Overridden from views::View. |
76 virtual gfx::Size GetPreferredSize() OVERRIDE { | 76 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
77 gfx::Size size = views::ToggleImageButton::GetPreferredSize(); | 77 gfx::Size size = views::ToggleImageButton::GetPreferredSize(); |
78 size.set_height(kTrayPopupItemHeight); | 78 size.set_height(kTrayPopupItemHeight); |
79 return size; | 79 return size; |
80 } | 80 } |
81 | 81 |
82 system::TrayAudioDelegate* audio_delegate_; | 82 system::TrayAudioDelegate* audio_delegate_; |
83 gfx::Image image_; | 83 gfx::Image image_; |
84 int image_index_; | 84 int image_index_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(VolumeButton); | 86 DISALLOW_COPY_AND_ASSIGN(VolumeButton); |
(...skipping 25 matching lines...) Expand all Loading... |
112 DISALLOW_COPY_AND_ASSIGN(VolumeSlider); | 112 DISALLOW_COPY_AND_ASSIGN(VolumeSlider); |
113 }; | 113 }; |
114 | 114 |
115 // Vertical bar separator that can be placed on the VolumeView. | 115 // Vertical bar separator that can be placed on the VolumeView. |
116 class BarSeparator : public views::View { | 116 class BarSeparator : public views::View { |
117 public: | 117 public: |
118 BarSeparator() {} | 118 BarSeparator() {} |
119 virtual ~BarSeparator() {} | 119 virtual ~BarSeparator() {} |
120 | 120 |
121 // Overriden from views::View. | 121 // Overriden from views::View. |
122 virtual gfx::Size GetPreferredSize() OVERRIDE { | 122 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
123 return gfx::Size(kBarSeparatorWidth, kBarSeparatorHeight); | 123 return gfx::Size(kBarSeparatorWidth, kBarSeparatorHeight); |
124 } | 124 } |
125 | 125 |
126 private: | 126 private: |
127 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 127 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
128 canvas->FillRect(gfx::Rect(width() / 2, 0, 1, height()), | 128 canvas->FillRect(gfx::Rect(width() / 2, 0, 1, height()), |
129 kButtonStrokeColor); | 129 kButtonStrokeColor); |
130 } | 130 } |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(BarSeparator); | 132 DISALLOW_COPY_AND_ASSIGN(BarSeparator); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 | 321 |
322 bool VolumeView::PerformAction(const ui::Event& event) { | 322 bool VolumeView::PerformAction(const ui::Event& event) { |
323 if (!more_->visible()) | 323 if (!more_->visible()) |
324 return false; | 324 return false; |
325 owner_->TransitionDetailedView(); | 325 owner_->TransitionDetailedView(); |
326 return true; | 326 return true; |
327 } | 327 } |
328 | 328 |
329 } // namespace tray | 329 } // namespace tray |
330 } // namespace ash | 330 } // namespace ash |
OLD | NEW |