OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #import "ios/chrome/browser/geolocation/test_location_manager.h" | 5 #import "ios/chrome/browser/geolocation/test_location_manager.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 | 8 |
9 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
10 #error "This file requires ARC support." | |
11 #endif | |
12 | |
9 @interface TestLocationManager () { | 13 @interface TestLocationManager () { |
10 CLAuthorizationStatus _authorizationStatus; | 14 CLAuthorizationStatus _authorizationStatus; |
sdefresne
2016/11/25 10:13:24
nit: remove
| |
11 base::scoped_nsobject<CLLocation> _currentLocation; | 15 base::scoped_nsobject<CLLocation> _currentLocation; |
12 BOOL _locationServicesEnabled; | 16 BOOL _locationServicesEnabled; |
sdefresne
2016/11/25 10:13:24
nit: remove
| |
13 BOOL _started; | 17 BOOL _started; |
sdefresne
2016/11/25 10:13:24
nit: remove
| |
14 BOOL _stopped; | 18 BOOL _stopped; |
sdefresne
2016/11/25 10:13:24
nit: remove
| |
15 } | 19 } |
16 | 20 |
17 @end | 21 @end |
18 | 22 |
19 @implementation TestLocationManager | 23 @implementation TestLocationManager |
20 | 24 |
21 @synthesize authorizationStatus = _authorizationStatus; | 25 @synthesize authorizationStatus = _authorizationStatus; |
22 @synthesize locationServicesEnabled = _locationServicesEnabled; | 26 @synthesize locationServicesEnabled = _locationServicesEnabled; |
23 @synthesize started = _started; | 27 @synthesize started = _started; |
24 @synthesize stopped = _stopped; | 28 @synthesize stopped = _stopped; |
(...skipping 11 matching lines...) Expand all Loading... | |
36 _authorizationStatus = authorizationStatus; | 40 _authorizationStatus = authorizationStatus; |
37 [self.delegate locationManagerDidChangeAuthorizationStatus:self]; | 41 [self.delegate locationManagerDidChangeAuthorizationStatus:self]; |
38 } | 42 } |
39 } | 43 } |
40 | 44 |
41 - (CLLocation*)currentLocation { | 45 - (CLLocation*)currentLocation { |
42 return _currentLocation; | 46 return _currentLocation; |
43 } | 47 } |
44 | 48 |
45 - (void)setCurrentLocation:(CLLocation*)currentLocation { | 49 - (void)setCurrentLocation:(CLLocation*)currentLocation { |
46 _currentLocation.reset([currentLocation retain]); | 50 _currentLocation.reset(currentLocation); |
47 } | 51 } |
48 | 52 |
49 - (void)reset { | 53 - (void)reset { |
50 _authorizationStatus = kCLAuthorizationStatusNotDetermined; | 54 _authorizationStatus = kCLAuthorizationStatusNotDetermined; |
51 _currentLocation.reset(); | 55 _currentLocation.reset(); |
52 _locationServicesEnabled = YES; | 56 _locationServicesEnabled = YES; |
53 _started = NO; | 57 _started = NO; |
54 _stopped = NO; | 58 _stopped = NO; |
55 } | 59 } |
56 | 60 |
57 #pragma mark - LocationManager overrides | 61 #pragma mark - LocationManager overrides |
58 | 62 |
59 - (void)startUpdatingLocation { | 63 - (void)startUpdatingLocation { |
60 _started = YES; | 64 _started = YES; |
61 } | 65 } |
62 | 66 |
63 - (void)stopUpdatingLocation { | 67 - (void)stopUpdatingLocation { |
64 _stopped = YES; | 68 _stopped = YES; |
65 } | 69 } |
66 | 70 |
67 @end | 71 @end |
OLD | NEW |