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

Unified Diff: chrome/browser/chromeos/audio/audio_handler.cc

Issue 11358083: Decouple c/b/cros/audio from c/b/speech. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.h ('k') | chrome/browser/chromeos/audio/audio_mixer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/audio/audio_handler.cc
diff --git a/chrome/browser/chromeos/audio/audio_handler.cc b/chrome/browser/chromeos/audio/audio_handler.cc
index f9d999944d0bb3813ccdc69bc4d1bc09da2f0848..e40b14a373806145859d261b00ed119d0360c815 100644
--- a/chrome/browser/chromeos/audio/audio_handler.cc
+++ b/chrome/browser/chromeos/audio/audio_handler.cc
@@ -47,12 +47,12 @@ static AudioHandler* g_audio_handler = NULL;
} // namespace
// static
-void AudioHandler::Initialize() {
+void AudioHandler::Initialize(const base::Closure& on_connected) {
CHECK(!g_audio_handler);
#if defined(USE_CRAS)
- g_audio_handler = new AudioHandler(new AudioMixerCras());
+ g_audio_handler = new AudioHandler(new AudioMixerCras(), on_connected);
#else
- g_audio_handler = new AudioHandler(new AudioMixerAlsa());
+ g_audio_handler = new AudioHandler(new AudioMixerAlsa(), on_connected);
#endif
}
@@ -68,7 +68,7 @@ void AudioHandler::Shutdown() {
// static
void AudioHandler::InitializeForTesting(AudioMixer* mixer) {
CHECK(!g_audio_handler);
- g_audio_handler = new AudioHandler(mixer);
+ g_audio_handler = new AudioHandler(mixer, base::Closure());
}
// static
@@ -175,11 +175,11 @@ void AudioHandler::Observe(int type,
}
}
-AudioHandler::AudioHandler(AudioMixer* mixer)
+AudioHandler::AudioHandler(AudioMixer* mixer, const base::Closure& on_connected)
: mixer_(mixer),
local_state_(g_browser_process->local_state()) {
InitializePrefObservers();
- mixer_->Init();
+ mixer_->Init(on_connected);
ApplyAudioPolicy();
SetMuted(local_state_->GetInteger(prefs::kAudioMute) == kPrefMuteOn);
SetVolumePercentInternal(local_state_->GetDouble(prefs::kAudioVolumePercent));
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.h ('k') | chrome/browser/chromeos/audio/audio_mixer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698