OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ | 5 #ifndef CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ |
6 #define CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ | 6 #define CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) | 9 #if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) |
10 // TODO(jknotten): Remove this class once the new client-based implementation is | 10 // TODO(jknotten): Remove this class once the new client-based implementation is |
11 // checked in (see http://crbug.com/59908). | 11 // checked in (see http://crbug.com/59908). |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/id_map.h" | 14 #include "base/id_map.h" |
15 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_channel.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationService.h" | 17 #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationService.h" |
18 | 18 |
19 class GURL; | 19 class GURL; |
20 class RenderView; | 20 class RenderView; |
21 struct Geoposition; | 21 struct Geoposition; |
22 | 22 |
23 // GeolocationDispatcherOld is a delegate for Geolocation messages used by | 23 // GeolocationDispatcherOld is a delegate for Geolocation messages used by |
24 // WebKit. | 24 // WebKit. |
25 // It's the complement of GeolocationDispatcherHostOld (owned by | 25 // It's the complement of GeolocationDispatcherHostOld (owned by |
26 // RenderViewHost). | 26 // RenderViewHost). |
27 | 27 |
28 class GeolocationDispatcherOld : public WebKit::WebGeolocationService { | 28 class GeolocationDispatcherOld : public WebKit::WebGeolocationService, |
| 29 public IPC::Channel::Listener { |
29 public: | 30 public: |
30 explicit GeolocationDispatcherOld(RenderView* render_view); | 31 explicit GeolocationDispatcherOld(RenderView* render_view); |
31 virtual ~GeolocationDispatcherOld(); | 32 virtual ~GeolocationDispatcherOld(); |
32 | 33 |
33 // Called to possibly handle the incoming IPC message. Returns true if | 34 // IPC::Channel::Listener implementation |
34 // handled. Called in render thread. | |
35 bool OnMessageReceived(const IPC::Message& msg); | 35 bool OnMessageReceived(const IPC::Message& msg); |
36 | 36 |
37 // WebKit::WebGeolocationService. | 37 // WebKit::WebGeolocationService. |
38 virtual void requestPermissionForFrame(int bridge_id, | 38 virtual void requestPermissionForFrame(int bridge_id, |
39 const WebKit::WebURL& url); | 39 const WebKit::WebURL& url); |
40 virtual void cancelPermissionRequestForFrame( | 40 virtual void cancelPermissionRequestForFrame( |
41 int bridge_id, const WebKit::WebURL& url); | 41 int bridge_id, const WebKit::WebURL& url); |
42 virtual void startUpdating( | 42 virtual void startUpdating( |
43 int bridge_id, const WebKit::WebURL& url, bool enableHighAccuracy); | 43 int bridge_id, const WebKit::WebURL& url, bool enableHighAccuracy); |
44 virtual void stopUpdating(int bridge_id); | 44 virtual void stopUpdating(int bridge_id); |
(...skipping 14 matching lines...) Expand all Loading... |
59 | 59 |
60 // The geolocation services attached to this dispatcher. | 60 // The geolocation services attached to this dispatcher. |
61 IDMap<WebKit::WebGeolocationServiceBridge> bridges_map_; | 61 IDMap<WebKit::WebGeolocationServiceBridge> bridges_map_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherOld); | 63 DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherOld); |
64 }; | 64 }; |
65 | 65 |
66 #endif // ENABLE_CLIENT_BASED_GEOLOCATION | 66 #endif // ENABLE_CLIENT_BASED_GEOLOCATION |
67 | 67 |
68 #endif // CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ | 68 #endif // CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ |
OLD | NEW |