| OLD | NEW |
| 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_COMMON_SYSTEM_CHROMEOS_AUDIO_AUDIO_DETAILED_VIEW_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_AUDIO_DETAILED_VIEW_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_AUDIO_DETAILED_VIEW_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_AUDIO_DETAILED_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/common/system/tray/tray_details_view.h" | 10 #include "ash/common/system/tray/tray_details_view.h" |
| 11 #include "ash/common/system/tray/view_click_listener.h" | |
| 12 #include "base/macros.h" | 11 #include "base/macros.h" |
| 13 #include "chromeos/audio/audio_device.h" | 12 #include "chromeos/audio/audio_device.h" |
| 14 #include "ui/gfx/font.h" | 13 #include "ui/gfx/font.h" |
| 15 | 14 |
| 16 namespace views { | 15 namespace views { |
| 17 class View; | 16 class View; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace ash { | 19 namespace ash { |
| 21 class HoverHighlightView; | 20 class HoverHighlightView; |
| 22 | 21 |
| 23 namespace tray { | 22 namespace tray { |
| 24 | 23 |
| 25 class AudioDetailedView : public TrayDetailsView, public ViewClickListener { | 24 class AudioDetailedView : public TrayDetailsView { |
| 26 public: | 25 public: |
| 27 explicit AudioDetailedView(SystemTrayItem* owner); | 26 explicit AudioDetailedView(SystemTrayItem* owner); |
| 28 | 27 |
| 29 ~AudioDetailedView() override; | 28 ~AudioDetailedView() override; |
| 30 | 29 |
| 31 void Update(); | 30 void Update(); |
| 32 | 31 |
| 33 private: | 32 private: |
| 34 void AddScrollListInfoItem(const base::string16& text); | 33 void AddScrollListInfoItem(const base::string16& text); |
| 35 | 34 |
| 36 HoverHighlightView* AddScrollListItem(const base::string16& text, | 35 HoverHighlightView* AddScrollListItem(const base::string16& text, |
| 37 bool highlight, | 36 bool highlight, |
| 38 bool checked); | 37 bool checked); |
| 39 | 38 |
| 40 void CreateHeaderEntry(); | |
| 41 void CreateItems(); | 39 void CreateItems(); |
| 42 | 40 |
| 43 void UpdateScrollableList(); | 41 void UpdateScrollableList(); |
| 44 void UpdateAudioDevices(); | 42 void UpdateAudioDevices(); |
| 45 | 43 |
| 46 // Overridden from ViewClickListener. | 44 // TrayDetailsView: |
| 47 void OnViewClicked(views::View* sender) override; | 45 void HandleViewClicked(views::View* view) override; |
| 48 | 46 |
| 49 typedef std::map<views::View*, chromeos::AudioDevice> AudioDeviceMap; | 47 typedef std::map<views::View*, chromeos::AudioDevice> AudioDeviceMap; |
| 50 | 48 |
| 51 chromeos::AudioDeviceList output_devices_; | 49 chromeos::AudioDeviceList output_devices_; |
| 52 chromeos::AudioDeviceList input_devices_; | 50 chromeos::AudioDeviceList input_devices_; |
| 53 AudioDeviceMap device_map_; | 51 AudioDeviceMap device_map_; |
| 54 | 52 |
| 55 DISALLOW_COPY_AND_ASSIGN(AudioDetailedView); | 53 DISALLOW_COPY_AND_ASSIGN(AudioDetailedView); |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 } // namespace tray | 56 } // namespace tray |
| 59 } // namespace ash | 57 } // namespace ash |
| 60 | 58 |
| 61 #endif // ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_AUDIO_DETAILED_VIEW_H_ | 59 #endif // ASH_COMMON_SYSTEM_CHROMEOS_AUDIO_AUDIO_DETAILED_VIEW_H_ |
| OLD | NEW |