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 ec57e0952f3ad9151479ef7d9db05543e6ec4bcd..e5b2d9333f23d13b0f5250df5f32786eab6b777a 100644 |
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.h |
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.h |
@@ -7,6 +7,7 @@ |
#include <vector> |
+#include "base/timer/timer.h" |
#include "chrome/browser/ui/website_settings/permission_bubble_view.h" |
#include "content/public/browser/web_contents_observer.h" |
#include "content/public/browser/web_contents_user_data.h" |
@@ -36,13 +37,19 @@ class PermissionBubbleManager |
// Add a new request to the permission bubble. Ownership of the request |
// remains with the caller. The caller must arrange for the request to |
- // outlive the PermissionBubbleManager. |
+ // outlive the PermissionBubbleManager. If a bubble is visible when this |
+ // call is made, the request will be queued up and shown after the current |
+ // bubble closes. |
virtual void AddRequest(PermissionBubbleRequest* request); |
// Set the active view for the permission bubble. If this is NULL, it |
// means the permission bubble is no longer showing. |
virtual void SetView(PermissionBubbleView* view); |
+ protected: |
+ // Sets the coalesce time interval to |interval_ms|. For testing only. |
+ void SetCoalesceIntervalForTesting(int interval_ms); |
+ |
private: |
friend class PermissionBubbleManagerTest; |
friend class content::WebContentsUserData<PermissionBubbleManager>; |
@@ -60,6 +67,9 @@ class PermissionBubbleManager |
virtual void Deny() OVERRIDE; |
virtual void Closing() OVERRIDE; |
+ // Called when the coalescing timer is done. Will show the bubble. |
+ void OnTimerExpired(); |
+ |
// Finalize the pending permissions request. |
void FinalizeBubble(); |
@@ -70,8 +80,11 @@ class PermissionBubbleManager |
PermissionBubbleView* view_; |
std::vector<PermissionBubbleRequest*> requests_; |
+ std::vector<PermissionBubbleRequest*> queued_requests_; |
std::vector<bool> accept_state_; |
bool customization_mode_; |
+ |
+ scoped_ptr<base::Timer> timer_; |
}; |
#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_ |