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

Issue 2446063002: Implement a modal permission dialog on Android gated by a feature. (Closed)

Created:
4 years, 1 month ago by dominickn
Modified:
4 years, 1 month ago
Reviewers:
lshang, raymes, gone
CC:
chromium-reviews, mlamouri+watch-permissions_chromium.org, dfalcantara+watch_chromium.org, agrieve+watch_chromium.org, chrome-apps-syd-reviews_chromium.org, lshang
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement a modal permission dialog on Android gated by a feature. This CL implements a modal prompt for geolocation, notifications, protected media, and MIDI permission requests on Android. This prompt is disabled by default behind the ModalPermissionPrompts feature. It can be triggered when the feature is enabled and a permission request is made with a user gesture. Optionally, a variations parameter can disable the user gesture requirement. The new prompt style attracts more attention than an infobar as it sits in the middle of the screen and dims the content behind it. It is intended to experiment with this to a small percentage of users to see if it improves the permission decision rate without detracting from the user experience. In particular, it is hoped that the more prominent prompt will lead to more permission decisions being made, which will reduce the overall number of prompts triggered. Permissions may be asynchronously requested. Previously, this was handled on Android by stacking requests for different permissions in different infobars behind one another. However, dialogs can only be shown once at a time, which the C++ PermissionQueueController has no way of doing. Instead, a lightweight Java-side PermissionDialogController is introduced which queues up multiple requests and displays them one at a time. For simplicity, the modal dialog delegate class simply wraps the existing PermissionInfoBarDelegate class when the ModalPermissionPrompts feature is active. Upcoming refactoring will eliminate all PermissionInfoBarDelegate subclasses, and consolidate the information in those classes into a new PermissionPromptAndroid class which will be wrapped by GroupedPermissionInfoBarDelegate. At that time, the PermissionDialogDelegate will be changed to wrap PermissionPromptAndroid as well. The Geolocation Android test is revamped to test that infobars, dialogs, and gestures interact and trigger appropriately. BUG=658125 Committed: https://crrev.com/ee761a16f9819c6b610eb3f15b095cb607394d2c Cr-Commit-Position: refs/heads/master@{#428943}

Patch Set 1 #

Patch Set 2 : Add tests. Clean up #

Patch Set 3 : Rebase #

Total comments: 4

Patch Set 4 : Allow user gesture requirement to be overridden by variations #

Total comments: 26

Patch Set 5 : Address comments. #

Patch Set 6 : Rebase #

Total comments: 23

Patch Set 7 : Comments #

Patch Set 8 : More comments #

