Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / browser / geolocation / location_arbitrator.h
blobd2cd191c7981db567665744e0c2e8c4e2391714a
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_
6 #define CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_H_
8 #include "content/common/content_export.h"
10 namespace content {
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
14 // moment.
15 class CONTENT_EXPORT LocationArbitrator {
16 public:
17 virtual ~LocationArbitrator() {};
19 // See more details in geolocation_provider.
20 virtual void StartProviders(bool use_high_accuracy) = 0;
21 virtual void StopProviders() = 0;
23 // 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
25 // infobar prompt) or inferred from a persisted site permission.
26 // The arbitrator will inform all providers of this, which may in turn use
27 // this information to modify their internal policy.
28 virtual void OnPermissionGranted() = 0;
30 // Returns true if this arbitrator has received at least one call to
31 // OnPermissionGranted().
32 virtual bool HasPermissionBeenGranted() const = 0;
35 } // namespace content
37 #endif // CONTENT_BROWSER_GEOLOCATION_LOCATION_ARBITRATOR_IMPL_H_