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

Unified Diff: chrome/browser/geolocation/geolocation_infobar_queue_controller.h

Issue 11269002: Introduce GeolocationPermissionRequestID, a wrapper struct to contain the (render process ID, rende… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/geolocation/geolocation_infobar_queue_controller.h
===================================================================
--- chrome/browser/geolocation/geolocation_infobar_queue_controller.h (revision 163741)
+++ chrome/browser/geolocation/geolocation_infobar_queue_controller.h (working copy)
@@ -13,6 +13,9 @@
class GeolocationConfirmInfoBarDelegate;
class InfoBarTabHelper;
class Profile;
+namespace content {
+struct GeolocationPermissionRequestID;
+}
// This class controls the geolocation infobar queue per profile, and it's
// used by GeolocationPermissionContext.
@@ -31,24 +34,18 @@
// The InfoBar will be displayed immediately if the tab is not already
// displaying one, otherwise it'll be queued.
- void CreateInfoBarRequest(int render_process_id,
- int render_view_id,
- int bridge_id,
+ void CreateInfoBarRequest(const content::GeolocationPermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
PermissionDecidedCallback callback);
// Cancels a specific infobar request.
- void CancelInfoBarRequest(int render_process_id,
- int render_view_id,
- int bridge_id);
+ void CancelInfoBarRequest(const content::GeolocationPermissionRequestID& id);
// Called by the InfoBarDelegate to notify permission has been set.
// It'll notify and dismiss any other pending InfoBar request for the same
// |requesting_frame| and embedder.
- void OnPermissionSet(int render_process_id,
- int render_view_id,
- int bridge_id,
+ void OnPermissionSet(const content::GeolocationPermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
bool update_content_setting,
@@ -66,9 +63,7 @@
virtual GeolocationConfirmInfoBarDelegate* CreateInfoBarDelegate(
InfoBarTabHelper* infobar_helper,
GeolocationInfoBarQueueController* controller,
- int render_process_id,
- int render_view_id,
- int bridge_id,
+ const content::GeolocationPermissionRequestID& id,
const GURL& requesting_frame_url,
const std::string& display_languages);
@@ -78,17 +73,23 @@
typedef std::vector<PendingInfoBarRequest> PendingInfoBarRequests;
- // Shows the first pending infobar for this tab, if any.
- void ShowQueuedInfoBar(int render_process_id, int render_view_id,
- InfoBarTabHelper* helper);
+ // Returns true if a geolocation infobar is already visible for the tab
+ // corresponding to |id|.
+ bool AlreadyShowingInfoBarForTab(
John Knottenbelt 2012/10/24 10:59:10 Can you make this method const?
Peter Kasting 2012/10/24 19:50:48 Yes. Will fix.
+ const content::GeolocationPermissionRequestID& id);
- // Removes any pending requests for a given tab.
- void ClearPendingInfoBarRequestsForTab(int render_process_id,
- int render_view_id);
+ // Shows the next pending infobar for the tab corresponding to |id|, if any.
+ // Note that this may not be the pending request whose ID is |id| if other
+ // requests are higher in the queue. Returns whether an infobar was shown.
+ bool ShowQueuedInfoBarForTab(
+ const content::GeolocationPermissionRequestID& id);
- InfoBarTabHelper* GetInfoBarHelper(int render_process_id, int render_view_id);
- bool AlreadyShowingInfoBar(int render_process_id, int render_view_id);
+ void ClearPendingInfoBarRequestsForTab(
+ const content::GeolocationPermissionRequestID& id);
+ InfoBarTabHelper* GetInfoBarHelper(
+ const content::GeolocationPermissionRequestID& id);
+
void RegisterForInfoBarNotifications(InfoBarTabHelper* helper);
void UnregisterForInfoBarNotifications(InfoBarTabHelper* helper);

Powered by Google App Engine
This is Rietveld 408576698