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

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

Issue 865333002: Update Touch Feedback on Volume tray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months 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 | « no previous file | ash/system/audio/volume_view.cc » ('j') | ash/system/audio/volume_view.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_ 5 #ifndef ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_
6 #define ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_ 6 #define ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_
7 7
8 #include "ash/system/tray/actionable_view.h" 8 #include "ash/system/tray/actionable_view.h"
9 #include "ui/gfx/font.h" 9 #include "ui/gfx/font.h"
10 #include "ui/views/controls/button/button.h" 10 #include "ui/views/controls/button/button.h"
11 #include "ui/views/controls/slider.h" 11 #include "ui/views/controls/slider.h"
12 12
13 namespace views { 13 namespace views {
14 class View; 14 class View;
15 class ImageView; 15 class ImageView;
16 class Separator;
17 class Slider;
16 } 18 }
17 19
18 namespace ash { 20 namespace ash {
19 class HoverHighlightView;
20 class SystemTrayItem; 21 class SystemTrayItem;
21 22
22 namespace system { 23 namespace system {
23 class TrayAudioDelegate; 24 class TrayAudioDelegate;
24 } 25 }
25 26
26 namespace tray { 27 namespace tray {
27 class BarSeparator;
28 class VolumeButton; 28 class VolumeButton;
29 class VolumeSlider;
30 29
31 class VolumeView : public ActionableView, 30 class VolumeView : public ActionableView,
32 public views::ButtonListener, 31 public views::ButtonListener,
33 public views::SliderListener { 32 public views::SliderListener {
34 public: 33 public:
35 VolumeView(SystemTrayItem* owner, 34 VolumeView(SystemTrayItem* owner,
36 system::TrayAudioDelegate* audio_delegate, 35 system::TrayAudioDelegate* audio_delegate,
37 bool is_default_view); 36 bool is_default_view);
38 37
39 ~VolumeView() override; 38 ~VolumeView() override;
40 39
41 void Update(); 40 void Update();
42 41
43 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00]. 42 // Sets volume level on slider_, |percent| is ranged from [0.00] to [1.00].
44 void SetVolumeLevel(float percent); 43 void SetVolumeLevel(float percent);
45 44
46 private: 45 private:
47 // Updates bar_, device_type_ icon, and more_ buttons. 46 // Updates bar_, device_type_ icon, and more_ buttons.
48 void UpdateDeviceTypeAndMore(); 47 void UpdateDeviceTypeAndMore();
49 void HandleVolumeUp(float percent); 48 void HandleVolumeUp(float percent);
50 void HandleVolumeDown(float percent); 49 void HandleVolumeDown(float percent);
51 50
52 // Overridden from views::View.
53 void Layout() override;
54
55 // Overridden from views::ButtonListener. 51 // Overridden from views::ButtonListener.
56 void ButtonPressed(views::Button* sender, const ui::Event& event) override; 52 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
57 53
58 // Overridden from views::SliderListener. 54 // Overridden from views::SliderListener.
59 void SliderValueChanged(views::Slider* sender, 55 void SliderValueChanged(views::Slider* sender,
60 float value, 56 float value,
61 float old_value, 57 float old_value,
62 views::SliderChangeReason reason) override; 58 views::SliderChangeReason reason) override;
63 59
64 // Overriden from ActionableView. 60 // Overriden from ActionableView.
65 bool PerformAction(const ui::Event& event) override; 61 bool PerformAction(const ui::Event& event) override;
66 62
63 // views::View:
64 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
65
67 SystemTrayItem* owner_; 66 SystemTrayItem* owner_;
68 system::TrayAudioDelegate* audio_delegate_; 67 system::TrayAudioDelegate* audio_delegate_;
68 views::View* more_region_;
69 VolumeButton* icon_; 69 VolumeButton* icon_;
70 VolumeSlider* slider_; 70 views::Slider* slider_;
71 BarSeparator* bar_; 71 views::Separator* separator_;
72 views::ImageView* device_type_; 72 views::ImageView* device_type_;
73 views::ImageView* more_; 73 views::ImageView* more_;
74 bool is_default_view_; 74 bool is_default_view_;
75 75
76 DISALLOW_COPY_AND_ASSIGN(VolumeView); 76 DISALLOW_COPY_AND_ASSIGN(VolumeView);
77 }; 77 };
78 78
79 } // namespace tray 79 } // namespace tray
80 } // namespace ash 80 } // namespace ash
81 81
82 #endif // ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_ 82 #endif // ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_
83 83
OLDNEW
« no previous file with comments | « no previous file | ash/system/audio/volume_view.cc » ('j') | ash/system/audio/volume_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698