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

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: Merge to head for commit 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/drive/drive_file_system.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..f78657f8ca9d490f6820a122e0a2754996ed2d15 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);
+ ApplyAudioPolicy();
}
AudioHandler::AudioHandler(AudioMixer* mixer)
« no previous file with comments | « chrome/browser/chromeos/audio/audio_handler.h ('k') | chrome/browser/chromeos/drive/drive_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698