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

Side by Side Diff: content/browser/geolocation/win7_location_api_win.h

Issue 22674006: Delete the Windows 7 Geolocation provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
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 #ifndef CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_
6 #define CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_
7
8 #include <windows.h>
9 #include <atlbase.h>
10 #include <atlcom.h>
11 #include <locationapi.h>
12 #include <sensors.h>
13
14 #include "base/basictypes.h"
15 #include "content/common/content_export.h"
16
17 namespace content {
18 struct Geoposition;
19
20 // PropVariantToDouble
21 typedef HRESULT (WINAPI* PropVariantToDoubleFunction)
22 (REFPROPVARIANT propvarIn, DOUBLE *pdblRet);
23
24 class CONTENT_EXPORT Win7LocationApi {
25 public:
26 virtual ~Win7LocationApi();
27 // Attempts to load propsys.dll, initialise |location_| and requests the user
28 // for access to location information. Creates and returns ownership of an
29 // instance of Win7LocationApi if all succeed.
30 static Win7LocationApi* Create();
31 static Win7LocationApi* CreateForTesting(
32 PropVariantToDoubleFunction PropVariantToDouble_function,
33 ILocation* locator);
34 // Gives the best available position.
35 // Returns false if no valid position is available.
36 virtual void GetPosition(Geoposition* position);
37 // Changes the "accuracy" needed. Affects power levels of devices.
38 virtual bool SetHighAccuracy(bool acc);
39
40 protected:
41 Win7LocationApi();
42
43 private:
44 void Init(HINSTANCE prop_library,
45 PropVariantToDoubleFunction PropVariantToDouble_function,
46 ILocation* locator);
47
48 // Provides the best position fix if one is available.
49 // Does this by requesting a location report and querying it to obtain
50 // location information.
51 virtual bool GetPositionIfFixed(Geoposition* position);
52
53 // ILocation object that lets us communicate with the Location and
54 // Sensors platform.
55 CComPtr<ILocation> locator_;
56 // Holds the opened propsys.dll library that is passed on construction.
57 // This class is responsible for closing it.
58 HINSTANCE prop_lib_;
59 PropVariantToDoubleFunction PropVariantToDouble_function_;
60
61 DISALLOW_COPY_AND_ASSIGN(Win7LocationApi);
62 };
63
64 } // namespace content
65
66 #endif // CONTENT_BROWSER_GEOLOCATION_WIN7_LOCATION_API_WIN_H_
OLDNEW
« no previous file with comments | « content/browser/geolocation/win7_location_api_unittest_win.cc ('k') | content/browser/geolocation/win7_location_api_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698