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

Side by Side Diff: content/public/browser/geolocation_delegate.h

Issue 2126893003: Geolocation cleanup: make GeolocationDelegate::OverrideSystemLocationProvider return unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wez@ comments; refactored GeolocationLocationArbitratorTest and TestingLocationArbitrator Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUBLIC_BROWSER_GEOLOCATION_DELEGATE_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_GEOLOCATION_DELEGATE_H_
6 #define CONTENT_PUBLIC_BROWSER_GEOLOCATION_DELEGATE_H_ 6 #define CONTENT_PUBLIC_BROWSER_GEOLOCATION_DELEGATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 11
12 namespace content { 12 namespace content {
13 class AccessTokenStore; 13 class AccessTokenStore;
14 class LocationProvider; 14 class LocationProvider;
15 15
16 // An embedder of Geolocation may override these class' methods to provide 16 // An embedder of Geolocation may override these class' methods to provide
17 // specific functionality. 17 // specific functionality.
18 class CONTENT_EXPORT GeolocationDelegate { 18 class CONTENT_EXPORT GeolocationDelegate {
Wez 2016/07/08 23:12:58 This interface should have a virtual dtor declared
mcasas 2016/07/09 01:24:18 Done.
19 public: 19 public:
20 // Returns true if the location API should use network-based location 20 // Returns true if the location API should use network-based location
21 // approximation in addition to the system provider, if any. 21 // approximation in addition to the system provider, if any.
22 virtual bool UseNetworkLocationProviders(); 22 virtual bool UseNetworkLocationProviders();
23 // Creates a new AccessTokenStore for geolocation. May return nullptr. 23
24 // Creates a new AccessTokenStore for geolocation. May return nullptr.
24 // TODO(mcasas): consider changing it return type to std::unique_ptr<> to 25 // TODO(mcasas): consider changing it return type to std::unique_ptr<> to
25 // clarify ownership, https://crbug.com/623114. 26 // clarify ownership, https://crbug.com/623114.
26 virtual AccessTokenStore* CreateAccessTokenStore(); 27 virtual AccessTokenStore* CreateAccessTokenStore();
27 // Allows an embedder to return its own LocationProvider implementation. 28
29 // Allows an embedder to return its own LocationProvider implementation.
28 // Return nullptr to use the default one for the platform to be created. 30 // Return nullptr to use the default one for the platform to be created.
29 // Caller takes ownership of the returned LocationProvider. FYI: Used by an 31 // FYI: Used by an external project; please don't remove. Contact Viatcheslav
30 // external project; please don't remove. Contact Viatcheslav Ostapenko at 32 // Ostapenko at sl.ostapenko@samsung.com for more information.
31 // sl.ostapenko@samsung.com for more information. 33 virtual std::unique_ptr<LocationProvider> OverrideSystemLocationProvider();
32 // TODO(mcasas): return std::unique_ptr<> instead, https://crbug.com/623132.
33 virtual LocationProvider* OverrideSystemLocationProvider();
34 }; 34 };
35 35
36 } // namespace content 36 } // namespace content
37 37
38 #endif // CONTENT_PUBLIC_BROWSER_GEOLOCATION_DELEGATE_H_ 38 #endif // CONTENT_PUBLIC_BROWSER_GEOLOCATION_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698