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

Side by Side Diff: ios/chrome/browser/geolocation/test_location_manager.mm

Issue 1103293002: [iOS] Upstream iOS geolocation code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 5 years, 7 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
« no previous file with comments | « ios/chrome/browser/geolocation/test_location_manager.h ('k') | ios/chrome/ios_chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #import "ios/chrome/browser/geolocation/test_location_manager.h"
6
7 #include "base/mac/scoped_nsobject.h"
8
9 @interface TestLocationManager () {
10 CLAuthorizationStatus _authorizationStatus;
11 base::scoped_nsobject<CLLocation> _currentLocation;
12 BOOL _locationServicesEnabled;
13 BOOL _started;
14 BOOL _stopped;
15 }
16
17 @end
18
19 @implementation TestLocationManager
20
21 @synthesize authorizationStatus = _authorizationStatus;
22 @synthesize locationServicesEnabled = _locationServicesEnabled;
23 @synthesize started = _started;
24 @synthesize stopped = _stopped;
25
26 - (id)init {
27 self = [super init];
28 if (self) {
29 [self reset];
30 }
31 return self;
32 }
33
34 - (void)setAuthorizationStatus:(CLAuthorizationStatus)authorizationStatus {
35 if (_authorizationStatus != authorizationStatus) {
36 _authorizationStatus = authorizationStatus;
37 [self.delegate locationManagerDidChangeAuthorizationStatus:self];
38 }
39 }
40
41 - (CLLocation*)currentLocation {
42 return _currentLocation;
43 }
44
45 - (void)setCurrentLocation:(CLLocation*)currentLocation {
46 _currentLocation.reset([currentLocation retain]);
47 }
48
49 - (void)reset {
50 _authorizationStatus = kCLAuthorizationStatusNotDetermined;
51 _currentLocation.reset();
52 _locationServicesEnabled = YES;
53 _started = NO;
54 _stopped = NO;
55 }
56
57 #pragma mark - LocationManager overrides
58
59 - (void)startUpdatingLocation {
60 _started = YES;
61 }
62
63 - (void)stopUpdatingLocation {
64 _stopped = YES;
65 }
66
67 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/geolocation/test_location_manager.h ('k') | ios/chrome/ios_chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698