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

Unified Diff: chrome/browser/ui/permission_bubble/permission_prompt.h

Issue 2829023002: Fix cancelling permission requests on Android when the PermissionRequestManager is enabled (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/permission_bubble/permission_prompt.h
diff --git a/chrome/browser/ui/permission_bubble/permission_prompt.h b/chrome/browser/ui/permission_bubble/permission_prompt.h
index 3b0f8683b0f723c9c889713d62f5c5f1eccd7254..607fe9ab34ab89ad165cc5e13606b1b38001c95c 100644
--- a/chrome/browser/ui/permission_bubble/permission_prompt.h
+++ b/chrome/browser/ui/permission_bubble/permission_prompt.h
@@ -55,10 +55,13 @@ class PermissionPrompt {
// if there is no prompt showing.
virtual void Show() = 0;
- // Returns true if the view can accept a new Show() command to coalesce
- // requests. Currently the policy is that this should return true if the view
- // is being shown and the mouse is not over the view area (!IsMouseHovered).
- virtual bool CanAcceptRequestUpdate() = 0;
+ // Try to cancel (i.e. hide and don't run callbacks) the current request and
+ // return whether it was cancelled. Currently the policy is that this should
+ // fail if the view is being shown and the mouse is not over the view area
+ // (!IsMouseHovered). This invalidates request objects from the last Show()
+ // call, so if the cancel failed, Show() will be called with the cancelled
+ // requests replaced with dummy PermissionRequest objects.
+ virtual bool MaybeCancelRequest() = 0;
// Returns true if the prompt UI will manage hiding itself when the user
// resolves the prompt, on page navigation/destruction, and on tab switching.

Powered by Google App Engine
This is Rietveld 408576698