summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-07 00:58:52 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-07 00:58:52 +0000
commit2f301674e584da1a4e6ba03178c29047a01d91bf (patch)
treed95078a714f0fa9e233491642f42b50dcdc01d50
parent8dc56d0f6ed6e59c93b20ef0d4cec99e411ed050 (diff)
downloadchromium_src-2f301674e584da1a4e6ba03178c29047a01d91bf.zip
chromium_src-2f301674e584da1a4e6ba03178c29047a01d91bf.tar.gz
chromium_src-2f301674e584da1a4e6ba03178c29047a01d91bf.tar.bz2
Consolidate SDK forwards in sdk_forward_declarations.h.
BUG=none TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/322623002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275578 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--apps/app_shim/chrome_main_app_mode_mac.mm11
-rw-r--r--base/mac/mac_util.mm11
-rw-r--r--base/mac/sdk_forward_declarations.h152
-rw-r--r--chrome/browser/app_controller_mac.mm1
-rw-r--r--chrome/browser/download/download_status_updater_mac.mm38
-rw-r--r--chrome/browser/fullscreen_mac.mm11
-rw-r--r--chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm14
-rw-r--r--chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm16
-rw-r--r--chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm10
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm23
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm9
-rw-r--r--chrome/browser/ui/cocoa/framed_browser_window.mm17
-rw-r--r--chrome/browser/ui/cocoa/nsview_additions.mm22
-rw-r--r--components/storage_monitor/image_capture_device_manager_unittest.mm14
-rw-r--r--components/wifi/wifi_service_mac.mm30
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac.mm17
-rw-r--r--content/browser/renderer_host/render_widget_host_view_mac_unittest.mm20
-rw-r--r--content/browser/theme_helper_mac.mm5
-rw-r--r--content/common/cursors/webcursor_mac.mm11
-rw-r--r--content/shell/browser/shell_mac.mm11
-rw-r--r--device/bluetooth/bluetooth_adapter_mac.mm21
-rw-r--r--device/bluetooth/bluetooth_device_mac.mm15
-rw-r--r--device/bluetooth/bluetooth_profile_mac.mm11
-rw-r--r--ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm23
-rw-r--r--ui/message_center/cocoa/popup_controller.mm7
25 files changed, 175 insertions, 345 deletions
diff --git a/apps/app_shim/chrome_main_app_mode_mac.mm b/apps/app_shim/chrome_main_app_mode_mac.mm
index b033916..1092142 100644
--- a/apps/app_shim/chrome_main_app_mode_mac.mm
+++ b/apps/app_shim/chrome_main_app_mode_mac.mm
@@ -23,6 +23,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/message_loop/message_loop.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
@@ -39,16 +40,6 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/l10n/l10n_util.h"
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSApplication (LionSDKDeclarations)
-- (void)disableRelaunchOnLogin;
-@end
-
-#endif // MAC_OS_X_VERSION_10_7
-
namespace {
// Timeout in seconds to wait for a reply for the initial Apple Event. Note that
diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm
index c256599..5f08a44 100644
--- a/base/mac/mac_util.mm
+++ b/base/mac/mac_util.mm
@@ -20,6 +20,7 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_ioobject.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/sys_string_conversions.h"
@@ -27,16 +28,6 @@
namespace base {
namespace mac {
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-enum {
- NSApplicationPresentationFullScreen = 1 << 10
-};
-
-#endif // MAC_OS_X_VERSION_10_7
-
namespace {
// The current count of outstanding requests for full screen mode from browser
diff --git a/base/mac/sdk_forward_declarations.h b/base/mac/sdk_forward_declarations.h
index c72d320..1148e36 100644
--- a/base/mac/sdk_forward_declarations.h
+++ b/base/mac/sdk_forward_declarations.h
@@ -12,6 +12,11 @@
#define BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
#import <AppKit/AppKit.h>
+#import <CoreWLAN/CoreWLAN.h>
+#import <ImageCaptureCore/ImageCaptureCore.h>
+#import <IOBluetooth/objc/IOBluetoothDevice.h>
+#import <IOBluetooth/objc/IOBluetoothDeviceInquiry.h>
+#import <IOBluetooth/objc/IOBluetoothHostController.h>
#if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
@@ -27,6 +32,19 @@ enum {
typedef NSUInteger NSEventPhase;
enum {
+ NSFullScreenWindowMask = 1 << 14,
+};
+
+enum {
+ NSApplicationPresentationFullScreen = 1 << 10,
+};
+
+enum {
+ NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
+ NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8,
+};
+
+enum {
NSEventSwipeTrackingLockDirection = 0x1 << 0,
NSEventSwipeTrackingClampGestureAmount = 0x1 << 1,
};
@@ -41,6 +59,12 @@ enum {
};
typedef NSInteger NSWindowAnimationBehavior;
+enum {
+ NSWindowDocumentVersionsButton = 6,
+ NSWindowFullScreenButton,
+};
+typedef NSUInteger NSWindowButton;
+
@interface NSEvent (LionSDK)
+ (BOOL)isSwipeTrackingFromScrollEventsEnabled;
@@ -60,7 +84,11 @@ typedef NSInteger NSWindowAnimationBehavior;
@end
-@interface CALayer (LionAPI)
+@interface NSApplication (LionSDK)
+- (void)disableRelaunchOnLogin;
+@end
+
+@interface CALayer (LionSDK)
- (CGFloat)contentsScale;
- (void)setContentsScale:(CGFloat)contentsScale;
@end
@@ -74,6 +102,12 @@ typedef NSInteger NSWindowAnimationBehavior;
- (CGFloat)backingScaleFactor;
- (NSWindowAnimationBehavior)animationBehavior;
- (void)setAnimationBehavior:(NSWindowAnimationBehavior)newAnimationBehavior;
+- (void)toggleFullScreen:(id)sender;
+- (void)setRestorable:(BOOL)flag;
+@end
+
+@interface NSCursor (LionSDKDeclarations)
++ (NSCursor*)IBeamCursorForVerticalLayout;
@end
@interface NSAnimationContext (LionSDK)
@@ -81,13 +115,129 @@ typedef NSInteger NSWindowAnimationBehavior;
completionHandler:(void (^)(void))completionHandler;
@end
+@interface NSView (LionSDK)
+- (NSSize)convertSizeFromBacking:(NSSize)size;
+- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
+@end
+
+@interface NSObject (ICCameraDeviceDelegateLionSDK)
+- (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device;
+- (void)didDownloadFile:(ICCameraFile*)file
+ error:(NSError*)error
+ options:(NSDictionary*)options
+ contextInfo:(void*)contextInfo;
+@end
+
+@interface NSScroller (LionSDK)
++ (NSInteger)preferredScrollerStyle;
+@end
+
+@interface CWInterface (LionSDK)
+- (BOOL)associateToNetwork:(CWNetwork*)network
+ password:(NSString*)password
+ error:(NSError**)error;
+- (NSSet*)scanForNetworksWithName:(NSString*)networkName
+ error:(NSError**)error;
+@end
+
+enum CWChannelBand {
+ kCWChannelBandUnknown = 0,
+ kCWChannelBand2GHz = 1,
+ kCWChannelBand5GHz = 2,
+};
+
+@interface CWChannel : NSObject
+@property(readonly) CWChannelBand channelBand;
+@end
+
+@interface CWNetwork (LionSDK)
+@property(readonly) CWChannel* wlanChannel;
+@end
+
+@interface IOBluetoothHostController (LionSDK)
+- (NSString*)nameAsString;
+- (BluetoothHCIPowerState)powerState;
+@end
+
+@protocol IOBluetoothDeviceInquiryDelegate
+- (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry*)sender;
+- (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender
+ device:(IOBluetoothDevice*)device;
+- (void)deviceInquiryComplete:(IOBluetoothDeviceInquiry*)sender
+ error:(IOReturn)error
+ aborted:(BOOL)aborted;
+@end
+
+@interface IOBluetoothDevice (LionSDK)
+- (NSString*)addressString;
+- (unsigned int)classOfDevice;
+- (BluetoothConnectionHandle)connectionHandle;
+- (BluetoothHCIRSSIValue)rawRSSI;
+- (NSArray*)services;
+- (IOReturn)performSDPQuery:(id)target uuids:(NSArray*)uuids;
+@end
+
#endif // MAC_OS_X_VERSION_10_7
+
#if !defined(MAC_OS_X_VERSION_10_8) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
+
enum {
NSEventPhaseMayBegin = 0x1 << 5
};
+
#endif // MAC_OS_X_VERSION_10_8
+
+#if !defined(MAC_OS_X_VERSION_10_9) || \
+ MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
+
+// NSProgress is public API in 10.9, but a version of it exists and is usable
+// in 10.8.
+
+@interface NSProgress : NSObject
+
+- (instancetype)initWithParent:(NSProgress*)parentProgressOrNil
+ userInfo:(NSDictionary*)userInfoOrNil;
+@property (copy) NSString* kind;
+
+@property int64_t totalUnitCount;
+@property int64_t completedUnitCount;
+
+@property (getter=isCancellable) BOOL cancellable;
+@property (getter=isPausable) BOOL pausable;
+@property (readonly, getter=isCancelled) BOOL cancelled;
+@property (readonly, getter=isPaused) BOOL paused;
+@property (copy) void (^cancellationHandler)(void);
+@property (copy) void (^pausingHandler)(void);
+- (void)cancel;
+- (void)pause;
+
+- (void)setUserInfoObject:(id)objectOrNil forKey:(NSString*)key;
+- (NSDictionary*)userInfo;
+
+@property (readonly, getter=isIndeterminate) BOOL indeterminate;
+@property (readonly) double fractionCompleted;
+
+- (void)publish;
+- (void)unpublish;
+
+@end
+
+@interface NSView (MavericksSDK)
+- (void)setCanDrawSubviewsIntoLayer:(BOOL)flag;
+@end
+
+enum {
+ NSWindowOcclusionStateVisible = 1UL << 1,
+};
+typedef NSUInteger NSWindowOcclusionState;
+
+@interface NSWindow (MavericksSDK)
+- (NSWindowOcclusionState)occlusionState;
+@end
+
+#endif // MAC_OS_X_VERSION_10_9
+
#endif // BASE_MAC_SDK_FORWARD_DECLARATIONS_H_
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index fbb694b..c99bf13 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -12,6 +12,7 @@
#include "base/files/file_path.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/message_loop/message_loop.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
diff --git a/chrome/browser/download/download_status_updater_mac.mm b/chrome/browser/download/download_status_updater_mac.mm
index dedb3a0..cbed5cd 100644
--- a/chrome/browser/download/download_status_updater_mac.mm
+++ b/chrome/browser/download/download_status_updater_mac.mm
@@ -6,49 +6,13 @@
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/sys_string_conversions.h"
#include "base/supports_user_data.h"
#import "chrome/browser/ui/cocoa/dock_icon.h"
#include "content/public/browser/download_item.h"
#include "url/gurl.h"
-// NSProgress is public API in 10.9, but a version of it exists and is usable
-// in 10.8.
-
-#if !defined(MAC_OS_X_VERSION_10_9) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
-
-@interface NSProgress : NSObject
-
-- (instancetype)initWithParent:(NSProgress*)parentProgressOrNil
- userInfo:(NSDictionary*)userInfoOrNil;
-@property (copy) NSString* kind;
-
-@property int64_t totalUnitCount;
-@property int64_t completedUnitCount;
-
-@property (getter=isCancellable) BOOL cancellable;
-@property (getter=isPausable) BOOL pausable;
-@property (readonly, getter=isCancelled) BOOL cancelled;
-@property (readonly, getter=isPaused) BOOL paused;
-@property (copy) void (^cancellationHandler)(void);
-@property (copy) void (^pausingHandler)(void);
-- (void)cancel;
-- (void)pause;
-
-- (void)setUserInfoObject:(id)objectOrNil forKey:(NSString*)key;
-- (NSDictionary*)userInfo;
-
-@property (readonly, getter=isIndeterminate) BOOL indeterminate;
-@property (readonly) double fractionCompleted;
-
-- (void)publish;
-- (void)unpublish;
-
-@end
-
-#endif // MAC_OS_X_VERSION_10_9
-
namespace {
// These are not the keys themselves; they are the names for dynamic lookup via
diff --git a/chrome/browser/fullscreen_mac.mm b/chrome/browser/fullscreen_mac.mm
index 2d28360..7343dcf 100644
--- a/chrome/browser/fullscreen_mac.mm
+++ b/chrome/browser/fullscreen_mac.mm
@@ -8,18 +8,9 @@
#include "base/command_line.h"
#include "base/mac/mac_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "chrome/common/chrome_switches.h"
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-enum {
- NSApplicationPresentationFullScreen = 1 << 10
-};
-
-#endif // MAC_OS_X_VERSION_10_7
-
bool IsFullScreenMode() {
// Check if the main display has been captured (by games in particular).
if (CGDisplayIsCaptured(CGMainDisplayID()))
diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
index d4d3f17..17c23ad 100644
--- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
+++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm
@@ -11,6 +11,7 @@
#include "base/mac/cocoa_protocols.h"
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
@@ -24,19 +25,6 @@
#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSObject (ICCameraDeviceDelegateLionAPI)
-- (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device;
-- (void)didDownloadFile:(ICCameraFile*)file
- error:(NSError*)error
- options:(NSDictionary*)options
- contextInfo:(void*)contextInfo;
-@end
-
-#endif // 10.6
-
namespace {
const char kDeviceId[] = "id";
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
index e9d72be..a4ad4ea 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/mac/foundation_util.h"
#include "base/mac/mac_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_utils.h"
@@ -49,21 +50,6 @@ using apps::AppWindow;
- (BOOL)_isTitleHidden;
@end
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSWindow (LionSDKDeclarations)
-- (void)toggleFullScreen:(id)sender;
-@end
-
-enum {
- NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
- NSFullScreenWindowMask = 1 << 14
-};
-
-#endif // MAC_OS_X_VERSION_10_7
-
namespace {
void SetFullScreenCollectionBehavior(NSWindow* window, bool allow_fullscreen) {
diff --git a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
index cc9d793..66edc38 100644
--- a/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
+++ b/chrome/browser/ui/cocoa/apps/native_app_window_cocoa_browsertest.mm
@@ -8,6 +8,7 @@
#include "apps/app_window_registry.h"
#include "base/mac/mac_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "chrome/browser/apps/app_browsertest_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/extensions/application_launch.h"
@@ -119,15 +120,6 @@ IN_PROC_BROWSER_TEST_F(NativeAppWindowCocoaBrowserTest, HideShowWithApp) {
#if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-@interface NSWindow (LionSDKDeclarations)
-- (void)toggleFullScreen:(id)sender;
-@end
-
-enum {
- NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
- NSFullScreenWindowMask = 1 << 14
-};
-
NSString* const NSWindowDidEnterFullScreenNotification =
@"NSWindowDidEnterFullScreenNotification";
NSString* const NSWindowDidExitFullScreenNotification =
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index ddf09420..93e7e8b 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -186,25 +186,6 @@ using web_modal::WebContentsModalDialogManager;
@end
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-enum {
- NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
- NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8
-};
-
-enum {
- NSFullScreenWindowMask = 1 << 14
-};
-
-@interface NSWindow (LionSDKDeclarations)
-- (void)setRestorable:(BOOL)flag;
-@end
-
-#endif // MAC_OS_X_VERSION_10_7
-
@implementation BrowserWindowController
+ (BrowserWindowController*)browserWindowControllerForWindow:(NSWindow*)window {
@@ -1047,7 +1028,7 @@ enum {
// does not display the bookmark bar itself.
if (tag == IDC_SHOW_BOOKMARK_BAR) {
bool toggled = windowShim_->IsBookmarkBarVisible();
- NSInteger oldState = [item state];
+ NSInteger oldState = [(NSMenuItem*)item state];
NSInteger newState = toggled ? NSOnState : NSOffState;
if (oldState != newState)
[item setState:newState];
@@ -1069,7 +1050,7 @@ enum {
const std::string encoding = current_tab->GetEncoding();
bool toggled = encoding_controller.IsItemChecked(profile, encoding, tag);
- NSInteger oldState = [item state];
+ NSInteger oldState = [(NSMenuItem*)item state];
NSInteger newState = toggled ? NSOnState : NSOffState;
if (oldState != newState)
[item setState:newState];
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
index e75d5dc..7ba3a71 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_browsertest.mm
@@ -5,6 +5,7 @@
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "base/mac/mac_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
@@ -38,14 +39,6 @@
namespace {
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-enum {
- NSWindowDocumentVersionsButton = 6,
- NSWindowFullScreenButton
-};
-#endif // MAC_OS_X_VERSION_10_7
-
void CreateProfileCallback(const base::Closure& quit_closure,
Profile* profile,
Profile::CreateStatus status) {
diff --git a/chrome/browser/ui/cocoa/framed_browser_window.mm b/chrome/browser/ui/cocoa/framed_browser_window.mm
index 7caaf7f..0989b6a 100644
--- a/chrome/browser/ui/cocoa/framed_browser_window.mm
+++ b/chrome/browser/ui/cocoa/framed_browser_window.mm
@@ -5,6 +5,7 @@
#import "chrome/browser/ui/cocoa/framed_browser_window.h"
#include "base/logging.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "chrome/browser/global_keyboard_shortcuts_mac.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
@@ -18,22 +19,6 @@
#include "grit/theme_resources.h"
#include "ui/base/cocoa/nsgraphics_context_additions.h"
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSWindow (LionSDKDeclarations)
-- (void)toggleFullScreen:(id)sender;
-@end
-
-enum {
- NSWindowDocumentVersionsButton = 6,
- NSWindowFullScreenButton
-};
-
-#endif // MAC_OS_X_VERSION_10_7
-
-
// Implementer's note: Moving the window controls is tricky. When altering the
// code, ensure that:
// - accessibility hit testing works
diff --git a/chrome/browser/ui/cocoa/nsview_additions.mm b/chrome/browser/ui/cocoa/nsview_additions.mm
index 6d8ed4b..38e6e94 100644
--- a/chrome/browser/ui/cocoa/nsview_additions.mm
+++ b/chrome/browser/ui/cocoa/nsview_additions.mm
@@ -4,6 +4,7 @@
#include "base/command_line.h"
#include "base/mac/mac_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#import "chrome/browser/ui/cocoa/nsview_additions.h"
#include "chrome/common/chrome_switches.h"
#include "ui/base/ui_base_switches.h"
@@ -11,27 +12,6 @@
#include "base/logging.h"
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSView (LionAPI)
-- (NSSize)convertSizeFromBacking:(NSSize)size;
-@end
-
-#endif // 10.7
-
-// Replicate specific 10.9 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_9) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
-
-@interface NSView (MavericksAPI)
-// Flatten all child views that did not call setWantsLayer:YES into this
-// view's CALayer.
-- (void)setCanDrawSubviewsIntoLayer:(BOOL)flag;
-@end
-
-#endif // MAC_OS_X_VERSION_10_9
-
@implementation NSView (ChromeAdditions)
- (CGFloat)cr_lineWidth {
diff --git a/components/storage_monitor/image_capture_device_manager_unittest.mm b/components/storage_monitor/image_capture_device_manager_unittest.mm
index 5bdd830..d5b877fa 100644
--- a/components/storage_monitor/image_capture_device_manager_unittest.mm
+++ b/components/storage_monitor/image_capture_device_manager_unittest.mm
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/mac/foundation_util.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "components/storage_monitor/image_capture_device.h"
@@ -18,19 +19,6 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h"
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSObject (ICCameraDeviceDelegateLionAPI)
-- (void)deviceDidBecomeReadyWithCompleteContentCatalog:(ICDevice*)device;
-- (void)didDownloadFile:(ICCameraFile*)file
- error:(NSError*)error
- options:(NSDictionary*)options
- contextInfo:(void*)contextInfo;
-@end
-
-#endif // 10.6
-
namespace {
const char kDeviceId[] = "id";
diff --git a/components/wifi/wifi_service_mac.mm b/components/wifi/wifi_service_mac.mm
index dc57043..837f21d 100644
--- a/components/wifi/wifi_service_mac.mm
+++ b/components/wifi/wifi_service_mac.mm
@@ -12,40 +12,12 @@
#include "base/mac/foundation_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "components/onc/onc_constants.h"
#include "components/wifi/network_properties.h"
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-// Local definitions of API added in Mac OS X 10.7
-
-@interface CWInterface (LionAPI)
-- (BOOL)associateToNetwork:(CWNetwork*)network
- password:(NSString*)password
- error:(NSError**)error;
-- (NSSet*)scanForNetworksWithName:(NSString*)networkName
- error:(NSError**)error;
-@end
-
-enum CWChannelBand {
- kCWChannelBandUnknown = 0,
- kCWChannelBand2GHz = 1,
- kCWChannelBand5GHz = 2,
-};
-
-@interface CWChannel : NSObject
-@property(readonly) CWChannelBand channelBand;
-@end
-
-@interface CWNetwork (LionAPI)
-@property(readonly) CWChannel* wlanChannel;
-@end
-
-#endif // 10.7
-
namespace wifi {
// Implementation of WiFiService for Mac OS X.
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index f58be34..f5868fd 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -103,29 +103,12 @@ using blink::WebGestureEvent;
// Declare things that are part of the 10.7 SDK.
#if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-@interface NSView (NSOpenGLSurfaceResolutionLionAPI)
-- (void)setWantsBestResolutionOpenGLSurface:(BOOL)flag;
-@end
static NSString* const NSWindowDidChangeBackingPropertiesNotification =
@"NSWindowDidChangeBackingPropertiesNotification";
#endif // 10.7
-// Declare things that are part of the 10.9 SDK.
-#if !defined(MAC_OS_X_VERSION_10_9) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_9
-enum {
- NSWindowOcclusionStateVisible = 1UL << 1,
-};
-typedef NSUInteger NSWindowOcclusionState;
-
-@interface NSWindow (MavericksAPI)
-- (NSWindowOcclusionState)occlusionState;
-@end
-
-#endif // 10.9
-
// This method will return YES for OS X versions 10.7.3 and later, and NO
// otherwise.
// Used to prevent a crash when building with the 10.7 SDK and accessing the
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index 975e625..da766ea 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -6,6 +6,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_nsautorelease_pool.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/utf_string_conversions.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
@@ -23,25 +24,6 @@
#include "ui/events/test/cocoa_test_event_utils.h"
#import "ui/gfx/test/ui_cocoa_test_helper.h"
-// Declare things that are part of the 10.7 SDK.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-enum {
- NSEventPhaseNone = 0, // event not associated with a phase.
- NSEventPhaseBegan = 0x1 << 0,
- NSEventPhaseStationary = 0x1 << 1,
- NSEventPhaseChanged = 0x1 << 2,
- NSEventPhaseEnded = 0x1 << 3,
- NSEventPhaseCancelled = 0x1 << 4,
-};
-typedef NSUInteger NSEventPhase;
-
-@interface NSEvent (LionAPI)
-- (NSEventPhase)phase;
-@end
-
-#endif // 10.7
-
// Helper class with methods used to mock -[NSEvent phase], used by
// |MockScrollWheelEventWithPhase()|.
@interface MockPhaseMethods : NSObject {
diff --git a/content/browser/theme_helper_mac.mm b/content/browser/theme_helper_mac.mm
index 34e9082..9f0f86d 100644
--- a/content/browser/theme_helper_mac.mm
+++ b/content/browser/theme_helper_mac.mm
@@ -7,6 +7,7 @@
#import <Cocoa/Cocoa.h>
#include "base/command_line.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -17,12 +18,10 @@
// Declare notification names from the 10.7 SDK.
#if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+
NSString* NSPreferredScrollerStyleDidChangeNotification =
@"NSPreferredScrollerStyleDidChangeNotification";
-@interface NSScroller (LionSDK)
-+ (NSInteger)preferredScrollerStyle;
-@end
#endif
@interface ScrollbarPrefsObserver : NSObject
diff --git a/content/common/cursors/webcursor_mac.mm b/content/common/cursors/webcursor_mac.mm
index d32d8b7..6a40132 100644
--- a/content/common/cursors/webcursor_mac.mm
+++ b/content/common/cursors/webcursor_mac.mm
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "content/public/common/content_client.h"
#include "grit/webkit_resources.h"
#include "skia/ext/skia_utils_mac.h"
@@ -22,16 +23,6 @@
using blink::WebCursorInfo;
using blink::WebSize;
-// Declare symbols that are part of the 10.7 SDK.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface NSCursor (LionSDKDeclarations)
-+ (NSCursor*)IBeamCursorForVerticalLayout;
-@end
-
-#endif // MAC_OS_X_VERSION_10_7
-
// Private interface to CoreCursor, as of Mac OS X 10.7. This is essentially the
// implementation of WKCursor in WebKitSystemInterface.
diff --git a/content/shell/browser/shell_mac.mm b/content/shell/browser/shell_mac.mm
index 5e48f26..1c5ecb1 100644
--- a/content/shell/browser/shell_mac.mm
+++ b/content/shell/browser/shell_mac.mm
@@ -8,6 +8,7 @@
#include "base/logging.h"
#import "base/mac/scoped_nsobject.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/string_piece.h"
#include "base/strings/sys_string_conversions.h"
#include "content/public/browser/native_web_keyboard_event.h"
@@ -16,16 +17,6 @@
#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
#include "url/gurl.h"
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-enum {
- NSWindowCollectionBehaviorFullScreenPrimary = 1 << 7,
- NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8
-};
-
-#endif // MAC_OS_X_VERSION_10_7
-
// Receives notification that the window is closing so that it can start the
// tear-down process. Is responsible for deleting itself when done.
@interface ContentShellWindowDelegate : NSObject<NSWindowDelegate> {
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 6fb2b44..4ae7910 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -14,6 +14,7 @@
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/location.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/memory/scoped_ptr.h"
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
@@ -24,26 +25,6 @@
#include "device/bluetooth/bluetooth_socket_mac.h"
#include "device/bluetooth/bluetooth_uuid.h"
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
-MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface IOBluetoothHostController (LionSDKDeclarations)
-- (NSString*)nameAsString;
-- (BluetoothHCIPowerState)powerState;
-@end
-
-@protocol IOBluetoothDeviceInquiryDelegate
-- (void)deviceInquiryStarted:(IOBluetoothDeviceInquiry*)sender;
-- (void)deviceInquiryDeviceFound:(IOBluetoothDeviceInquiry*)sender
- device:(IOBluetoothDevice*)device;
-- (void)deviceInquiryComplete:(IOBluetoothDeviceInquiry*)sender
- error:(IOReturn)error
- aborted:(BOOL)aborted;
-@end
-
-#endif // MAC_OS_X_VERSION_10_7
-
@interface BluetoothAdapterMacDelegate
: NSObject <IOBluetoothDeviceInquiryDelegate> {
@private
diff --git a/device/bluetooth/bluetooth_device_mac.mm b/device/bluetooth/bluetooth_device_mac.mm
index 60574b0..1baa514 100644
--- a/device/bluetooth/bluetooth_device_mac.mm
+++ b/device/bluetooth/bluetooth_device_mac.mm
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/hash.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -17,20 +18,6 @@
#include "device/bluetooth/bluetooth_socket_mac.h"
#include "device/bluetooth/bluetooth_uuid.h"
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface IOBluetoothDevice (LionSDKDeclarations)
-- (NSString*)addressString;
-- (unsigned int)classOfDevice;
-- (BluetoothConnectionHandle)connectionHandle;
-- (BluetoothHCIRSSIValue)rawRSSI;
-- (NSArray*)services;
-@end
-
-#endif // MAC_OS_X_VERSION_10_7
-
// Undocumented API for accessing the Bluetooth transmit power level.
// Similar to the API defined here [ http://goo.gl/20Q5vE ].
@interface IOBluetoothHostController (UndocumentedAPI)
diff --git a/device/bluetooth/bluetooth_profile_mac.mm b/device/bluetooth/bluetooth_profile_mac.mm
index 5ac6414..288239f 100644
--- a/device/bluetooth/bluetooth_profile_mac.mm
+++ b/device/bluetooth/bluetooth_profile_mac.mm
@@ -11,6 +11,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/mac/scoped_cftyperef.h"
+#include "base/mac/sdk_forward_declarations.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/sys_string_conversions.h"
@@ -18,16 +19,6 @@
#include "device/bluetooth/bluetooth_device_mac.h"
#include "device/bluetooth/bluetooth_socket_mac.h"
-// Replicate specific 10.7 SDK declarations for building with prior SDKs.
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-@interface IOBluetoothDevice (LionSDKDeclarations)
-- (IOReturn)performSDPQuery:(id)target uuids:(NSArray*)uuids;
-@end
-
-#endif // MAC_OS_X_VERSION_10_7
-
namespace device {
namespace {
diff --git a/ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm b/ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm
index b8d2da8..b855ee0 100644
--- a/ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm
+++ b/ui/app_list/cocoa/scroll_view_with_no_scrollbars.mm
@@ -7,28 +7,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/mac/scoped_nsobject.h"
-
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-
-enum {
- NSEventPhaseNone = 0,
- NSEventPhaseBegan = 0x1 << 0,
- NSEventPhaseStationary = 0x1 << 1,
- NSEventPhaseChanged = 0x1 << 2,
- NSEventPhaseEnded = 0x1 << 3,
- NSEventPhaseCancelled = 0x1 << 4,
-};
-typedef NSUInteger NSEventPhase;
-
-@interface NSEvent (LionAPI)
-
-- (NSEventPhase)momentumPhase;
-- (NSEventPhase)phase;
-
-@end
-
-#endif // 10.7
+#include "base/mac/sdk_forward_declarations.h"
@interface InvisibleScroller : NSScroller;
@end
diff --git a/ui/message_center/cocoa/popup_controller.mm b/ui/message_center/cocoa/popup_controller.mm
index 30badc7..0f22937 100644
--- a/ui/message_center/cocoa/popup_controller.mm
+++ b/ui/message_center/cocoa/popup_controller.mm
@@ -13,13 +13,6 @@
#import "ui/message_center/cocoa/popup_collection.h"
#include "ui/message_center/message_center.h"
-#if !defined(MAC_OS_X_VERSION_10_7) || \
- MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-enum {
- NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8
-};
-#endif // MAC_OS_X_VERSION_10_7
-
////////////////////////////////////////////////////////////////////////////////
@interface MCPopupController (Private)