OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/public/browser/geolocation_provider.h" | 17 #include "content/public/browser/geolocation_provider.h" |
18 #include "content/public/common/geoposition.h" | 18 #include "content/public/common/geoposition.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 template<typename Type> struct DefaultSingletonTraits; | 21 template<typename Type> struct DefaultSingletonTraits; |
22 } | 22 } |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 class GeolocationDelegate; | |
26 class LocationArbitrator; | 25 class LocationArbitrator; |
27 | 26 |
28 class CONTENT_EXPORT GeolocationProviderImpl | 27 class CONTENT_EXPORT GeolocationProviderImpl |
29 : public NON_EXPORTED_BASE(GeolocationProvider), | 28 : public NON_EXPORTED_BASE(GeolocationProvider), |
30 public base::Thread { | 29 public base::Thread { |
31 public: | 30 public: |
32 // GeolocationProvider implementation: | 31 // GeolocationProvider implementation: |
33 std::unique_ptr<GeolocationProvider::Subscription> AddLocationUpdateCallback( | 32 std::unique_ptr<GeolocationProvider::Subscription> AddLocationUpdateCallback( |
34 const LocationUpdateCallback& callback, | 33 const LocationUpdateCallback& callback, |
35 bool enable_high_accuracy) override; | 34 bool enable_high_accuracy) override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 84 |
86 base::CallbackList<void(const Geoposition&)> high_accuracy_callbacks_; | 85 base::CallbackList<void(const Geoposition&)> high_accuracy_callbacks_; |
87 base::CallbackList<void(const Geoposition&)> low_accuracy_callbacks_; | 86 base::CallbackList<void(const Geoposition&)> low_accuracy_callbacks_; |
88 | 87 |
89 bool user_did_opt_into_location_services_; | 88 bool user_did_opt_into_location_services_; |
90 Geoposition position_; | 89 Geoposition position_; |
91 | 90 |
92 // True only in testing, where we want to use a custom position. | 91 // True only in testing, where we want to use a custom position. |
93 bool ignore_location_updates_; | 92 bool ignore_location_updates_; |
94 | 93 |
95 // The system provided Delegate for the |arbitrator_|. | |
96 std::unique_ptr<GeolocationDelegate> delegate_; | |
97 | |
98 // Only to be used on the geolocation thread. | 94 // Only to be used on the geolocation thread. |
99 std::unique_ptr<LocationArbitrator> arbitrator_; | 95 std::unique_ptr<LocationArbitrator> arbitrator_; |
100 | 96 |
101 DISALLOW_COPY_AND_ASSIGN(GeolocationProviderImpl); | 97 DISALLOW_COPY_AND_ASSIGN(GeolocationProviderImpl); |
102 }; | 98 }; |
103 | 99 |
104 } // namespace content | 100 } // namespace content |
105 | 101 |
106 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_ | 102 #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PROVIDER_IMPL_H_ |
OLD | NEW |