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

Unified Diff: base/mac/sdk_forward_declarations.h

Issue 530193004: Fix wifi_component build with 10.9+ SDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing comment after #endif Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/wifi/wifi_service_mac.mm » ('j') | components/wifi/wifi_service_mac.mm » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/sdk_forward_declarations.h
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h
index e8682caf6fa7ab0d51d801483d485c5bd8369757..57e63639b53e78aa768255fb6473f9c70086cd11 100644
--- a/base/mac/sdk_forward_declarations.h
+++ b/base/mac/sdk_forward_declarations.h
@@ -273,4 +273,52 @@ BASE_EXPORT extern "C" NSString* const NSUserActivityTypeBrowsingWeb;
#endif // MAC_OS_X_VERSION_10_10
+// 10.6 SDK don't have CWSecurity while 10.9 SDK don't have CWSecurityMode, to
+// build with SDKs from 10.6 to 10.9 we need to forward declare both and do
mef 2014/09/04 15:31:34 nit: I don't think we use 'we' in comments. :)
Jiang Jiang 2014/09/04 16:04:21 Done.
+// runtime checks to ensure we use correct methods on different OS X versions.
+#if !defined(MAC_OS_X_VERSION_10_9) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
+
+enum {
+ kCWSecurityNone = 0,
+ kCWSecurityWEP = 1,
+ kCWSecurityWPAPersonal = 2,
+ kCWSecurityWPAPersonalMixed = 3,
+ kCWSecurityWPA2Personal = 4,
+ kCWSecurityPersonal = 5,
+ kCWSecurityDynamicWEP = 6,
+ kCWSecurityWPAEnterprise = 7,
+ kCWSecurityWPAEnterpriseMixed = 8,
+ kCWSecurityWPA2Enterprise = 9,
+ kCWSecurityEnterprise = 10,
+ kCWSecurityUnknown = NSIntegerMax,
+};
+
+typedef NSInteger CWSecurity;
+
+@interface CWNetwork (ForwardDeclarations)
+@property(readonly) NSInteger rssiValue;
+- (BOOL)supportsSecurity:(CWSecurity)security;
+@end
+
+#else
+
+typedef enum {
+ kCWSecurityModeOpen = 0,
+ kCWSecurityModeWEP,
+ kCWSecurityModeWPA_PSK,
+ kCWSecurityModeWPA2_PSK,
+ kCWSecurityModeWPA_Enterprise,
+ kCWSecurityModeWPA2_Enterprise,
+ kCWSecurityModeWPS,
+ kCWSecurityModeDynamicWEP
+} CWSecurityMode;
+
+@interface CWNetwork (ForwardDeclarations)
+@property(readonly) NSNumber* rssi;
+@property(readonly) NSNumber* securityMode;
+@end
+
+#endif // MAC_OS_X_VERSION_10_9
+
#endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
« no previous file with comments | « no previous file | components/wifi/wifi_service_mac.mm » ('j') | components/wifi/wifi_service_mac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698