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/system/tray/hover_highlight_view.h" | 7 #include "ash/common/system/tray/hover_highlight_view.h" |
8 #include "ash/common/system/tray/tray_popup_utils.h" | 8 #include "ash/common/system/tray/tray_popup_utils.h" |
9 #include "ash/common/system/tray/tri_view.h" | 9 #include "ash/common/system/tray/tri_view.h" |
| 10 #include "ash/resources/vector_icons/vector_icons.h" |
10 #include "ash/strings/grit/ash_strings.h" | 11 #include "ash/strings/grit/ash_strings.h" |
11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
12 #include "chromeos/audio/cras_audio_handler.h" | 13 #include "chromeos/audio/cras_audio_handler.h" |
13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/gfx/color_palette.h" | 15 #include "ui/gfx/color_palette.h" |
15 #include "ui/gfx/paint_vector_icon.h" | 16 #include "ui/gfx/paint_vector_icon.h" |
16 #include "ui/gfx/vector_icons_public.h" | |
17 #include "ui/native_theme/native_theme.h" | 17 #include "ui/native_theme/native_theme.h" |
18 #include "ui/views/controls/image_view.h" | 18 #include "ui/views/controls/image_view.h" |
19 #include "ui/views/controls/label.h" | 19 #include "ui/views/controls/label.h" |
20 #include "ui/views/controls/scroll_view.h" | 20 #include "ui/views/controls/scroll_view.h" |
21 #include "ui/views/controls/separator.h" | 21 #include "ui/views/controls/separator.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { | 25 base::string16 GetAudioDeviceName(const chromeos::AudioDevice& device) { |
26 switch (device.type) { | 26 switch (device.type) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 HoverHighlightView* AudioDetailedView::AddScrollListItem( | 106 HoverHighlightView* AudioDetailedView::AddScrollListItem( |
107 const base::string16& text, | 107 const base::string16& text, |
108 bool highlight, | 108 bool highlight, |
109 bool checked) { | 109 bool checked) { |
110 HoverHighlightView* container = new HoverHighlightView(this); | 110 HoverHighlightView* container = new HoverHighlightView(this); |
111 | 111 |
112 container->AddLabelRowMd(text); | 112 container->AddLabelRowMd(text); |
113 if (checked) { | 113 if (checked) { |
114 gfx::ImageSkia check_mark = gfx::CreateVectorIcon( | 114 gfx::ImageSkia check_mark = |
115 gfx::VectorIconId::CHECK_CIRCLE, gfx::kGoogleGreen700); | 115 gfx::CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); |
116 container->AddRightIcon(check_mark, check_mark.width()); | 116 container->AddRightIcon(check_mark, check_mark.width()); |
117 container->SetRightViewVisible(true); | 117 container->SetRightViewVisible(true); |
118 container->SetAccessiblityState( | 118 container->SetAccessiblityState( |
119 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | 119 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); |
120 } else { | 120 } else { |
121 container->SetAccessiblityState( | 121 container->SetAccessiblityState( |
122 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | 122 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); |
123 } | 123 } |
124 | 124 |
125 scroll_content()->AddChildView(container); | 125 scroll_content()->AddChildView(container); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 audio_handler->HasDualInternalMic()) { | 219 audio_handler->HasDualInternalMic()) { |
220 audio_handler->SwitchToFrontOrRearMic(); | 220 audio_handler->SwitchToFrontOrRearMic(); |
221 } else { | 221 } else { |
222 audio_handler->SwitchToDevice(device, true, | 222 audio_handler->SwitchToDevice(device, true, |
223 CrasAudioHandler::ACTIVATE_BY_USER); | 223 CrasAudioHandler::ACTIVATE_BY_USER); |
224 } | 224 } |
225 } | 225 } |
226 | 226 |
227 } // namespace tray | 227 } // namespace tray |
228 } // namespace ash | 228 } // namespace ash |
OLD | NEW |