OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_GEOLOCATION_LOCATION_MANAGER_H_ |
| 6 #define IOS_CHROME_BROWSER_GEOLOCATION_LOCATION_MANAGER_H_ |
| 7 |
| 8 #import <CoreLocation/CoreLocation.h> |
| 9 #import <Foundation/Foundation.h> |
| 10 |
| 11 @class LocationManager; |
| 12 |
| 13 // Defines the methods to be implemented by a delegate of a LocationManager |
| 14 // instance. |
| 15 @protocol LocationManagerDelegate |
| 16 |
| 17 // Notifies the delegate that the application's authorization status changed. |
| 18 - (void)locationManagerDidChangeAuthorizationStatus: |
| 19 (LocationManager*)locationManager; |
| 20 |
| 21 @end |
| 22 |
| 23 // Manages fetching and updating the current device location. |
| 24 @interface LocationManager : NSObject |
| 25 |
| 26 // The application’s authorization status for using location services. This |
| 27 // proxies |[CLLocationManager authorizationStatus]|, so that we can write unit |
| 28 // tests for client classes by mocking this class. |
| 29 @property(nonatomic, readonly) CLAuthorizationStatus authorizationStatus; |
| 30 |
| 31 // Returns the most recently fetched location. |
| 32 @property(nonatomic, readonly) CLLocation* currentLocation; |
| 33 |
| 34 // The delegate object for this instance of LocationManager. |
| 35 @property(nonatomic, assign) id<LocationManagerDelegate> delegate; |
| 36 |
| 37 // Boolean value indicating whether location services are enabled on the |
| 38 // device. This proxies |[CLLocationManager locationServicesEnabled]|, so that |
| 39 // we can write unit tests for client classes by mocking this class. |
| 40 @property(nonatomic, readonly) BOOL locationServicesEnabled; |
| 41 |
| 42 // Starts updating device location if needed. |
| 43 - (void)startUpdatingLocation; |
| 44 |
| 45 // Stops updating device location. |
| 46 - (void)stopUpdatingLocation; |
| 47 |
| 48 @end |
| 49 |
| 50 #endif // IOS_CHROME_BROWSER_GEOLOCATION_LOCATION_MANAGER_H_ |
OLD | NEW |