| 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/resources/vector_icons/vector_icons.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 scroll_content()->AddChildView(header); | 103 scroll_content()->AddChildView(header); |
| 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->AddLabelRow(text); | 112 container->AddLabelRow(text); |
| 113 if (checked) { | 113 TrayPopupUtils::UpdateCheckMarkVisibility(container, checked); |
| 114 gfx::ImageSkia check_mark = | |
| 115 gfx::CreateVectorIcon(kCheckCircleIcon, gfx::kGoogleGreen700); | |
| 116 container->AddRightIcon(check_mark, check_mark.width()); | |
| 117 container->SetRightViewVisible(true); | |
| 118 container->SetAccessiblityState( | |
| 119 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | |
| 120 } else { | |
| 121 container->SetAccessiblityState( | |
| 122 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | |
| 123 } | |
| 124 | 114 |
| 125 scroll_content()->AddChildView(container); | 115 scroll_content()->AddChildView(container); |
| 126 return container; | 116 return container; |
| 127 } | 117 } |
| 128 | 118 |
| 129 void AudioDetailedView::CreateItems() { | 119 void AudioDetailedView::CreateItems() { |
| 130 CreateScrollableList(); | 120 CreateScrollableList(); |
| 131 CreateTitleRow(IDS_ASH_STATUS_TRAY_AUDIO); | 121 CreateTitleRow(IDS_ASH_STATUS_TRAY_AUDIO); |
| 132 } | 122 } |
| 133 | 123 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 audio_handler->HasDualInternalMic()) { | 209 audio_handler->HasDualInternalMic()) { |
| 220 audio_handler->SwitchToFrontOrRearMic(); | 210 audio_handler->SwitchToFrontOrRearMic(); |
| 221 } else { | 211 } else { |
| 222 audio_handler->SwitchToDevice(device, true, | 212 audio_handler->SwitchToDevice(device, true, |
| 223 CrasAudioHandler::ACTIVATE_BY_USER); | 213 CrasAudioHandler::ACTIVATE_BY_USER); |
| 224 } | 214 } |
| 225 } | 215 } |
| 226 | 216 |
| 227 } // namespace tray | 217 } // namespace tray |
| 228 } // namespace ash | 218 } // namespace ash |
| OLD | NEW |