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

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

Issue 2084533008: mash: Migrate tray audio and deps to common. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase. Created 4 years, 6 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 | « ash/system/audio/tray_audio_delegate.h ('k') | ash/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_SYSTEM_AUDIO_VOLUME_VIEW_H_
6 #define ASH_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::ButtonListener,
33 public views::SliderListener {
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 bar_, device_type_ icon, and more_ buttons.
48 void UpdateDeviceTypeAndMore();
49 void HandleVolumeUp(float percent);
50 void HandleVolumeDown(float percent);
51
52 // Overridden from views::ButtonListener.
53 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
54
55 // Overridden from views::SliderListener.
56 void SliderValueChanged(views::Slider* sender,
57 float value,
58 float old_value,
59 views::SliderChangeReason reason) override;
60
61 // Overriden from ActionableView.
62 bool PerformAction(const ui::Event& event) override;
63
64 // views::View:
65 void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
66 void GetAccessibleState(ui::AXViewState* state) override;
67
68 SystemTrayItem* owner_;
69 system::TrayAudioDelegate* audio_delegate_;
70 views::View* more_region_;
71 VolumeButton* icon_;
72 views::Slider* slider_;
73 views::Separator* separator_;
74 views::ImageView* device_type_;
75 views::ImageView* more_;
76 bool is_default_view_;
77
78 DISALLOW_COPY_AND_ASSIGN(VolumeView);
79 };
80
81 } // namespace tray
82 } // namespace ash
83
84 #endif // ASH_SYSTEM_AUDIO_VOLUME_VIEW_H_
OLDNEW
« no previous file with comments | « ash/system/audio/tray_audio_delegate.h ('k') | ash/system/audio/volume_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698