OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Implements a WLAN API binding for CoreWLAN, as available on OSX 10.6 | 5 // Implements a WLAN API binding for CoreWLAN, as available on OSX 10.6 |
6 | 6 |
7 #include "device/geolocation/wifi_data_provider_mac.h" | 7 #include "content/browser/geolocation/wifi_data_provider_mac.h" |
8 | 8 |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #import <Foundation/Foundation.h> | 10 #import <Foundation/Foundation.h> |
11 #include <stdint.h> | 11 #include <stdint.h> |
12 | 12 |
13 #include "base/mac/scoped_nsautorelease_pool.h" | 13 #include "base/mac/scoped_nsautorelease_pool.h" |
14 #include "base/mac/scoped_nsobject.h" | 14 #include "base/mac/scoped_nsobject.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
17 #include "base/strings/sys_string_conversions.h" | 17 #include "base/strings/sys_string_conversions.h" |
(...skipping 21 matching lines...) Expand all Loading... |
39 @property (nonatomic, readonly) NSNumber* phyMode; | 39 @property (nonatomic, readonly) NSNumber* phyMode; |
40 @property (nonatomic, readonly) NSNumber* channel; | 40 @property (nonatomic, readonly) NSNumber* channel; |
41 @property (nonatomic, readonly) NSNumber* rssi; | 41 @property (nonatomic, readonly) NSNumber* rssi; |
42 @property (nonatomic, readonly) NSInteger rssiValue; | 42 @property (nonatomic, readonly) NSInteger rssiValue; |
43 @property (nonatomic, readonly) NSNumber* noise; | 43 @property (nonatomic, readonly) NSNumber* noise; |
44 @property (nonatomic, readonly) NSData* ieData; | 44 @property (nonatomic, readonly) NSData* ieData; |
45 @property (nonatomic, readonly) BOOL isIBSS; | 45 @property (nonatomic, readonly) BOOL isIBSS; |
46 - (BOOL)isEqualToNetwork:(CWNetwork*)network; | 46 - (BOOL)isEqualToNetwork:(CWNetwork*)network; |
47 @end | 47 @end |
48 | 48 |
49 namespace device { | 49 namespace content { |
50 | 50 |
51 class CoreWlanApi : public WifiDataProviderCommon::WlanApiInterface { | 51 class CoreWlanApi : public WifiDataProviderCommon::WlanApiInterface { |
52 public: | 52 public: |
53 CoreWlanApi() {} | 53 CoreWlanApi() {} |
54 | 54 |
55 // Must be called before any other interface method. Will return false if the | 55 // Must be called before any other interface method. Will return false if the |
56 // CoreWLAN framework cannot be initialized (e.g. running on pre-10.6 OSX), | 56 // CoreWLAN framework cannot be initialized (e.g. running on pre-10.6 OSX), |
57 // in which case no other method may be called. | 57 // in which case no other method may be called. |
58 bool Init(); | 58 bool Init(); |
59 | 59 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 WifiDataProviderCommon::WlanApiInterface* NewCoreWlanApi() { | 184 WifiDataProviderCommon::WlanApiInterface* NewCoreWlanApi() { |
185 std::unique_ptr<CoreWlanApi> self(new CoreWlanApi); | 185 std::unique_ptr<CoreWlanApi> self(new CoreWlanApi); |
186 if (self->Init()) | 186 if (self->Init()) |
187 return self.release(); | 187 return self.release(); |
188 | 188 |
189 return NULL; | 189 return NULL; |
190 } | 190 } |
191 | 191 |
192 } // namespace device | 192 } // namespace content |
OLD | NEW |