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

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

Issue 10421010: Revert 138278 - Fix the volume controlling behaviors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/audio/audio_handler.cc
===================================================================
--- chrome/browser/chromeos/audio/audio_handler.cc (revision 138298)
+++ chrome/browser/chromeos/audio/audio_handler.cc (working copy)
@@ -40,11 +40,7 @@
// static
void AudioHandler::Initialize() {
CHECK(!g_audio_handler);
-#if defined(USE_CRAS)
- g_audio_handler = new AudioHandler(new AudioMixerCras());
-#else
- g_audio_handler = new AudioHandler(new AudioMixerAlsa());
-#endif
+ g_audio_handler = new AudioHandler();
}
// static
@@ -57,12 +53,6 @@
}
// static
-void AudioHandler::InitializeForTesting(AudioMixer* mixer) {
- CHECK(!g_audio_handler);
- g_audio_handler = new AudioHandler(mixer);
-}
-
-// static
AudioHandler* AudioHandler::GetInstance() {
VLOG_IF(1, !g_audio_handler)
<< "AudioHandler::GetInstance() called with NULL global instance.";
@@ -125,8 +115,12 @@
volume_observers_.RemoveObserver(observer);
}
-AudioHandler::AudioHandler(AudioMixer* mixer)
- : mixer_(mixer),
+AudioHandler::AudioHandler()
+#if defined(USE_CRAS)
+ : mixer_(new AudioMixerCras()),
+#else
+ : mixer_(new AudioMixerAlsa()),
+#endif
prefs_(g_browser_process->local_state()) {
mixer_->SetVolumePercent(prefs_->GetDouble(prefs::kAudioVolumePercent));
mixer_->SetMuted(prefs_->GetInteger(prefs::kAudioMute) == kPrefMuteOn);
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.h ('k') | chrome/browser/ui/views/ash/volume_controller_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698