OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_ | 5 #ifndef CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_ |
6 #define CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_ | 6 #define CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_ |
7 | 7 |
8 #include <windows.h> | |
9 #include <atlbase.h> | 8 #include <atlbase.h> |
10 #include <atlcom.h> | 9 #include <atlcom.h> |
11 #include <locationapi.h> | 10 #include <locationapi.h> |
12 #include <sensors.h> | 11 #include <sensors.h> |
| 12 #include <Windows.h> |
13 | 13 |
| 14 #include "app/win/scoped_com_initializer.h" |
14 #include "base/time.h" | 15 #include "base/time.h" |
15 #include "base/win/scoped_com_initializer.h" | |
16 | 16 |
17 struct Geoposition; | 17 struct Geoposition; |
18 | 18 |
19 // PropVariantToDouble | 19 // PropVariantToDouble |
20 typedef HRESULT (WINAPI* PropVariantToDoubleFunction) | 20 typedef HRESULT (WINAPI* PropVariantToDoubleFunction) |
21 (REFPROPVARIANT propvarIn, DOUBLE *pdblRet); | 21 (REFPROPVARIANT propvarIn, DOUBLE *pdblRet); |
22 | 22 |
23 class Win7LocationApi { | 23 class Win7LocationApi { |
24 public: | 24 public: |
25 virtual ~Win7LocationApi(); | 25 virtual ~Win7LocationApi(); |
(...skipping 17 matching lines...) Expand all Loading... |
43 void Init(HINSTANCE prop_library, | 43 void Init(HINSTANCE prop_library, |
44 PropVariantToDoubleFunction PropVariantToDouble_function, | 44 PropVariantToDoubleFunction PropVariantToDouble_function, |
45 ILocation* locator); | 45 ILocation* locator); |
46 | 46 |
47 // Provides the best position fix if one is available. | 47 // Provides the best position fix if one is available. |
48 // Does this by requesting a location report and querying it to obtain | 48 // Does this by requesting a location report and querying it to obtain |
49 // location information. | 49 // location information. |
50 virtual bool GetPositionIfFixed(Geoposition* position); | 50 virtual bool GetPositionIfFixed(Geoposition* position); |
51 | 51 |
52 // Ensure that COM has been initialized for this thread. | 52 // Ensure that COM has been initialized for this thread. |
53 base::win::ScopedCOMInitializer com_initializer_; | 53 app::win::ScopedCOMInitializer com_initializer_; |
54 // ILocation object that lets us communicate with the Location and | 54 // ILocation object that lets us communicate with the Location and |
55 // Sensors platform. | 55 // Sensors platform. |
56 CComPtr<ILocation> locator_; | 56 CComPtr<ILocation> locator_; |
57 // Holds the opened propsys.dll library that is passed on construction. | 57 // Holds the opened propsys.dll library that is passed on construction. |
58 // This class is responsible for closing it. | 58 // This class is responsible for closing it. |
59 HINSTANCE prop_lib_; | 59 HINSTANCE prop_lib_; |
60 PropVariantToDoubleFunction PropVariantToDouble_function_; | 60 PropVariantToDoubleFunction PropVariantToDouble_function_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(Win7LocationApi); | 62 DISALLOW_COPY_AND_ASSIGN(Win7LocationApi); |
63 }; | 63 }; |
64 | 64 |
65 #endif // CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_ | 65 #endif // CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_ |
OLD | NEW |