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

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

Issue 2831023003: Refactor AddScrollListItem() in system menu detailed views (Closed)
Patch Set: Rebased Created 3 years, 8 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/audio_detailed_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
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_AUDIO_DETAILED_VIEW_H_ 5 #ifndef ASH_SYSTEM_AUDIO_AUDIO_DETAILED_VIEW_H_
6 #define ASH_SYSTEM_AUDIO_AUDIO_DETAILED_VIEW_H_ 6 #define ASH_SYSTEM_AUDIO_AUDIO_DETAILED_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "ash/system/tray/tray_details_view.h" 10 #include "ash/system/tray/tray_details_view.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "chromeos/audio/audio_device.h" 12 #include "chromeos/audio/audio_device.h"
13 13
14 namespace gfx { 14 namespace gfx {
15 struct VectorIcon; 15 struct VectorIcon;
16 } 16 }
17 17
18 namespace views {
19 class View;
20 }
21
22 namespace ash { 18 namespace ash {
23 class HoverHighlightView;
24
25 namespace tray { 19 namespace tray {
26 20
27 class AudioDetailedView : public TrayDetailsView { 21 class AudioDetailedView : public TrayDetailsView {
28 public: 22 public:
29 explicit AudioDetailedView(SystemTrayItem* owner); 23 explicit AudioDetailedView(SystemTrayItem* owner);
30 24
31 ~AudioDetailedView() override; 25 ~AudioDetailedView() override;
32 26
33 void Update(); 27 void Update();
34 28
35 private: 29 private:
36 // Helper functions to add non-clickable header rows within the scrollable 30 // Helper function to add non-clickable header rows within the scrollable
37 // list. 31 // list.
38 void AddInputHeader(); 32 void AddAudioSubHeader(const gfx::VectorIcon& icon, int text_id);
39 void AddOutputHeader();
40 void AddScrollListInfoItem(int text_id, const gfx::VectorIcon& icon);
41
42 HoverHighlightView* AddScrollListItem(const base::string16& text,
43 bool highlight,
44 bool checked);
45 33
46 void CreateItems(); 34 void CreateItems();
47 35
48 void UpdateScrollableList(); 36 void UpdateScrollableList();
49 void UpdateAudioDevices(); 37 void UpdateAudioDevices();
50 38
51 // TrayDetailsView: 39 // TrayDetailsView:
52 void HandleViewClicked(views::View* view) override; 40 void HandleViewClicked(views::View* view) override;
53 41
54 typedef std::map<views::View*, chromeos::AudioDevice> AudioDeviceMap; 42 typedef std::map<views::View*, chromeos::AudioDevice> AudioDeviceMap;
55 43
56 chromeos::AudioDeviceList output_devices_; 44 chromeos::AudioDeviceList output_devices_;
57 chromeos::AudioDeviceList input_devices_; 45 chromeos::AudioDeviceList input_devices_;
58 AudioDeviceMap device_map_; 46 AudioDeviceMap device_map_;
59 47
60 DISALLOW_COPY_AND_ASSIGN(AudioDetailedView); 48 DISALLOW_COPY_AND_ASSIGN(AudioDetailedView);
61 }; 49 };
62 50
63 } // namespace tray 51 } // namespace tray
64 } // namespace ash 52 } // namespace ash
65 53
66 #endif // ASH_SYSTEM_AUDIO_AUDIO_DETAILED_VIEW_H_ 54 #endif // ASH_SYSTEM_AUDIO_AUDIO_DETAILED_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | ash/system/audio/audio_detailed_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698