Index: chrome/browser/ui/website_settings/permission_bubble_manager.h |
diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager.h b/chrome/browser/ui/website_settings/permission_bubble_manager.h |
index 2e0eafc82426f6d748ba0792e3f1416b65c8f7f3..fba13c4c9bfc970f72c085152a189dcd93cc6ada 100644 |
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.h |
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.h |
@@ -65,10 +65,10 @@ class PermissionBubbleManager |
explicit PermissionBubbleManager(content::WebContents* web_contents); |
// WebContentsObserver: |
- |
- // TODO(leng): Finalize policy for permission requests with iFrames. |
- // DocumentLoadedInFrame() might be needed as well. |
virtual void DocumentOnLoadCompletedInMainFrame() OVERRIDE; |
+ virtual void DocumentLoadedInFrame( |
+ int64 frame_id, |
+ content::RenderViewHost* render_view_host) OVERRIDE; |
// If a page on which permissions requests are pending is navigated, |
// they will be finalized as if canceled by the user. |
@@ -83,7 +83,12 @@ class PermissionBubbleManager |
virtual void Deny() OVERRIDE; |
virtual void Closing() OVERRIDE; |
- void ShowBubble(); |
+ // Posts a task which will allow the bubble to become visible if it is needed. |
+ void ScheduleShowBubble(); |
+ |
+ // Shows the bubble if it is not already visible and there are pending |
+ // requests. |
+ void TriggerShowBubble(); |
// Finalize the pending permissions request. |
void FinalizeBubble(); |
@@ -93,6 +98,18 @@ class PermissionBubbleManager |
// from the requesting page. |
void CancelPendingQueue(); |
+ // Returns whether or not |request| has already been added to |queue|. |
+ // |same_object| must be non-null. It will be set to true if |request| |
+ // is the same object as an existing request in |queue|, false otherwise. |
+ bool ExistingRequest(PermissionBubbleRequest* request, |
+ const std::vector<PermissionBubbleRequest*>& queue, |
+ bool* same_object); |
+ |
+ // Returns true if |queue| contains a request which was generated by a user |
+ // gesture. Returns false otherwise. |
+ bool HasUserGestureRequest( |
+ const std::vector<PermissionBubbleRequest*>& queue); |
+ |
// Whether or not we are showing the bubble in this tab. |
bool bubble_showing_; |
@@ -101,6 +118,7 @@ class PermissionBubbleManager |
std::vector<PermissionBubbleRequest*> requests_; |
std::vector<PermissionBubbleRequest*> queued_requests_; |
+ std::vector<PermissionBubbleRequest*> queued_frame_requests_; |
// URL of the main frame in the WebContents to which this manager is attached. |
// TODO(gbillock): if there are iframes in the page, we need to deal with it. |