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 #include "ash/system/chromeos/audio/audio_detailed_view.h" | 5 #include "ash/system/chromeos/audio/audio_detailed_view.h" |
6 | 6 |
7 #include "ash/system/tray/fixed_sized_scroll_view.h" | 7 #include "ash/system/tray/fixed_sized_scroll_view.h" |
8 #include "ash/system/tray/hover_highlight_view.h" | 8 #include "ash/system/tray/hover_highlight_view.h" |
9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chromeos/audio/cras_audio_handler.h" | 11 #include "chromeos/audio/cras_audio_handler.h" |
12 #include "grit/ash_resources.h" | |
13 #include "grit/ash_strings.h" | 12 #include "grit/ash_strings.h" |
14 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
15 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
16 #include "ui/views/border.h" | 15 #include "ui/views/border.h" |
17 #include "ui/views/controls/label.h" | 16 #include "ui/views/controls/label.h" |
18 | 17 |
19 namespace { | 18 namespace { |
20 | 19 |
21 base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { | 20 base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { |
22 switch(device.type) { | 21 switch (device.type) { |
23 case chromeos::AUDIO_TYPE_HEADPHONE: | 22 case chromeos::AUDIO_TYPE_HEADPHONE: |
24 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_HEADPHONE); | 23 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_HEADPHONE); |
25 case chromeos::AUDIO_TYPE_INTERNAL_SPEAKER: | 24 case chromeos::AUDIO_TYPE_INTERNAL_SPEAKER: |
26 return l10n_util::GetStringUTF16( | 25 return l10n_util::GetStringUTF16( |
27 IDS_ASH_STATUS_TRAY_AUDIO_INTERNAL_SPEAKER); | 26 IDS_ASH_STATUS_TRAY_AUDIO_INTERNAL_SPEAKER); |
28 case chromeos::AUDIO_TYPE_INTERNAL_MIC: | 27 case chromeos::AUDIO_TYPE_INTERNAL_MIC: |
29 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_INTERNAL_MIC); | 28 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_INTERNAL_MIC); |
30 case chromeos::AUDIO_TYPE_USB: | 29 case chromeos::AUDIO_TYPE_USB: |
31 return l10n_util::GetStringFUTF16( | 30 return l10n_util::GetStringFUTF16( |
32 IDS_ASH_STATUS_TRAY_AUDIO_USB_DEVICE, | 31 IDS_ASH_STATUS_TRAY_AUDIO_USB_DEVICE, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 AudioDeviceMap::iterator iter = device_map_.find(sender); | 168 AudioDeviceMap::iterator iter = device_map_.find(sender); |
170 if (iter == device_map_.end()) | 169 if (iter == device_map_.end()) |
171 return; | 170 return; |
172 chromeos::AudioDevice& device = iter->second; | 171 chromeos::AudioDevice& device = iter->second; |
173 CrasAudioHandler::Get()->SwitchToDevice(device); | 172 CrasAudioHandler::Get()->SwitchToDevice(device); |
174 } | 173 } |
175 } | 174 } |
176 | 175 |
177 } // namespace tray | 176 } // namespace tray |
178 } // namespace ash | 177 } // namespace ash |
OLD | NEW |