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

Side by Side Diff: trunk/src/chromeos/audio/cras_audio_switch_handler.cc

Issue 14655010: Revert 198556 "Implement the rest of the audio API." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/chromeos/audio/cras_audio_switch_handler.h ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/audio/cras_audio_switch_handler.h" 5 #include "chromeos/audio/cras_audio_switch_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chromeos/audio/audio_pref_handler.h" 10 #include "chromeos/audio/audio_pref_handler.h"
(...skipping 23 matching lines...) Expand all
34 g_cras_audio_handler = NULL; 34 g_cras_audio_handler = NULL;
35 } 35 }
36 36
37 // static 37 // static
38 CrasAudioSwitchHandler* CrasAudioSwitchHandler::Get() { 38 CrasAudioSwitchHandler* CrasAudioSwitchHandler::Get() {
39 CHECK(g_cras_audio_handler) 39 CHECK(g_cras_audio_handler)
40 << "CrasAudioSwitchHandler::Get() called before Initialize()."; 40 << "CrasAudioSwitchHandler::Get() called before Initialize().";
41 return g_cras_audio_handler; 41 return g_cras_audio_handler;
42 } 42 }
43 43
44 void CrasAudioSwitchHandler::UpdateActiveDevice() {
45 GetNodes();
46 }
47
48 CrasAudioSwitchHandler::CrasAudioSwitchHandler() 44 CrasAudioSwitchHandler::CrasAudioSwitchHandler()
49 : muted_device_id_(0), 45 : muted_device_id_(0),
50 weak_ptr_factory_(this) { 46 weak_ptr_factory_(this) {
51 chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->AddObserver(this); 47 chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->AddObserver(this);
52 GetNodes(); 48 GetNodes();
53 } 49 }
54 50
55 CrasAudioSwitchHandler::~CrasAudioSwitchHandler() { 51 CrasAudioSwitchHandler::~CrasAudioSwitchHandler() {
56 chromeos::DBusThreadManager::Get()->GetCrasAudioClient()-> 52 chromeos::DBusThreadManager::Get()->GetCrasAudioClient()->
57 RemoveObserver(this); 53 RemoveObserver(this);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 const AudioNodeList& node_list, bool success) { 152 const AudioNodeList& node_list, bool success) {
157 if (!success) { 153 if (!success) {
158 LOG(ERROR) << "Failed to retrieve audio nodes data"; 154 LOG(ERROR) << "Failed to retrieve audio nodes data";
159 return; 155 return;
160 } 156 }
161 157
162 UpdateDevicesAndSwitch(node_list); 158 UpdateDevicesAndSwitch(node_list);
163 } 159 }
164 160
165 } // namespace chromeos 161 } // namespace chromeos
OLDNEW
« no previous file with comments | « trunk/src/chromeos/audio/cras_audio_switch_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698