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

Unified Diff: content/browser/geolocation/geolocation_dispatcher_host.h

Issue 330143002: Simplify geolocation permission request in the Content API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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: content/browser/geolocation/geolocation_dispatcher_host.h
diff --git a/content/browser/geolocation/geolocation_dispatcher_host.h b/content/browser/geolocation/geolocation_dispatcher_host.h
index 151ed46c74d54296cca1ca16a0f1565dcf353719..e8bda4026d687001276f562ea5b254ef0a6e64d7 100644
--- a/content/browser/geolocation/geolocation_dispatcher_host.h
+++ b/content/browser/geolocation/geolocation_dispatcher_host.h
@@ -6,7 +6,10 @@
#define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_
#include <map>
+#include <vector>
+#include "base/callback_forward.h"
+#include "base/memory/weak_ptr.h"
#include "content/browser/geolocation/geolocation_provider_impl.h"
#include "content/public/browser/web_contents_observer.h"
@@ -14,8 +17,6 @@ class GURL;
namespace content {
-class GeolocationPermissionContext;
-
// GeolocationDispatcherHost is an observer for Geolocation messages.
// It's the complement of GeolocationDispatcher (owned by RenderView).
class GeolocationDispatcherHost : public WebContentsObserver {
@@ -56,15 +57,32 @@ class GeolocationDispatcherHost : public WebContentsObserver {
void OnLocationUpdate(const Geoposition& position);
- scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_;
+ void SendGeolocationPermissionResponse(int render_process_id,
+ int render_frame_id,
+ int bridge_id,
+ bool allowed);
// A map from the RenderFrameHosts that have requested geolocation updates to
// the type of accuracy they requested (true = high accuracy).
std::map<RenderFrameHost*, bool> updating_frames_;
bool paused_;
+ struct PendingPermission {
+ PendingPermission(int render_frame_id,
+ int render_process_id,
+ int bridge_id);
+ ~PendingPermission();
+ int render_frame_id;
+ int render_process_id;
+ int bridge_id;
+ base::Closure cancel;
+ };
+ std::vector<PendingPermission> pending_permissions_;
+
scoped_ptr<GeolocationProvider::Subscription> geolocation_subscription_;
+ base::WeakPtrFactory<GeolocationDispatcherHost> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHost);
};
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/browser/geolocation/geolocation_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698