Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: ash/common/system/chromeos/audio/audio_detailed_view.cc

Issue 2803893002: Reuse the code within UpdateCheckMark() (Closed)
Patch Set: Update comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/common/system/chromeos/palette/common_palette_tool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::InitializeAsCheckableRow(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
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
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/chromeos/palette/common_palette_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698