1 // Copyright (c) 2012 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 // This file declares a CoreLocation provider that runs on Mac OS X (10.6). 6 // Public for testing only - for normal usage this header should not be 7 // required, as location_provider.h declares the needed factory function. 8 9 #ifndef CONTENT_BROWSER_GEOLOCATION_CORE_LOCATION_PROVIDER_MAC_H_ 10 #define CONTENT_BROWSER_GEOLOCATION_CORE_LOCATION_PROVIDER_MAC_H_ 11 12 #include "content/browser/geolocation/location_provider_base.h" 13 #include "content/public/common/geoposition.h" 14 15 namespace content { 16 class CoreLocationDataProviderMac; 17 18 class CoreLocationProviderMac : public LocationProviderBase { 19 public: 20 explicit CoreLocationProviderMac(); 21 virtual ~CoreLocationProviderMac(); 22 23 // LocationProvider 24 virtual bool StartProvider(bool high_accuracy) OVERRIDE; 25 virtual void StopProvider() OVERRIDE; 26 virtual void GetPosition(Geoposition* position) OVERRIDE; 27 virtual void OnPermissionGranted() OVERRIDE; 28 29 // Receives new positions and calls UpdateListeners 30 void SetPosition(Geoposition* position); 31 32 private: 33 bool is_updating_; 34 CoreLocationDataProviderMac* data_provider_; 35 Geoposition position_; 36 }; 37 38 } // namespace content 39 40 #endif // CONTENT_BROWSER_GEOLOCATION_CORE_LOCATION_PROVIDER_MAC_H_ 41