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; |
} |