• xhwang's avatar
    media: Invoke PlatformVerificationDialog from ProtectedMediaIdentifierPermissionContext. · 0d919436
    xhwang authored
    This is a follow-up CL of r314351.
    
    Currently this is invoked from PermissionContextBase. Since this is for
    protected media identifier only, it's better to put it in
    ProtectedMediaIdentifierPermissionContext.
    
    Also included in this fix:
    - Pass |requesting_origin| to PlatformVerificationDialog::ShowDialog().
      Currently we are using the origin of the GetLastCommittedURL(), which is
      wrong.
    - Add ProtectedMediaIdentifierPermissionContext::CancelPermissionRequest() so
      that we can cancel the prompt and drop the callback properly. Otherwise, this
      will cause a DCHECK in PermissionServiceImp when closing the browser while the
      prompt is shown.
    
    BUG=446263
    TEST=Manually tested various cases.
    
    Review URL: https://codereview.chromium.org/881983003
    
    Cr-Commit-Position: refs/heads/master@{#314924}
    0d919436
platform_verification_dialog.cc 5.79 KB