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

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: Bracket nit Created 4 years, 6 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..2bfc3a0671589675ffa7ebc652f38a7ccaf25811 100644
--- a/chrome/browser/media/media_stream_infobar_delegate_android.cc
+++ b/chrome/browser/media/media_stream_infobar_delegate_android.cc
@@ -25,6 +25,12 @@
namespace {
+const int kGroupedInfobarAudioPosition = 0;
+const int kGroupedInfobarVideoPosition = 1;
+
+// Get a list of content types being requested. Note that the order of the
+// resulting array corresponds to the kGroupedInfobarAudio/VideoPermission
+// constants.
std::vector<ContentSettingsType> GetContentSettingsTypes(
MediaStreamDevicesController* controller) {
std::vector<ContentSettingsType> types;
@@ -94,7 +100,14 @@ MediaStreamInfoBarDelegateAndroid::AsMediaStreamInfoBarDelegateAndroid() {
}
bool MediaStreamInfoBarDelegateAndroid::Accept() {
- controller_->PermissionGranted();
+ if (GetPermissionCount() == 2) {
+ controller_->GroupedRequestFinished(
+ GetAcceptState(kGroupedInfobarAudioPosition),
+ GetAcceptState(kGroupedInfobarVideoPosition));
+ } else {
+ DCHECK_EQ(1, GetPermissionCount());
+ controller_->PermissionGranted();
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698