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

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

Issue 2483393002: chromeos: Combine TrayAudio and TrayAudioChromeOs classes (Closed)
Patch Set: rebase 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
« no previous file with comments | « ash/common/system/audio/tray_audio_delegate.h ('k') | ash/common/system/audio/volume_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/macros.h"
9 #include "ui/views/controls/button/button.h"
10 #include "ui/views/controls/slider.h"
11 #include "ui/views/view.h"
12
13 namespace views {
14 class CustomButton;
15 class ImageView;
16 class Separator;
17 class Slider;
18 }
19
20 namespace ash {
21 class SystemTrayItem;
22 class TriView;
23
24 namespace system {
25 class TrayAudioDelegate;
26 }
27
28 namespace tray {
29 class VolumeButton;
30
31 class VolumeView : public views::View,
32 public views::SliderListener,
33 public views::ButtonListener {
34 public:
35 VolumeView(SystemTrayItem* owner,
36 system::TrayAudioDelegate* audio_delegate,
37 bool is_default_view);
38
39 ~VolumeView() override;
40
41 void Update();
42
43 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00].
44 void SetVolumeLevel(float percent);
45
46 private:
47 // Updates device_type_ icon and more_ button.
48 void UpdateDeviceTypeAndMore();
49 void HandleVolumeUp(float percent);
50 void HandleVolumeDown(float percent);
51
52 // SliderListener:
53 void SliderValueChanged(views::Slider* sender,
54 float value,
55 float old_value,
56 views::SliderChangeReason reason) override;
57
58 // views::ButtonListener:
59 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
60
61 // views::View:
62 bool OnKeyPressed(const ui::KeyEvent& event) override;
63 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
64
65 SystemTrayItem* owner_;
66 // The only immediate child view of |this|. All other view elements are added
67 // to the |tri_view_| to handle layout.
68 TriView* tri_view_;
69 system::TrayAudioDelegate* audio_delegate_;
70 views::CustomButton* more_button_;
71 VolumeButton* icon_;
72 views::Slider* slider_;
73 views::Separator* separator_; // Not used in material design.
74 views::ImageView* device_type_;
75 bool is_default_view_;
76
77 DISALLOW_COPY_AND_ASSIGN(VolumeView);
78 };
79
80 } // namespace tray
81 } // namespace ash
82
83 #endif // ASH_COMMON_SYSTEM_AUDIO_VOLUME_VIEW_H_
OLDNEW
« no previous file with comments | « ash/common/system/audio/tray_audio_delegate.h ('k') | ash/common/system/audio/volume_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698