Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / geofencing / geofencing_dispatcher_host.h
blob40ed3a8487b52c7735a57d4460978d99440c49a9
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
8 #include "content/common/geofencing_status.h"
9 #include "content/public/browser/browser_message_filter.h"
11 namespace blink {
12 struct WebCircularGeofencingRegion;
15 namespace content {
17 class GeofencingManager;
18 class ServiceWorkerContextWrapper;
20 class GeofencingDispatcherHost : public BrowserMessageFilter {
21 public:
22 explicit GeofencingDispatcherHost(GeofencingManager* geofencing_manager);
24 private:
25 ~GeofencingDispatcherHost() override;
27 // BrowserMessageFilter implementation.
28 bool OnMessageReceived(const IPC::Message& message) override;
30 void OnRegisterRegion(int thread_id,
31 int request_id,
32 const std::string& region_id,
33 const blink::WebCircularGeofencingRegion& region,
34 int64 service_worker_registration_id);
35 void OnUnregisterRegion(int thread_id,
36 int request_id,
37 const std::string& region_id,
38 int64 service_worker_registration_id);
39 void OnGetRegisteredRegions(int thread_id,
40 int request_id,
41 int64 service_worker_registration_id);
43 void RegisterRegionCompleted(int thread_id,
44 int request_id,
45 GeofencingStatus result);
46 void UnregisterRegionCompleted(int thread_id,
47 int request_id,
48 GeofencingStatus result);
50 scoped_refptr<GeofencingManager> manager_;
51 base::WeakPtrFactory<GeofencingDispatcherHost> weak_factory_;
53 DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost);
56 } // namespace content
58 #endif // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_