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

Unified Diff: chrome/browser/ui/website_settings/permission_bubble_manager.h

Issue 243543003: [WebsiteSettings] Update permission bubble manager policy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: weak ptr Created 6 years, 8 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/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 494cf7b4886cfcef38509e6b3e3a25e2c6d444dd..bbf8e85fd4296287312056e52b024a085514cd39 100644
--- a/chrome/browser/ui/website_settings/permission_bubble_manager.h
+++ b/chrome/browser/ui/website_settings/permission_bubble_manager.h
@@ -7,7 +7,7 @@
#include <vector>
-#include "base/timer/timer.h"
+#include "base/memory/weak_ptr.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"
@@ -56,10 +56,6 @@ class PermissionBubbleManager
// take ownership of the view.
virtual void SetView(PermissionBubbleView* view) OVERRIDE;
- protected:
- // Sets the coalesce time interval to |interval_ms|. For testing only.
- void SetCoalesceIntervalForTesting(int interval_ms);
-
private:
friend class PermissionBubbleManagerTest;
friend class DownloadRequestLimiterTest;
@@ -67,15 +63,12 @@ class PermissionBubbleManager
explicit PermissionBubbleManager(content::WebContents* web_contents);
- // contents::WebContentsObserver:
- // TODO(leng): Investigate the ordering and timing of page loading and
- // permission requests with iFrames. DocumentOnLoadCompletedInMainFrame()
- // and DocumentLoadedInFrame() might be needed as well.
- virtual void DidFinishLoad(
- int64 frame_id,
- const GURL& validated_url,
- bool is_main_frame,
- content::RenderViewHost* render_view_host) OVERRIDE;
+ // WebContentsObserver:
+
+ // TODO(leng): Finalize policy for permission requests with iFrames.
+ // DocumentLoadedInFrame() might be needed as well.
+ virtual void DocumentOnLoadCompletedInMainFrame(int32 page_id) OVERRIDE;
+
// If a page on which permissions requests are pending is navigated,
// they will be finalized as if canceled by the user.
virtual void NavigationEntryCommitted(
@@ -90,7 +83,6 @@ class PermissionBubbleManager
virtual void Deny() OVERRIDE;
virtual void Closing() OVERRIDE;
- // Called when the coalescing timer is done. Presents the bubble.
void ShowBubble();
// Finalize the pending permissions request.
@@ -110,10 +102,11 @@ class PermissionBubbleManager
std::vector<PermissionBubbleRequest*> requests_;
std::vector<PermissionBubbleRequest*> queued_requests_;
GURL request_url_;
+ bool request_url_has_loaded_;
std::vector<bool> accept_states_;
bool customization_mode_;
- scoped_ptr<base::Timer> timer_;
+ base::WeakPtrFactory<PermissionBubbleManager> weak_factory_;
};
#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698