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

Unified Diff: chrome/browser/permissions/permission_request_manager.h

Issue 2770423002: Do not show permission bubble when browser is not active (Closed)
Patch Set: Created 3 years, 9 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/permissions/permission_request_manager.h
diff --git a/chrome/browser/permissions/permission_request_manager.h b/chrome/browser/permissions/permission_request_manager.h
index b2df0b9d08a0a07172227246d1df40568b7ba35b..17862776ac1c37925a203894faf1dd74550c9ae2 100644
--- a/chrome/browser/permissions/permission_request_manager.h
+++ b/chrome/browser/permissions/permission_request_manager.h
@@ -102,6 +102,10 @@ class PermissionRequestManager
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ // Called when |web_contents()| is active, and its browser's visibility
+ // changed.
+ void OnBrowserVisibilityChanged(bool visible);
+
// Do NOT use this methods in production code. Use this methods in browser
// tests that need to accept or deny permissions when requested in
// JavaScript. Your test needs to set this appropriately, and then the bubble
@@ -186,6 +190,9 @@ class PermissionRequestManager
// The UI surface to be used to display the permissions requests.
std::unique_ptr<PermissionPrompt> view_;
+ // Whether the browser that hosts |web_contents()| is visible.
+ bool browser_visible_;
+
std::vector<PermissionRequest*> requests_;
std::vector<PermissionRequest*> queued_requests_;
std::vector<PermissionRequest*> queued_frame_requests_;
« no previous file with comments | « no previous file | chrome/browser/permissions/permission_request_manager.cc » ('j') | chrome/browser/ui/views/frame/browser_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698