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

Unified Diff: chrome/browser/permissions/permission_context.cc

Issue 1311783007: refactor to Introduce AUDIO_CAPTURE and VIDEO_CAPTURE permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/permissions/permission_context.cc
diff --git a/chrome/browser/permissions/permission_context.cc b/chrome/browser/permissions/permission_context.cc
index 17b98da6e57ff52e87eff7f4083130ad1c1e1a4b..655eb5aa2ba3aa9be3039afa84a39079a2612cbe 100644
--- a/chrome/browser/permissions/permission_context.cc
+++ b/chrome/browser/permissions/permission_context.cc
@@ -6,6 +6,9 @@
#include "chrome/browser/geolocation/geolocation_permission_context.h"
#include "chrome/browser/geolocation/geolocation_permission_context_factory.h"
+#include "chrome/browser/media/media_stream_camera_permission_context_factory.h"
+#include "chrome/browser/media/media_stream_device_permission_context.h"
+#include "chrome/browser/media/media_stream_mic_permission_context_factory.h"
#include "chrome/browser/media/midi_permission_context.h"
#include "chrome/browser/media/midi_permission_context_factory.h"
#include "chrome/browser/notifications/notification_permission_context.h"
@@ -49,6 +52,10 @@ PermissionContextBase* PermissionContext::Get(Profile* profile,
// PermissionType::MIDI is a valid permission but does not have a
// permission context. It has a constant value instead.
break;
+ case PermissionType::AUDIO_RECORDING:
+ return MediaStreamMicPermissionContextFactory::GetForProfile(profile);
+ case PermissionType::VIDEO_RECORDING:
+ return MediaStreamCameraPermissionContextFactory::GetForProfile(profile);
default:
NOTREACHED() << "No PermissionContext associated with "
<< static_cast<int>(permission_type);
@@ -73,6 +80,9 @@ const std::list<KeyedServiceBaseFactory*>& PermissionContext::GetFactories() {
ProtectedMediaIdentifierPermissionContextFactory::GetInstance());
#endif
factories.push_back(DurableStoragePermissionContextFactory::GetInstance());
+ factories.push_back(MediaStreamMicPermissionContextFactory::GetInstance());
+ factories.push_back(
+ MediaStreamCameraPermissionContextFactory::GetInstance());
}
return factories;

Powered by Google App Engine
This is Rietveld 408576698