Chromium Code Reviews| Index: ash/system/audio/volume_view.h |
| diff --git a/ash/system/audio/volume_view.h b/ash/system/audio/volume_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ebca3a7b32c0b3c9ec4e35d2aec2dddd9f0c00e1 |
| --- /dev/null |
| +++ b/ash/system/audio/volume_view.h |
| @@ -0,0 +1,89 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_ |
| +#define ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_ |
| + |
| +#include "ash/system/tray/actionable_view.h" |
| +#include "ui/gfx/font.h" |
| +#include "ui/views/controls/button/button.h" |
| +#include "ui/views/controls/slider.h" |
| + |
| +namespace views { |
| +class View; |
| +class ImageView; |
| +} |
| + |
| +namespace ash { |
| + |
| +class SystemTrayItem; |
| + |
| +namespace system { |
| +class TrayAudioDelegate; |
| +} |
| + |
| +namespace internal { |
| + |
| +class HoverHighlightView; |
| + |
| +namespace tray { |
| + |
| +class BarSeparator; |
| +class VolumeButton; |
| +class VolumeSlider; |
| + |
| +class VolumeView : public ActionableView, |
| + public views::ButtonListener, |
| + public views::SliderListener { |
| + public: |
| + VolumeView(SystemTrayItem* owner, |
| + system::TrayAudioDelegate& audio_delegate, |
|
jennyz
2014/02/14 21:36:43
Why not just pass system::TrayAudioDelegate*?
zturner
2014/02/15 00:57:45
Done.
|
| + bool is_default_view); |
| + |
| + virtual ~VolumeView(); |
| + |
| + void Update(); |
| + |
| + // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00]. |
| + void SetVolumeLevel(float percent); |
| + |
| + private: |
| + // Updates bar_, device_type_ icon, and more_ buttons. |
| + void UpdateDeviceTypeAndMore(); |
| + void HandleVolumeUp(float percent); |
| + void HandleVolumeDown(float percent); |
| + |
| + // Overridden from views::View. |
| + virtual void Layout() OVERRIDE; |
| + |
| + // Overridden from views::ButtonListener. |
| + virtual void ButtonPressed(views::Button* sender, |
| + const ui::Event& event) OVERRIDE; |
| + |
| + // Overridden from views::SliderListener. |
| + void SliderValueChanged(views::Slider* sender, |
| + float value, |
| + float old_value, |
| + views::SliderChangeReason reason); |
| + |
| + // Overriden from ActionableView. |
| + virtual bool PerformAction(const ui::Event& event) OVERRIDE; |
| + |
| + SystemTrayItem* owner_; |
| + system::TrayAudioDelegate& audio_delegate_; |
| + VolumeButton* icon_; |
| + VolumeSlider* slider_; |
| + BarSeparator* bar_; |
| + views::ImageView* device_type_; |
| + views::ImageView* more_; |
| + bool is_default_view_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(VolumeView); |
| +}; |
| + |
| +} // namespace tray |
| +} // namespace internal |
| +} // namespace ash |
| + |
| +#endif |
|
jennyz
2014/02/14 21:36:43
Please add // ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_ afte
|