OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ |
6 #define CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/public/renderer/render_frame_observer.h" | 9 #include "content/public/renderer/render_frame_observer.h" |
10 #include "third_party/WebKit/public/web/WebGeolocationClient.h" | 10 #include "third_party/WebKit/public/web/WebGeolocationClient.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 public blink::WebGeolocationClient { | 27 public blink::WebGeolocationClient { |
28 public: | 28 public: |
29 explicit GeolocationDispatcher(RenderFrame* render_frame); | 29 explicit GeolocationDispatcher(RenderFrame* render_frame); |
30 virtual ~GeolocationDispatcher(); | 30 virtual ~GeolocationDispatcher(); |
31 | 31 |
32 private: | 32 private: |
33 // RenderFrame::Observer implementation. | 33 // RenderFrame::Observer implementation. |
34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 34 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
35 | 35 |
36 // WebGeolocationClient | 36 // WebGeolocationClient |
37 virtual void geolocationDestroyed(); | |
38 virtual void startUpdating(); | 37 virtual void startUpdating(); |
39 virtual void stopUpdating(); | 38 virtual void stopUpdating(); |
40 virtual void setEnableHighAccuracy(bool enable_high_accuracy); | 39 virtual void setEnableHighAccuracy(bool enable_high_accuracy); |
41 virtual void setController(blink::WebGeolocationController* controller); | 40 virtual void setController(blink::WebGeolocationController* controller); |
42 virtual bool lastPosition(blink::WebGeolocationPosition& position); | 41 virtual bool lastPosition(blink::WebGeolocationPosition& position); |
43 virtual void requestPermission( | 42 virtual void requestPermission( |
44 const blink::WebGeolocationPermissionRequest& permissionRequest); | 43 const blink::WebGeolocationPermissionRequest& permissionRequest); |
45 virtual void cancelPermissionRequest( | 44 virtual void cancelPermissionRequest( |
46 const blink::WebGeolocationPermissionRequest& permissionRequest); | 45 const blink::WebGeolocationPermissionRequest& permissionRequest); |
47 | 46 |
48 // Permission for using geolocation has been set. | 47 // Permission for using geolocation has been set. |
49 void OnPermissionSet(int bridge_id, bool is_allowed); | 48 void OnPermissionSet(int bridge_id, bool is_allowed); |
50 | 49 |
51 // We have an updated geolocation position or error code. | 50 // We have an updated geolocation position or error code. |
52 void OnPositionUpdated(const content::Geoposition& geoposition); | 51 void OnPositionUpdated(const content::Geoposition& geoposition); |
53 | 52 |
54 // The controller_ is valid for the lifetime of the underlying | |
55 // WebCore::GeolocationController. geolocationDestroyed() is | |
56 // invoked when the underlying object is destroyed. | |
57 scoped_ptr<blink::WebGeolocationController> controller_; | 53 scoped_ptr<blink::WebGeolocationController> controller_; |
58 | 54 |
59 scoped_ptr<blink::WebGeolocationPermissionRequestManager> | 55 scoped_ptr<blink::WebGeolocationPermissionRequestManager> |
60 pending_permissions_; | 56 pending_permissions_; |
61 bool enable_high_accuracy_; | 57 bool enable_high_accuracy_; |
62 bool updating_; | 58 bool updating_; |
63 }; | 59 }; |
64 | 60 |
65 } // namespace content | 61 } // namespace content |
66 | 62 |
67 #endif // CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ | 63 #endif // CONTENT_RENDERER_GEOLOCATION_DISPATCHER_H_ |
OLD | NEW |