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

Unified Diff: content/renderer/geolocation_dispatcher.h

Issue 722153003: Implement basic mojo Permission service and use it for Geolocation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename HasPermission() to QueryPermission() Created 6 years, 1 month 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/renderer/geolocation_dispatcher.h
diff --git a/content/renderer/geolocation_dispatcher.h b/content/renderer/geolocation_dispatcher.h
index 454859d05258b6cc82d859923b6eb9f8f71a9cc4..a003a69de51c02f061f1483d3e0ba0fe1fa308d0 100644
--- a/content/renderer/geolocation_dispatcher.h
+++ b/content/renderer/geolocation_dispatcher.h
@@ -6,7 +6,9 @@
#define CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "content/common/geolocation_service.mojom.h"
+#include "content/common/permission_service.mojom.h"
#include "content/public/renderer/render_frame_observer.h"
#include "third_party/WebKit/public/web/WebGeolocationClient.h"
#include "third_party/WebKit/public/web/WebGeolocationController.h"
@@ -33,9 +35,6 @@ class GeolocationDispatcher
virtual ~GeolocationDispatcher();
private:
- // RenderFrame::Observer implementation.
- bool OnMessageReceived(const IPC::Message& message) override;
-
// WebGeolocationClient
virtual void startUpdating();
virtual void stopUpdating();
@@ -51,7 +50,7 @@ class GeolocationDispatcher
void OnLocationUpdate(MojoGeopositionPtr geoposition) override;
// Permission for using geolocation has been set.
- void OnPermissionSet(int bridge_id, bool is_allowed);
+ void OnPermissionSet(int permission_request_id, PermissionStatus status);
scoped_ptr<blink::WebGeolocationController> controller_;
@@ -59,6 +58,9 @@ class GeolocationDispatcher
pending_permissions_;
GeolocationServicePtr geolocation_service_;
bool enable_high_accuracy_;
+ PermissionServicePtr permission_service_;
+
+ base::WeakPtrFactory<GeolocationDispatcher> weak_ptr_factory_;
};
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698