| 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 "extensions/shell/browser/shell_audio_controller_chromeos.h" | 5 #include "extensions/shell/browser/shell_audio_controller_chromeos.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chromeos/audio/audio_device.h" | 9 #include "chromeos/audio/audio_device.h" |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (it->is_input && !best_input) | 71 if (it->is_input && !best_input) |
| 72 best_input = it->id; | 72 best_input = it->id; |
| 73 else if (!it->is_input && !best_output) | 73 else if (!it->is_input && !best_output) |
| 74 best_output = it->id; | 74 best_output = it->id; |
| 75 } | 75 } |
| 76 | 76 |
| 77 if (best_input && best_input != handler->GetPrimaryActiveInputNode()) { | 77 if (best_input && best_input != handler->GetPrimaryActiveInputNode()) { |
| 78 const chromeos::AudioDevice* device = GetDevice(devices, best_input); | 78 const chromeos::AudioDevice* device = GetDevice(devices, best_input); |
| 79 DCHECK(device); | 79 DCHECK(device); |
| 80 VLOG(1) << "Activating input device: " << device->ToString(); | 80 VLOG(1) << "Activating input device: " << device->ToString(); |
| 81 handler->SwitchToDevice(*device, true); | 81 handler->SwitchToDevice(*device, true, |
| 82 chromeos::CrasAudioHandler::ACTIVATE_BY_USER); |
| 82 } | 83 } |
| 83 if (best_output && best_output != handler->GetPrimaryActiveOutputNode()) { | 84 if (best_output && best_output != handler->GetPrimaryActiveOutputNode()) { |
| 84 const chromeos::AudioDevice* device = GetDevice(devices, best_output); | 85 const chromeos::AudioDevice* device = GetDevice(devices, best_output); |
| 85 DCHECK(device); | 86 DCHECK(device); |
| 86 VLOG(1) << "Activating output device: " << device->ToString(); | 87 VLOG(1) << "Activating output device: " << device->ToString(); |
| 87 handler->SwitchToDevice(*device, true); | 88 handler->SwitchToDevice(*device, true, |
| 89 chromeos::CrasAudioHandler::ACTIVATE_BY_USER); |
| 88 } | 90 } |
| 89 } | 91 } |
| 90 | 92 |
| 91 } // namespace extensions | 93 } // namespace extensions |
| OLD | NEW |