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

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

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
diff --git a/chrome/browser/chromeos/audio/audio_handler.cc b/chrome/browser/chromeos/audio/audio_handler.cc
index d3997f9d8f33923c0af1176fa065bf66cfcb91ed..4098c34347ca351db57c88217b6347cc046e2eaf 100644
--- a/chrome/browser/chromeos/audio/audio_handler.cc
+++ b/chrome/browser/chromeos/audio/audio_handler.cc
@@ -19,7 +19,6 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/notification_service.h"
using std::max;
using std::min;
@@ -161,18 +160,11 @@ void AudioHandler::RemoveVolumeObserver(VolumeObserver* observer) {
volume_observers_.RemoveObserver(observer);
}
-void AudioHandler::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kAudioOutputAllowed ||
- *pref_name == prefs::kAudioCaptureAllowed) {
- ApplyAudioPolicy();
- }
- } else {
- NOTREACHED() << "Unexpected notification type : " << type;
- }
+void AudioHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK(pref_name == prefs::kAudioOutputAllowed ||
+ pref_name == prefs::kAudioCaptureAllowed);
Mattias Nissler (ping if slow) 2012/10/30 13:37:07 This should probably be if(..) ApplyAudioPolicy
+ ApplyAudioPolicy();
}
AudioHandler::AudioHandler(AudioMixer* mixer)

Powered by Google App Engine
This is Rietveld 408576698