OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #include "base/memory/scoped_ptr.h" | |
6 #include "content/browser/geolocation/geolocation_provider_impl.h" | |
7 #include "content/common/geolocation_service.mojom.h" | |
8 | |
9 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_ | |
10 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_ | |
11 | |
12 namespace content { | |
13 | |
14 class GeolocationProvider; | |
15 class GeolocationServiceContext; | |
16 | |
17 // Implements the GeolocationService Mojo interface. | |
18 class GeolocationServiceImpl : public mojo::InterfaceImpl<GeolocationService> { | |
19 public: | |
20 // |context| must outlive this object. |update_callback| will be | |
21 // called when location updates are sent. | |
22 GeolocationServiceImpl(GeolocationServiceContext* context, | |
23 const base::Closure& update_callback); | |
24 virtual ~GeolocationServiceImpl(); | |
25 | |
26 // Pauses and resumes sending updates to the client of this instance. | |
27 void PauseUpdates(); | |
28 void ResumeUpdates(); | |
29 | |
30 private: | |
31 // GeolocationService: | |
32 virtual void StartUpdating(bool high_accuracy) OVERRIDE; | |
qsr
2014/10/09 08:58:33
If this is part of the interface of the object, is
blundell
2014/10/21 12:27:49
I made it private because it should only be called
| |
33 | |
34 // mojo::InterfaceImpl: | |
35 virtual void OnConnectionError() OVERRIDE; | |
36 | |
37 void StartListeningForUpdates(); | |
38 void OnLocationUpdate(const Geoposition& position); | |
39 | |
40 // Owns this object. | |
41 GeolocationServiceContext* context_; | |
42 scoped_ptr<GeolocationProvider::Subscription> geolocation_subscription_; | |
43 base::Closure update_callback_; | |
44 | |
45 // Whether this instance is currently observing location updates with high | |
46 // accuracy. | |
47 bool high_accuracy_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceImpl); | |
50 }; | |
51 | |
52 } // namespace content | |
53 | |
54 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_ | |
OLD | NEW |