Patch Set 9 : Move delegate creation and dispatch into constructor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1054 lines, -161 lines) Patch
A chrome/android/java/res/layout/permission_dialog.xml View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/infobar/PermissionInfoBar.java View 1 chunk +1 line, -1 line 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java View 1 2 3 4 5 6 1 chunk +187 lines, -0 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogDelegate.java View 1 2 3 4 5 6 1 chunk +145 lines, -0 lines 0 comments Download
M chrome/android/java/strings/android_chrome_strings.grd View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java_sources.gni View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/GeolocationTest.java View 1 2 3 4 9 chunks +284 lines, -87 lines 0 comments Download
M chrome/browser/BUILD.gn View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 2 chunks +3 lines, -0 lines 0 comments Download
A chrome/browser/permissions/permission_dialog_delegate.h View 1 2 3 4 5 6 7 8 1 chunk +81 lines, -0 lines 0 comments Download
A chrome/browser/permissions/permission_dialog_delegate.cc View 1 2 3 4 5 6 7 8 1 chunk +149 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_infobar_delegate.h View 1 2 3 4 5 6 7 3 chunks +22 lines, -10 lines 0 comments Download
M chrome/browser/permissions/permission_infobar_delegate.cc View 1 2 3 4 5 6 7 4 chunks +66 lines, -48 lines 0 comments Download
M chrome/browser/permissions/permission_queue_controller.cc View 1 2 3 4 5 6 7 10 chunks +46 lines, -14 lines 0 comments Download
M chrome/common/chrome_features.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_features.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M content/test/data/android/geolocation.html View 1 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 53 (34 generated)
dominickn
Hey Dan, Raymes, can you take an initial look? I'm working on a test but ...
4 years, 1 month ago (2016-10-25 06:36:04 UTC) #2
dominickn
On 2016/10/25 06:36:04, dominickn wrote: > Hey Dan, Raymes, can you take an initial look? ...
4 years, 1 month ago (2016-10-26 10:33:58 UTC) #5
gone
https://codereview.chromium.org/2446063002/diff/40001/chrome/android/java/res/layout/permission_dialog.xml File chrome/android/java/res/layout/permission_dialog.xml (right): https://codereview.chromium.org/2446063002/diff/40001/chrome/android/java/res/layout/permission_dialog.xml#newcode20 chrome/android/java/res/layout/permission_dialog.xml:20: android:layout_marginTop="10dp" /> nit: move this margin up next to ...
4 years, 1 month ago (2016-10-27 20:33:35 UTC) #14
dominickn
Thanks! I've now aligned the remember text toggle with the main message text in the ...
4 years, 1 month ago (2016-10-27 23:37:13 UTC) #17
gone
lgtm, but I'm really looking forward to that logic being pulled out. https://codereview.chromium.org/2446063002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java File chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java ...
4 years, 1 month ago (2016-10-27 23:52:20 UTC) #19
raymes
Hey Dom, I took a high-level look. A few thoughts 1) Just to confirm, Java ...
4 years, 1 month ago (2016-10-31 02:01:45 UTC) #26
dominickn
On 2016/10/31 02:01:45, raymes wrote: > Hey Dom, I took a high-level look. A few ...
4 years, 1 month ago (2016-10-31 02:14:42 UTC) #27
dominickn
+lshang - raymes wants you to take a look thanks.
4 years, 1 month ago (2016-10-31 02:18:44 UTC) #29
raymes
> The Java side and C++ side are linked together. It doesn't really make sense ...
4 years, 1 month ago (2016-10-31 02:32:44 UTC) #30
raymes
https://codereview.chromium.org/2446063002/diff/120001/chrome/browser/permissions/permission_dialog_delegate.cc File chrome/browser/permissions/permission_dialog_delegate.cc (right): https://codereview.chromium.org/2446063002/diff/120001/chrome/browser/permissions/permission_dialog_delegate.cc#newcode66 chrome/browser/permissions/permission_dialog_delegate.cc:66: break; Could we factor this switch statement out as ...
4 years, 1 month ago (2016-11-01 02:56:46 UTC) #31
dominickn
Thanks! :) https://codereview.chromium.org/2446063002/diff/120001/chrome/browser/permissions/permission_dialog_delegate.cc File chrome/browser/permissions/permission_dialog_delegate.cc (right): https://codereview.chromium.org/2446063002/diff/120001/chrome/browser/permissions/permission_dialog_delegate.cc#newcode66 chrome/browser/permissions/permission_dialog_delegate.cc:66: break; On 2016/11/01 02:56:46, raymes wrote: > ...
4 years, 1 month ago (2016-11-01 03:30:59 UTC) #33
lshang
And I have another question, if there is a modal prompt shown in tab_1, and ...
4 years, 1 month ago (2016-11-01 03:47:44 UTC) #35
raymes
https://codereview.chromium.org/2446063002/diff/120001/chrome/browser/permissions/permission_dialog_delegate.cc File chrome/browser/permissions/permission_dialog_delegate.cc (right): https://codereview.chromium.org/2446063002/diff/120001/chrome/browser/permissions/permission_dialog_delegate.cc#newcode66 chrome/browser/permissions/permission_dialog_delegate.cc:66: break; On 2016/11/01 03:30:58, dominickn wrote: > On 2016/11/01 ...
4 years, 1 month ago (2016-11-01 03:50:46 UTC) #36
dominickn
Thanks! https://codereview.chromium.org/2446063002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java File chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java (right): https://codereview.chromium.org/2446063002/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java#newcode73 chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java:73: mDialog = null; On 2016/11/01 03:47:44, lshang wrote: ...
4 years, 1 month ago (2016-11-01 04:44:00 UTC) #41
raymes
lgtm - I'm looking forward to being able to delete the queue controller though!
4 years, 1 month ago (2016-11-01 05:55:29 UTC) #46
lshang
lgtm!
4 years, 1 month ago (2016-11-01 06:02:59 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2446063002/180001
4 years, 1 month ago (2016-11-01 06:05:33 UTC) #50
commit-bot: I haz the power
Committed patchset #9 (id:180001)
4 years, 1 month ago (2016-11-01 06:10:41 UTC) #51
commit-bot: I haz the power
4 years, 1 month ago (2016-11-01 06:12:55 UTC) #53
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/ee761a16f9819c6b610eb3f15b095cb607394d2c
Cr-Commit-Position: refs/heads/master@{#428943}

Powered by Google App Engine
This is Rietveld 408576698