| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file contains the class definitions for the CoreLocation data provider | 5 // This file contains the class definitions for the CoreLocation data provider |
| 6 // class and the accompanying Objective C wrapper class. This data provider | 6 // class and the accompanying Objective C wrapper class. This data provider |
| 7 // is used to allow the CoreLocation wrapper to run on the UI thread, since | 7 // is used to allow the CoreLocation wrapper to run on the UI thread, since |
| 8 // CLLocationManager's start and stop updating methods must be called from a | 8 // CLLocationManager's start and stop updating methods must be called from a |
| 9 // thread with an active NSRunLoop. Currently only the UI thread appears to | 9 // thread with an active NSRunLoop. Currently only the UI thread appears to |
| 10 // fill that requirement. | 10 // fill that requirement. |
| 11 | 11 |
| 12 #include "chrome/browser/geolocation/core_location_data_provider_mac.h" | 12 #include "content/browser/geolocation/core_location_data_provider_mac.h" |
| 13 #include "chrome/browser/geolocation/core_location_provider_mac.h" | 13 |
| 14 #include "chrome/browser/geolocation/geolocation_provider.h" | |
| 15 #include "base/logging.h" | 14 #include "base/logging.h" |
| 16 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "content/browser/geolocation/core_location_provider_mac.h" |
| 17 #include "content/browser/geolocation/geolocation_provider.h" |
| 17 | 18 |
| 18 // A few required declarations since the CoreLocation headers are not available | 19 // A few required declarations since the CoreLocation headers are not available |
| 19 // with the Mac OS X 10.5 SDK. | 20 // with the Mac OS X 10.5 SDK. |
| 20 // TODO(jorgevillatoro): Remove these declarations when we build against 10.6 | 21 // TODO(jorgevillatoro): Remove these declarations when we build against 10.6 |
| 21 | 22 |
| 22 // This idea was borrowed from wifi_data_provider_corewlan_mac.mm | 23 // This idea was borrowed from wifi_data_provider_corewlan_mac.mm |
| 23 typedef double CLLocationDegrees; | 24 typedef double CLLocationDegrees; |
| 24 typedef double CLLocationAccuracy; | 25 typedef double CLLocationAccuracy; |
| 25 typedef double CLLocationSpeed; | 26 typedef double CLLocationSpeed; |
| 26 typedef double CLLocationDirection; | 27 typedef double CLLocationDirection; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 237 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 237 [wrapper_ stopLocation]; | 238 [wrapper_ stopLocation]; |
| 238 } | 239 } |
| 239 | 240 |
| 240 void CoreLocationDataProviderMac::PositionUpdated(Geoposition position) { | 241 void CoreLocationDataProviderMac::PositionUpdated(Geoposition position) { |
| 241 DCHECK(MessageLoop::current() == | 242 DCHECK(MessageLoop::current() == |
| 242 GeolocationProvider::GetInstance()->message_loop()); | 243 GeolocationProvider::GetInstance()->message_loop()); |
| 243 if (provider_) | 244 if (provider_) |
| 244 provider_->SetPosition(&position); | 245 provider_->SetPosition(&position); |
| 245 } | 246 } |
| OLD | NEW |