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

Side by Side Diff: device/geolocation/network_location_provider.h

Issue 2226143002: Gets rid of the LocationArbitrator interface, in preference for LocationProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: In response to Wez's #73-75 comments. Created 4 years, 4 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 (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 DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ 5 #ifndef DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_
6 #define DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ 6 #define DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 NetworkLocationProvider( 66 NetworkLocationProvider(
67 const scoped_refptr<AccessTokenStore>& access_token_store, 67 const scoped_refptr<AccessTokenStore>& access_token_store,
68 const scoped_refptr<net::URLRequestContextGetter>& context, 68 const scoped_refptr<net::URLRequestContextGetter>& context,
69 const GURL& url, 69 const GURL& url,
70 const base::string16& access_token); 70 const base::string16& access_token);
71 ~NetworkLocationProvider() override; 71 ~NetworkLocationProvider() override;
72 72
73 // LocationProvider implementation 73 // LocationProvider implementation
74 bool StartProvider(bool high_accuracy) override; 74 bool StartProvider(bool high_accuracy) override;
75 void StopProvider() override; 75 void StopProvider() override;
76 void GetPosition(Geoposition* position) override; 76 const Geoposition& GetPosition() override;
77 void RequestRefresh() override;
78 void OnPermissionGranted() override; 77 void OnPermissionGranted() override;
79 78
80 private: 79 private:
80 // Ensures that fresh location data is gathered.
81 void RequestRefresh();
82
81 // Satisfies a position request from cache or network. 83 // Satisfies a position request from cache or network.
82 void RequestPosition(); 84 void RequestPosition();
83 85
84 // Gets called when new wifi data is available. 86 // Gets called when new wifi data is available.
85 void OnWifiDataUpdate(); 87 void OnWifiDataUpdate();
86 88
87 // Internal helper used by OnWifiDataUpdate. 89 // Internal helper used by OnWifiDataUpdate.
88 void OnWifiDataUpdated(); 90 void OnWifiDataUpdated();
89 91
90 bool IsStarted() const; 92 bool IsStarted() const;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // over the platform-dependent implementations. 137 // over the platform-dependent implementations.
136 DEVICE_GEOLOCATION_EXPORT LocationProviderBase* NewNetworkLocationProvider( 138 DEVICE_GEOLOCATION_EXPORT LocationProviderBase* NewNetworkLocationProvider(
137 const scoped_refptr<AccessTokenStore>& access_token_store, 139 const scoped_refptr<AccessTokenStore>& access_token_store,
138 const scoped_refptr<net::URLRequestContextGetter>& context, 140 const scoped_refptr<net::URLRequestContextGetter>& context,
139 const GURL& url, 141 const GURL& url,
140 const base::string16& access_token); 142 const base::string16& access_token);
141 143
142 } // namespace device 144 } // namespace device
143 145
144 #endif // DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_ 146 #endif // DEVICE_GEOLOCATION_NETWORK_LOCATION_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698