DescriptionRemove pointer from PermissionPromptAndroid to InfoBar
This patch removes the pointer from PermissionPromptAndroid to InfoBar,
as preparation for supporting modal permission dialogs on android via
the PermissionRequestManager.
Currently, the pointer is only used for Hide() and IsVisible(). We can
use the PermissionRequest vector to see if a prompt is being shown, and
the calls to Hide() can no-op as they are already handled by the
InfoBarManager (e.g. page navigation, or after the user resolves the
prompt). If the PermissionServiceImpl receives a mojo connection error,
the PermissionRequestManager just dummies out its callback for active
prompts (on Android) as we return false in CanAcceptRequestUpdate().
We override EqualsDelegate() as the PermissionRequestManager will try to
Show() a queued bubble when it's called back after the user resolves a
prompt, but the callback happens before the active prompt is closed. The
parent's EqualsDelegate() would consider the new delegate the same as
the current one, and so it wouldn't show a new infobar.
This means we no longer have the following cycle of pointers:
PermissionPromptAndroid ->
GroupedPermissionInfoBar ->
GroupedPermissionInfoBarDelegate ->
PermissionPromptAndroid
When we later add modal permission dialogs, the PermissionPromptAndroid
will just need to check when it creates the actual UI what object to
make, but it won't need extra logic in Hide() or IsVisble().
BUG=606138
Review-Url: https://codereview.chromium.org/2755593002
Cr-Commit-Position: refs/heads/master@{#463551}
Committed: https://chromium.googlesource.com/chromium/src/+/897fa146046239d6384aab548a93045f12bd5711
Patch Set 1 #Patch Set 2 : rebase over 2757483002 #
Total comments: 2
Patch Set 3 : rm PermissionPromptDestroyed() #Patch Set 4 : rm nl #
Total comments: 5
Patch Set 5 : rm unused includes #
Total comments: 2
Patch Set 6 : hidesautomatically #Patch Set 7 : rebase and stuff #Patch Set 8 : upd comment #Patch Set 9 : update comment more #
Total comments: 6
Patch Set 10 : fix comment #Messages
Total messages: 63 (44 generated)
|