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

Unified Diff: chrome/browser/media/media_stream_devices_controller.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add to PrefRegistrySyncable and PrefServiceSyncable to let sync know of pre-registered prefs. Created 7 years, 10 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/media/media_stream_devices_controller.cc
diff --git a/chrome/browser/media/media_stream_devices_controller.cc b/chrome/browser/media/media_stream_devices_controller.cc
index 22823c562ae3b3c48e52d97dbd1cccf9fa91922b..0ebe3e2a803d2b9e70c5664f695d1a2f6eb4e92b 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -11,6 +11,8 @@
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
+#include "chrome/browser/prefs/pref_registry_syncable.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -58,13 +60,13 @@ MediaStreamDevicesController::~MediaStreamDevicesController() {}
// static
void MediaStreamDevicesController::RegisterUserPrefs(
- PrefServiceSyncable* prefs) {
+ PrefRegistrySyncable* prefs) {
prefs->RegisterBooleanPref(prefs::kVideoCaptureAllowed,
true,
- PrefServiceSyncable::UNSYNCABLE_PREF);
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
prefs->RegisterBooleanPref(prefs::kAudioCaptureAllowed,
true,
- PrefServiceSyncable::UNSYNCABLE_PREF);
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
}
@@ -176,11 +178,11 @@ MediaStreamDevicesController::DevicePolicy
MediaStreamDevicesController::GetDevicePolicy(const char* policy_name) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- PrefServiceSyncable* pref = profile_->GetPrefs();
- if (!pref->IsManagedPreference(policy_name))
+ PrefService* prefs = profile_->GetPrefs();
+ if (!prefs->IsManagedPreference(policy_name))
return POLICY_NOT_SET;
- return pref->GetBoolean(policy_name) ? ALWAYS_ALLOW : ALWAYS_DENY;
+ return prefs->GetBoolean(policy_name) ? ALWAYS_ALLOW : ALWAYS_DENY;
}
bool MediaStreamDevicesController::IsRequestAllowedByDefault() const {

Powered by Google App Engine
This is Rietveld 408576698