summaryrefslogtreecommitdiff
path: root/chromium/content/browser/geofencing/geofencing_provider.h
blob: dec96b5270b2b36014b6d0b3cb0768a242fbda10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_
#define CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_

#include "base/basictypes.h"
#include "base/callback_forward.h"
#include "content/common/geofencing_status.h"

namespace blink {
struct WebCircularGeofencingRegion;
};

namespace content {

class GeofencingProvider {
 public:
  typedef base::Callback<void(GeofencingStatus)> StatusCallback;

  virtual ~GeofencingProvider() {}

  // Called by |GeofencingService| to register a new fence. GeofencingService is
  // responsible for handling things like duplicate regions, so platform
  // specific implementations shouldn't have to worry about things like that.
  // Also GeofencingService should be making sure the total number of geofences
  // that is registered with the platform specific provider does not exceed the
  // number of regions supported by the platform, although that isn't
  // implemented yet.
  // Implementations of RegisterRegion must asynchronously call the |callback|
  // to indicate success or failure.
  virtual void RegisterRegion(int64 geofencing_registration_id,
                              const blink::WebCircularGeofencingRegion& region,
                              const StatusCallback& callback) = 0;

  // Called by |GeofencingService| to unregister an existing registration. Will
  // only be called once for each registration.
  virtual void UnregisterRegion(int64 geofencing_registration_id) = 0;
};

}  // namespace content

#endif  // CONTENT_BROWSER_GEOFENCING_GEOFENCING_PROVIDER_H_