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

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)
@@ -11,6 +11,7 @@
class GURL;
class GeolocationConfirmInfoBarDelegate;
+class GeolocationPermissionRequestID;
class InfoBarTabHelper;
class Profile;
@@ -31,24 +32,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 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 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 GeolocationPermissionRequestID& id,
const GURL& requesting_frame,
const GURL& embedder,
bool update_content_setting,
@@ -59,35 +54,26 @@
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- protected:
- // Create an Infobar delegate to ask the whether the requesting frame
- // url should be granted geolocation permission. Overrided in
- // derived classes to implement alternative UI.
- virtual GeolocationConfirmInfoBarDelegate* CreateInfoBarDelegate(
- InfoBarTabHelper* infobar_helper,
- GeolocationInfoBarQueueController* controller,
- int render_process_id,
- int render_view_id,
- int bridge_id,
- const GURL& requesting_frame_url,
- const std::string& display_languages);
-
private:
- struct PendingInfoBarRequest;
+ class PendingInfoBarRequest;
class RequestEquals;
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(
+ const GeolocationPermissionRequestID& id) const;
- // 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. If we can't show infobars because there
+ // is no InfoBarTabHelper for this tab, removes all queued requests for this
+ // tab.
+ void ShowQueuedInfoBarForTab(const 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 GeolocationPermissionRequestID& id);
void RegisterForInfoBarNotifications(InfoBarTabHelper* helper);
void UnregisterForInfoBarNotifications(InfoBarTabHelper* helper);

Powered by Google App Engine
This is Rietveld 408576698