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

Unified 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, 8 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/geolocation/test_location_manager.mm
diff --git a/ios/chrome/browser/geolocation/test_location_manager.mm b/ios/chrome/browser/geolocation/test_location_manager.mm
new file mode 100644
index 0000000000000000000000000000000000000000..eb6633eaf84d124313a21a4fa8bbb16f557887da
--- /dev/null
+++ b/ios/chrome/browser/geolocation/test_location_manager.mm
@@ -0,0 +1,67 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/geolocation/test_location_manager.h"
+
+#include "base/mac/scoped_nsobject.h"
+
+@interface TestLocationManager () {
+ CLAuthorizationStatus _authorizationStatus;
+ base::scoped_nsobject<CLLocation> _currentLocation;
+ BOOL _locationServicesEnabled;
+ BOOL _started;
+ BOOL _stopped;
+}
+
+@end
+
+@implementation TestLocationManager
+
+@synthesize authorizationStatus = _authorizationStatus;
+@synthesize locationServicesEnabled = _locationServicesEnabled;
+@synthesize started = _started;
+@synthesize stopped = _stopped;
+
+- (id)init {
+ self = [super init];
+ if (self) {
+ [self reset];
+ }
+ return self;
+}
+
+- (void)setAuthorizationStatus:(CLAuthorizationStatus)authorizationStatus {
+ if (_authorizationStatus != authorizationStatus) {
+ _authorizationStatus = authorizationStatus;
+ [self.delegate locationManagerDidChangeAuthorizationStatus:self];
+ }
+}
+
+- (CLLocation*)currentLocation {
+ return _currentLocation;
+}
+
+- (void)setCurrentLocation:(CLLocation*)currentLocation {
+ _currentLocation.reset([currentLocation retain]);
+}
+
+- (void)reset {
+ _authorizationStatus = kCLAuthorizationStatusNotDetermined;
+ _currentLocation.reset();
+ _locationServicesEnabled = YES;
+ _started = NO;
+ _stopped = NO;
+}
+
+#pragma mark - LocationManager overrides
+
+- (void)startUpdatingLocation {
+ _started = YES;
+}
+
+- (void)stopUpdatingLocation {
+ _stopped = YES;
+}
+
+@end
« 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