| 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/common/system/chromeos/audio/audio_detailed_view.h" | 5 #include "ash/common/system/chromeos/audio/audio_detailed_view.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | |
| 9 #include "ash/common/system/tray/hover_highlight_view.h" | 8 #include "ash/common/system/tray/hover_highlight_view.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 11 #include "ash/common/system/tray/tray_popup_utils.h" | 10 #include "ash/common/system/tray/tray_popup_utils.h" |
| 12 #include "ash/common/system/tray/tri_view.h" | 11 #include "ash/common/system/tray/tri_view.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chromeos/audio/cras_audio_handler.h" | 13 #include "chromeos/audio/cras_audio_handler.h" |
| 15 #include "grit/ash_strings.h" | 14 #include "grit/ash_strings.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/gfx/color_palette.h" | 17 #include "ui/gfx/color_palette.h" |
| 19 #include "ui/gfx/paint_vector_icon.h" | 18 #include "ui/gfx/paint_vector_icon.h" |
| 20 #include "ui/gfx/vector_icons_public.h" | 19 #include "ui/gfx/vector_icons_public.h" |
| 21 #include "ui/native_theme/native_theme.h" | 20 #include "ui/native_theme/native_theme.h" |
| 22 #include "ui/views/border.h" | 21 #include "ui/views/border.h" |
| 23 #include "ui/views/controls/image_view.h" | 22 #include "ui/views/controls/image_view.h" |
| 24 #include "ui/views/controls/label.h" | 23 #include "ui/views/controls/label.h" |
| 24 #include "ui/views/controls/scroll_view.h" |
| 25 #include "ui/views/controls/separator.h" | 25 #include "ui/views/controls/separator.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { | 29 base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { |
| 30 switch (device.type) { | 30 switch (device.type) { |
| 31 case chromeos::AUDIO_TYPE_FRONT_MIC: | 31 case chromeos::AUDIO_TYPE_FRONT_MIC: |
| 32 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_FRONT_MIC); | 32 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_FRONT_MIC); |
| 33 case chromeos::AUDIO_TYPE_HEADPHONE: | 33 case chromeos::AUDIO_TYPE_HEADPHONE: |
| 34 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_HEADPHONE); | 34 return l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_AUDIO_HEADPHONE); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 AudioDeviceMap::iterator iter = device_map_.find(view); | 224 AudioDeviceMap::iterator iter = device_map_.find(view); |
| 225 if (iter == device_map_.end()) | 225 if (iter == device_map_.end()) |
| 226 return; | 226 return; |
| 227 chromeos::AudioDevice device = iter->second; | 227 chromeos::AudioDevice device = iter->second; |
| 228 CrasAudioHandler::Get()->SwitchToDevice(device, true, | 228 CrasAudioHandler::Get()->SwitchToDevice(device, true, |
| 229 CrasAudioHandler::ACTIVATE_BY_USER); | 229 CrasAudioHandler::ACTIVATE_BY_USER); |
| 230 } | 230 } |
| 231 | 231 |
| 232 } // namespace tray | 232 } // namespace tray |
| 233 } // namespace ash | 233 } // namespace ash |
| OLD | NEW |