• Elly Fong-Jones's avatar
    permissions: allow delegate callbacks during dialog close · 20a4c842
    Elly Fong-Jones authored
    Right now, PermissionRequestManager requires that the PermissionPrompt
    not call any of the PermissionPrompt::Delegate methods if the
    PermissionPrompt is being destroyed by the PermissionRequestManager
    itself. This mainly happens when the user switches tabs, in which case
    the PRM wants to destroy the bubble but not treat the permission request
    as handled yet.
    
    This CL changes the contract of the PermissionPrompt: now the
    PermissionPrompt always calls the notification methods on
    PermissionPrompt::Delegate, and it is up to the PRM to ignore these
    callbacks if they are not relevant. This centralizes knowledge of this
    PRM behavior in a single place (PRM itself) and simplifies
    PermissionPromptBubbleView.
    
    Bug: 1011446
    Change-Id: Ie023ca572848e26f63cb9287ee216dd738f32473
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2039730Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
    Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
    Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
    Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#739394}
    20a4c842
permission_request_manager.cc 24.3 KB