replace OVERRIDE and FINAL with override and final in ash/
[chromium-blink-merge.git] / ash / system / audio / volume_view.h
blobd0fbb739e29e868bbed182015feab12da20af69f
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
3 // found in the LICENSE file.
5 #ifndef ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_
6 #define ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_
8 #include "ash/system/tray/actionable_view.h"
9 #include "ui/gfx/font.h"
10 #include "ui/views/controls/button/button.h"
11 #include "ui/views/controls/slider.h"
13 namespace views {
14 class View;
15 class ImageView;
18 namespace ash {
19 class HoverHighlightView;
20 class SystemTrayItem;
22 namespace system {
23 class TrayAudioDelegate;
26 namespace tray {
27 class BarSeparator;
28 class VolumeButton;
29 class VolumeSlider;
31 class VolumeView : public ActionableView,
32 public views::ButtonListener,
33 public views::SliderListener {
34 public:
35 VolumeView(SystemTrayItem* owner,
36 system::TrayAudioDelegate* audio_delegate,
37 bool is_default_view);
39 virtual ~VolumeView();
41 void Update();
43 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00].
44 void SetVolumeLevel(float percent);
46 private:
47 // Updates bar_, device_type_ icon, and more_ buttons.
48 void UpdateDeviceTypeAndMore();
49 void HandleVolumeUp(float percent);
50 void HandleVolumeDown(float percent);
52 // Overridden from views::View.
53 virtual void Layout() override;
55 // Overridden from views::ButtonListener.
56 virtual void ButtonPressed(views::Button* sender,
57 const ui::Event& event) override;
59 // Overridden from views::SliderListener.
60 virtual void SliderValueChanged(views::Slider* sender,
61 float value,
62 float old_value,
63 views::SliderChangeReason reason) override;
65 // Overriden from ActionableView.
66 virtual bool PerformAction(const ui::Event& event) override;
68 SystemTrayItem* owner_;
69 system::TrayAudioDelegate* audio_delegate_;
70 VolumeButton* icon_;
71 VolumeSlider* slider_;
72 BarSeparator* bar_;
73 views::ImageView* device_type_;
74 views::ImageView* more_;
75 bool is_default_view_;
77 DISALLOW_COPY_AND_ASSIGN(VolumeView);
80 } // namespace tray
81 } // namespace ash
83 #endif // ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_