| 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/hover_highlight_view.h" | 8 #include "ash/common/system/tray/hover_highlight_view.h" |
| 9 #include "ash/common/system/tray/tray_constants.h" | 9 #include "ash/common/system/tray/tray_constants.h" |
| 10 #include "ash/common/system/tray/tray_popup_utils.h" | 10 #include "ash/common/system/tray/tray_popup_utils.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 HoverHighlightView* AudioDetailedView::AddScrollListItem( | 134 HoverHighlightView* AudioDetailedView::AddScrollListItem( |
| 135 const base::string16& text, | 135 const base::string16& text, |
| 136 bool highlight, | 136 bool highlight, |
| 137 bool checked) { | 137 bool checked) { |
| 138 HoverHighlightView* container = new HoverHighlightView(this); | 138 HoverHighlightView* container = new HoverHighlightView(this); |
| 139 | 139 |
| 140 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 140 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 141 container->AddLabelRowMd(text); | 141 container->AddLabelRow(text); |
| 142 if (checked) { | 142 if (checked) { |
| 143 gfx::ImageSkia check_mark = gfx::CreateVectorIcon( | 143 gfx::ImageSkia check_mark = gfx::CreateVectorIcon( |
| 144 gfx::VectorIconId::CHECK_CIRCLE, gfx::kGoogleGreen700); | 144 gfx::VectorIconId::CHECK_CIRCLE, gfx::kGoogleGreen700); |
| 145 container->AddRightIcon(check_mark, check_mark.width()); | 145 container->AddRightIcon(check_mark, check_mark.width()); |
| 146 container->SetRightViewVisible(true); | 146 container->SetRightViewVisible(true); |
| 147 container->SetAccessiblityState( | 147 container->SetAccessiblityState( |
| 148 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); | 148 HoverHighlightView::AccessibilityState::CHECKED_CHECKBOX); |
| 149 } else { | 149 } else { |
| 150 container->SetAccessiblityState( | 150 container->SetAccessiblityState( |
| 151 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); | 151 HoverHighlightView::AccessibilityState::UNCHECKED_CHECKBOX); |
| 152 } | 152 } |
| 153 } else { | |
| 154 container->AddCheckableLabel(text, highlight, checked); | |
| 155 } | 153 } |
| 156 | 154 |
| 157 scroll_content()->AddChildView(container); | 155 scroll_content()->AddChildView(container); |
| 158 return container; | 156 return container; |
| 159 } | 157 } |
| 160 | 158 |
| 161 void AudioDetailedView::CreateItems() { | 159 void AudioDetailedView::CreateItems() { |
| 162 CreateScrollableList(); | 160 CreateScrollableList(); |
| 163 CreateTitleRow(IDS_ASH_STATUS_TRAY_AUDIO); | 161 CreateTitleRow(IDS_ASH_STATUS_TRAY_AUDIO); |
| 164 } | 162 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 AudioDeviceMap::iterator iter = device_map_.find(view); | 222 AudioDeviceMap::iterator iter = device_map_.find(view); |
| 225 if (iter == device_map_.end()) | 223 if (iter == device_map_.end()) |
| 226 return; | 224 return; |
| 227 chromeos::AudioDevice device = iter->second; | 225 chromeos::AudioDevice device = iter->second; |
| 228 CrasAudioHandler::Get()->SwitchToDevice(device, true, | 226 CrasAudioHandler::Get()->SwitchToDevice(device, true, |
| 229 CrasAudioHandler::ACTIVATE_BY_USER); | 227 CrasAudioHandler::ACTIVATE_BY_USER); |
| 230 } | 228 } |
| 231 | 229 |
| 232 } // namespace tray | 230 } // namespace tray |
| 233 } // namespace ash | 231 } // namespace ash |
| OLD | NEW |