OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tray_volume.h" | 5 #include "ash/system/audio/tray_volume.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 private: | 171 private: |
172 // Overridden from views::View. | 172 // Overridden from views::View. |
173 virtual void OnBoundsChanged(const gfx::Rect& old_bounds) OVERRIDE { | 173 virtual void OnBoundsChanged(const gfx::Rect& old_bounds) OVERRIDE { |
174 int w = width() - slider_->x(); | 174 int w = width() - slider_->x(); |
175 slider_->SetSize(gfx::Size(w, slider_->height())); | 175 slider_->SetSize(gfx::Size(w, slider_->height())); |
176 } | 176 } |
177 | 177 |
178 // Overridden from views::ButtonListener. | 178 // Overridden from views::ButtonListener. |
179 virtual void ButtonPressed(views::Button* sender, | 179 virtual void ButtonPressed(views::Button* sender, |
180 const views::Event& event) OVERRIDE { | 180 const ui::Event& event) OVERRIDE { |
181 CHECK(sender == icon_ || sender == mute_); | 181 CHECK(sender == icon_ || sender == mute_); |
182 ash::SystemTrayDelegate* delegate = | 182 ash::SystemTrayDelegate* delegate = |
183 ash::Shell::GetInstance()->tray_delegate(); | 183 ash::Shell::GetInstance()->tray_delegate(); |
184 delegate->SetAudioMuted(!delegate->IsAudioMuted()); | 184 delegate->SetAudioMuted(!delegate->IsAudioMuted()); |
185 } | 185 } |
186 | 186 |
187 // Overridden from views:SliderListener. | 187 // Overridden from views:SliderListener. |
188 virtual void SliderValueChanged(views::Slider* sender, | 188 virtual void SliderValueChanged(views::Slider* sender, |
189 float value, | 189 float value, |
190 float old_value, | 190 float old_value, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 tray_view()->SetVisible(GetInitialVisibility()); | 262 tray_view()->SetVisible(GetInitialVisibility()); |
263 | 263 |
264 if (volume_view_) | 264 if (volume_view_) |
265 volume_view_->Update(); | 265 volume_view_->Update(); |
266 else | 266 else |
267 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); | 267 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); |
268 } | 268 } |
269 | 269 |
270 } // namespace internal | 270 } // namespace internal |
271 } // namespace ash | 271 } // namespace ash |
OLD | NEW |