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

Side by Side Diff: extensions/shell/browser/shell_audio_controller_chromeos.cc

Issue 1746843002: Persist the user's active audio device choice across chromeos session and reboots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits. Created 4 years, 9 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 | « extensions/browser/api/audio/audio_apitest.cc ('k') | no next file » | 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 "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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/audio/audio_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698