OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
8 #include "content/common/geofencing_types.h" | 11 #include "content/common/geofencing_types.h" |
9 #include "content/public/browser/browser_message_filter.h" | 12 #include "content/public/browser/browser_message_filter.h" |
10 | 13 |
11 namespace blink { | 14 namespace blink { |
12 struct WebCircularGeofencingRegion; | 15 struct WebCircularGeofencingRegion; |
13 } | 16 } |
14 | 17 |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 class GeofencingManager; | 20 class GeofencingManager; |
18 class ServiceWorkerContextWrapper; | 21 class ServiceWorkerContextWrapper; |
19 | 22 |
20 class GeofencingDispatcherHost : public BrowserMessageFilter { | 23 class GeofencingDispatcherHost : public BrowserMessageFilter { |
21 public: | 24 public: |
22 explicit GeofencingDispatcherHost(GeofencingManager* geofencing_manager); | 25 explicit GeofencingDispatcherHost(GeofencingManager* geofencing_manager); |
23 | 26 |
24 private: | 27 private: |
25 ~GeofencingDispatcherHost() override; | 28 ~GeofencingDispatcherHost() override; |
26 | 29 |
27 // BrowserMessageFilter implementation. | 30 // BrowserMessageFilter implementation. |
28 bool OnMessageReceived(const IPC::Message& message) override; | 31 bool OnMessageReceived(const IPC::Message& message) override; |
29 | 32 |
30 void OnRegisterRegion(int thread_id, | 33 void OnRegisterRegion(int thread_id, |
31 int request_id, | 34 int request_id, |
32 const std::string& region_id, | 35 const std::string& region_id, |
33 const blink::WebCircularGeofencingRegion& region, | 36 const blink::WebCircularGeofencingRegion& region, |
34 int64 service_worker_registration_id); | 37 int64_t service_worker_registration_id); |
35 void OnUnregisterRegion(int thread_id, | 38 void OnUnregisterRegion(int thread_id, |
36 int request_id, | 39 int request_id, |
37 const std::string& region_id, | 40 const std::string& region_id, |
38 int64 service_worker_registration_id); | 41 int64_t service_worker_registration_id); |
39 void OnGetRegisteredRegions(int thread_id, | 42 void OnGetRegisteredRegions(int thread_id, |
40 int request_id, | 43 int request_id, |
41 int64 service_worker_registration_id); | 44 int64_t service_worker_registration_id); |
42 | 45 |
43 void RegisterRegionCompleted(int thread_id, | 46 void RegisterRegionCompleted(int thread_id, |
44 int request_id, | 47 int request_id, |
45 GeofencingStatus result); | 48 GeofencingStatus result); |
46 void UnregisterRegionCompleted(int thread_id, | 49 void UnregisterRegionCompleted(int thread_id, |
47 int request_id, | 50 int request_id, |
48 GeofencingStatus result); | 51 GeofencingStatus result); |
49 | 52 |
50 scoped_refptr<GeofencingManager> manager_; | 53 scoped_refptr<GeofencingManager> manager_; |
51 base::WeakPtrFactory<GeofencingDispatcherHost> weak_factory_; | 54 base::WeakPtrFactory<GeofencingDispatcherHost> weak_factory_; |
52 | 55 |
53 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost); | 56 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost); |
54 }; | 57 }; |
55 | 58 |
56 } // namespace content | 59 } // namespace content |
57 | 60 |
58 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ | 61 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_ |
OLD | NEW |