Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: content/browser/geolocation/geolocation_service_impl.h

Issue 841133002: Stop using [Client=...] feature of Mojom for GeolocationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "content/browser/geolocation/geolocation_provider_impl.h" 6 #include "content/browser/geolocation/geolocation_provider_impl.h"
7 #include "content/common/geolocation_service.mojom.h" 7 #include "content/common/geolocation_service.mojom.h"
8 #include "content/public/common/mojo_geoposition.mojom.h"
8 9
9 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_ 10 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_
10 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_ 11 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_
11 12
12 namespace content { 13 namespace content {
13 14
14 class GeolocationProvider; 15 class GeolocationProvider;
15 class GeolocationServiceContext; 16 class GeolocationServiceContext;
16 17
17 // Implements the GeolocationService Mojo interface. 18 // Implements the GeolocationService Mojo interface.
(...skipping 10 matching lines...) Expand all
28 29
29 // Pauses and resumes sending updates to the client of this instance. 30 // Pauses and resumes sending updates to the client of this instance.
30 void PauseUpdates(); 31 void PauseUpdates();
31 void ResumeUpdates(); 32 void ResumeUpdates();
32 33
33 // Enables and disables geolocation override. 34 // Enables and disables geolocation override.
34 void SetOverride(const Geoposition& position); 35 void SetOverride(const Geoposition& position);
35 void ClearOverride(); 36 void ClearOverride();
36 37
37 private: 38 private:
39 typedef mojo::Callback<void(MojoGeopositionPtr)> PositionCallback;
40
38 // GeolocationService: 41 // GeolocationService:
39 void SetHighAccuracy(bool high_accuracy) override; 42 void SetHighAccuracy(bool high_accuracy) override;
43 void QueryNextPosition(const PositionCallback& callback) override;
40 44
41 // mojo::InterfaceImpl: 45 // mojo::InterfaceImpl:
42 void OnConnectionError() override; 46 void OnConnectionError() override;
43 47
44 void OnLocationUpdate(const Geoposition& position); 48 void OnLocationUpdate(const Geoposition& position);
49 void ReportCurrentPosition();
45 50
46 // Owns this object. 51 // Owns this object.
47 GeolocationServiceContext* context_; 52 GeolocationServiceContext* context_;
48 scoped_ptr<GeolocationProvider::Subscription> geolocation_subscription_; 53 scoped_ptr<GeolocationProvider::Subscription> geolocation_subscription_;
49 base::Closure update_callback_; 54 base::Closure update_callback_;
blundell 2015/01/09 07:37:25 I should have documented this variable. Could you
50 55
56 std::vector<PositionCallback> position_callbacks_;
blundell 2015/01/09 07:37:26 Hmm, we now have |update_callback_| and |position_
57
51 // Valid iff SetOverride() has been called and ClearOverride() has not 58 // Valid iff SetOverride() has been called and ClearOverride() has not
52 // subsequently been called. 59 // subsequently been called.
53 Geoposition position_override_; 60 Geoposition position_override_;
54 61
62 MojoGeoposition current_position_;
63
55 // Whether this instance is currently observing location updates with high 64 // Whether this instance is currently observing location updates with high
56 // accuracy. 65 // accuracy.
57 bool high_accuracy_; 66 bool high_accuracy_;
58 67
68 bool has_position_to_report_;
69
59 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceImpl); 70 DISALLOW_COPY_AND_ASSIGN(GeolocationServiceImpl);
60 }; 71 };
61 72
62 } // namespace content 73 } // namespace content
63 74
64 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_ 75 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_SERVICE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/geolocation/geolocation_service_impl.cc » ('j') | content/common/geolocation_service.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698