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 "device/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_macros.h" |
17 #include "base/strings/sys_string_conversions.h" | 17 #include "base/strings/sys_string_conversions.h" |
18 | 18 |
19 // Define a subset of the CoreWLAN interfaces we require. We can't depend on | 19 // Define a subset of the CoreWLAN interfaces we require. We can't depend on |
20 // CoreWLAN.h existing as we need to build on 10.5 SDKs. We can't just send | 20 // CoreWLAN.h existing as we need to build on 10.5 SDKs. We can't just send |
21 // messages to an untyped id due to the build treating warnings as errors, | 21 // messages to an untyped id due to the build treating warnings as errors, |
22 // hence the reason we need class definitions. | 22 // hence the reason we need class definitions. |
23 // TODO(joth): When we build all 10.6 code exclusively 10.6 SDK (or later) | 23 // TODO(joth): When we build all 10.6 code exclusively 10.6 SDK (or later) |
24 // tidy this up to use the framework directly. See http://crbug.com/37703 | 24 // tidy this up to use the framework directly. See http://crbug.com/37703 |
25 | 25 |
26 @interface CWInterface : NSObject | 26 @interface CWInterface : NSObject |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 device |
OLD | NEW |