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

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

Issue 65273002: Add a mechanism to pause and resume geolocation requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wire up onPause/onResume Created 7 years, 1 month 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 CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ 5 #ifndef CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_
6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_ 6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // This class is responsible for handling updates from multiple underlying 12 // This class is responsible for handling updates from multiple underlying
13 // providers and resolving them to a single 'best' location fix at any given 13 // providers and resolving them to a single 'best' location fix at any given
14 // moment. 14 // moment.
15 class CONTENT_EXPORT LocationArbitrator { 15 class CONTENT_EXPORT LocationArbitrator {
16 public: 16 public:
17 virtual ~LocationArbitrator() {}; 17 virtual ~LocationArbitrator() {};
18 18
19 // See more details in geolocation_provider. 19 // See more details in geolocation_provider.
20 virtual void StartProviders(bool use_high_accuracy) = 0; 20 virtual void StartProviders(bool use_high_accuracy) = 0;
21 virtual void StopProviders() = 0; 21 virtual void StopProviders() = 0;
22 virtual void PauseProviders() = 0;
23 virtual void ResumeProviders() = 0;
22 24
23 // Called everytime permission is granted to a page for using geolocation. 25 // Called everytime permission is granted to a page for using geolocation.
24 // This may either be through explicit user action (e.g. responding to the 26 // This may either be through explicit user action (e.g. responding to the
25 // infobar prompt) or inferred from a persisted site permission. 27 // infobar prompt) or inferred from a persisted site permission.
26 // The arbitrator will inform all providers of this, which may in turn use 28 // The arbitrator will inform all providers of this, which may in turn use
27 // this information to modify their internal policy. 29 // this information to modify their internal policy.
28 virtual void OnPermissionGranted() = 0; 30 virtual void OnPermissionGranted() = 0;
29 31
30 // Returns true if this arbitrator has received at least one call to 32 // Returns true if this arbitrator has received at least one call to
31 // OnPermissionGranted(). 33 // OnPermissionGranted().
32 virtual bool HasPermissionBeenGranted() const = 0; 34 virtual bool HasPermissionBeenGranted() const = 0;
33 }; 35 };
34 36
35 } // namespace content 37 } // namespace content
36 38
37 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_ 39 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698