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

Side by Side Diff: ash/common/system/audio/volume_view.h

Issue 2483393002: chromeos: Combine TrayAudio and TrayAudioChromeOs classes (Closed)
Patch Set: cleanest diff ever Created 4 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
OLDNEW
(Empty)
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.
4
5 #ifndef ASH_COMMON_SYSTEM_AUDIO_VOLUME_VIEW_H_
6 #define ASH_COMMON_SYSTEM_AUDIO_VOLUME_VIEW_H_
7
8 #include "ash/common/system/tray/actionable_view.h"
9 #include "base/macros.h"
10 #include "ui/gfx/font.h"
11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/controls/slider.h"
13
14 namespace views {
15 class View;
16 class ImageView;
17 class Separator;
18 class Slider;
19 }
20
21 namespace ash {
22 class SystemTrayItem;
23
24 namespace system {
25 class TrayAudioDelegate;
26 }
27
28 namespace tray {
29 class VolumeButton;
30
31 class VolumeView : public ActionableView,
32 public views::SliderListener {
33 public:
34 VolumeView(SystemTrayItem* owner,
35 system::TrayAudioDelegate* audio_delegate,
36 bool is_default_view);
37
38 ~VolumeView() override;
39
40 void Update();
41
42 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00].
43 void SetVolumeLevel(float percent);
44
45 private:
46 // Updates bar_, device_type_ icon, and more_ buttons.
47 void UpdateDeviceTypeAndMore();
48 void HandleVolumeUp(float percent);
49 void HandleVolumeDown(float percent);
50
51 // Overridden from views::SliderListener.
52 void SliderValueChanged(views::Slider* sender,
53 float value,
54 float old_value,
55 views::SliderChangeReason reason) override;
56
57 // Overriden from ActionableView.
58 bool PerformAction(const ui::Event& event) override;
59 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
60
61 // views::View:
62 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
63 void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
64
65 system::TrayAudioDelegate* audio_delegate_;
66 views::View* more_region_;
67 VolumeButton* icon_;
68 views::Slider* slider_;
69 views::Separator* separator_;
70 views::ImageView* device_type_;
71 views::ImageView* more_;
72 bool is_default_view_;
73
74 DISALLOW_COPY_AND_ASSIGN(VolumeView);
75 };
76
77 } // namespace tray
78 } // namespace ash
79
80 #endif // ASH_COMMON_SYSTEM_AUDIO_VOLUME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698