| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_ |
| 6 #define CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "content/browser/geolocation/location_provider.h" | 11 #include "content/browser/geolocation/location_provider.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 22 class CONTENT_EXPORT Win7LocationProvider : public LocationProviderBase { | 22 class CONTENT_EXPORT Win7LocationProvider : public LocationProviderBase { |
| 23 public: | 23 public: |
| 24 Win7LocationProvider(Win7LocationApi* api); | 24 Win7LocationProvider(Win7LocationApi* api); |
| 25 virtual ~Win7LocationProvider(); | 25 virtual ~Win7LocationProvider(); |
| 26 | 26 |
| 27 // LocationProvider. | 27 // LocationProvider. |
| 28 virtual bool StartProvider(bool high_accuracy) OVERRIDE; | 28 virtual bool StartProvider(bool high_accuracy) OVERRIDE; |
| 29 virtual void StopProvider() OVERRIDE; | 29 virtual void StopProvider() OVERRIDE; |
| 30 virtual void GetPosition(Geoposition* position) OVERRIDE; | 30 virtual void GetPosition(Geoposition* position) OVERRIDE; |
| 31 virtual void UpdatePosition() OVERRIDE; | 31 virtual void UpdatePosition() OVERRIDE; |
| 32 virtual void OnPermissionGranted(const GURL& requesting_frame) OVERRIDE; | |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 // Task which runs in the child thread. | 34 // Task which runs in the child thread. |
| 36 void DoPollTask(); | 35 void DoPollTask(); |
| 37 // Will schedule a poll; i.e. enqueue DoPollTask deferred task. | 36 // Will schedule a poll; i.e. enqueue DoPollTask deferred task. |
| 38 void ScheduleNextPoll(int interval); | 37 void ScheduleNextPoll(int interval); |
| 39 | 38 |
| 40 scoped_ptr<Win7LocationApi> api_; | 39 scoped_ptr<Win7LocationApi> api_; |
| 41 Geoposition position_; | 40 Geoposition position_; |
| 42 // Holder for the tasks which run on the thread; takes care of cleanup. | 41 // Holder for the tasks which run on the thread; takes care of cleanup. |
| 43 base::WeakPtrFactory<Win7LocationProvider> weak_factory_; | 42 base::WeakPtrFactory<Win7LocationProvider> weak_factory_; |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 #endif // CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_ | 45 #endif // CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_PROVIDER_WIN_H_ |
| OLD | NEW |