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_types.h"
9 #include "content/public/browser/browser_message_filter.h"
12 struct WebCircularGeofencingRegion
;
17 class GeofencingManager
;
18 class ServiceWorkerContextWrapper
;
20 class GeofencingDispatcherHost
: public BrowserMessageFilter
{
22 explicit GeofencingDispatcherHost(GeofencingManager
* geofencing_manager
);
25 ~GeofencingDispatcherHost() override
;
27 // BrowserMessageFilter implementation.
28 bool OnMessageReceived(const IPC::Message
& message
) override
;
30 void OnRegisterRegion(int thread_id
,
32 const std::string
& region_id
,
33 const blink::WebCircularGeofencingRegion
& region
,
34 int64 service_worker_registration_id
);
35 void OnUnregisterRegion(int thread_id
,
37 const std::string
& region_id
,
38 int64 service_worker_registration_id
);
39 void OnGetRegisteredRegions(int thread_id
,
41 int64 service_worker_registration_id
);
43 void RegisterRegionCompleted(int thread_id
,
45 GeofencingStatus result
);
46 void UnregisterRegionCompleted(int thread_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_