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

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

Issue 929253004: Do not always store media device rejection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed spelling. Created 5 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
« no previous file with comments | « chrome/browser/media/media_stream_devices_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dc0d0e8bbe436cf42364330c36b6636e2e8513b0..35cfaa9dd307606846b40a4a64f0dbe3f85ae5c5 100644
--- a/chrome/browser/media/media_stream_devices_controller.cc
+++ b/chrome/browser/media/media_stream_devices_controller.cc
@@ -385,7 +385,7 @@ void MediaStreamDevicesController::Accept(bool update_content_setting) {
if (update_content_setting) {
if ((IsSchemeSecure() && !devices.empty()) ||
request_.request_type == content::MEDIA_OPEN_DEVICE) {
- SetPermission(true);
+ StorePermission(true);
}
}
@@ -423,9 +423,11 @@ void MediaStreamDevicesController::Deny(
DLOG(WARNING) << "MediaStreamDevicesController::Deny: " << result;
NotifyUIRequestDenied();
- if (update_content_setting) {
+ if (update_content_setting && request_.all_ancestors_have_same_origin) {
+ // Store sticky permissions if |update_content_setting| and the request
+ // is not done from an iframe where the ancestor has a different origin.
CHECK_EQ(content::MEDIA_DEVICE_PERMISSION_DENIED, result);
- SetPermission(false);
+ StorePermission(false);
}
content::MediaResponseCallback cb = callback_;
@@ -604,7 +606,7 @@ bool MediaStreamDevicesController::IsSchemeSecure() const {
request_.security_origin.SchemeIs(extensions::kExtensionScheme);
}
-void MediaStreamDevicesController::SetPermission(bool allowed) const {
+void MediaStreamDevicesController::StorePermission(bool allowed) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
ContentSettingsPattern primary_pattern =
ContentSettingsPattern::FromURLNoWildcard(request_.security_origin);
« no previous file with comments | « chrome/browser/media/media_stream_devices_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698