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

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

Issue 2019573002: Permissions: Allow control of individual requests in media permission infobars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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_infobar_delegate_android.cc
diff --git a/chrome/browser/media/media_stream_infobar_delegate_android.cc b/chrome/browser/media/media_stream_infobar_delegate_android.cc
index 161722e7b722d00a63e85b18611b51bb12207abe..144de1d4cc9b3fd4600e806e1823092e48e98454 100644
--- a/chrome/browser/media/media_stream_infobar_delegate_android.cc
+++ b/chrome/browser/media/media_stream_infobar_delegate_android.cc
@@ -25,6 +25,8 @@
namespace {
+// Get a list of content types being requested. Note that the order of the
+// resulting array is important, see |Accept()|.
std::vector<ContentSettingsType> GetContentSettingsTypes(
MediaStreamDevicesController* controller) {
std::vector<ContentSettingsType> types;
@@ -94,7 +96,13 @@ MediaStreamInfoBarDelegateAndroid::AsMediaStreamInfoBarDelegateAndroid() {
}
bool MediaStreamInfoBarDelegateAndroid::Accept() {
- controller_->PermissionGranted();
+ if (GetPermissionCount() == 2) {
+ // Accept state 0 -> Audio, Accept state 1 -> Video.
gone 2016/05/31 21:20:42 Define these explicitly as global constants?
tsergeant 2016/06/02 07:04:36 Done.
+ controller_->PermissionSplitResult(GetAcceptState(0), GetAcceptState(1));
+ } else {
+ DCHECK_EQ(1, GetPermissionCount());
+ controller_->PermissionGranted();
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698