| 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 #ifndef BASE_COCOA_PROTOCOLS_MAC_H_ | 5 #ifndef BASE_COCOA_PROTOCOLS_MAC_H_ |
| 6 #define BASE_COCOA_PROTOCOLS_MAC_H_ | 6 #define BASE_COCOA_PROTOCOLS_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 // GTM also maintinas a list of empty protocols, but only the ones the library | 11 // GTM also maintinas a list of empty protocols, but only the ones the library |
| 12 // requires. Augment that below. | 12 // requires. Augment that below. |
| 13 #import "third_party/GTM/GTMDefines.h" | 13 #import "third_party/GTM/GTMDefines.h" |
| 14 | 14 |
| 15 // The Mac OS X 10.6 SDK introduced new protocols used for delegates. These | 15 // The Mac OS X 10.6 SDK introduced new protocols used for delegates. These |
| 16 // protocol defintions were not present in earlier releases of the Mac OS X | 16 // protocol defintions were not present in earlier releases of the Mac OS X |
| 17 // SDK. In order to support building against the new SDK, which requires | 17 // SDK. In order to support building against the new SDK, which requires |
| 18 // delegates to conform to these protocols, and earlier SDKs, which do not | 18 // delegates to conform to these protocols, and earlier SDKs, which do not |
| 19 // define these protocols at all, this file will provide empty protocol | 19 // define these protocols at all, this file will provide empty protocol |
| 20 // definitions when used with earlier SDK versions. | 20 // definitions when used with earlier SDK versions. |
| 21 | 21 |
| 22 #if !defined(MAC_OS_X_VERSION_10_6) || \ | |
| 23 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 | |
| 24 | |
| 25 #define DEFINE_EMPTY_PROTOCOL(p) \ | 22 #define DEFINE_EMPTY_PROTOCOL(p) \ |
| 26 @protocol p \ | 23 @protocol p \ |
| 27 @end | 24 @end |
| 28 | 25 |
| 26 #if !defined(MAC_OS_X_VERSION_10_6) || \ |
| 27 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 |
| 28 |
| 29 DEFINE_EMPTY_PROTOCOL(NSAlertDelegate) | 29 DEFINE_EMPTY_PROTOCOL(NSAlertDelegate) |
| 30 DEFINE_EMPTY_PROTOCOL(NSApplicationDelegate) | 30 DEFINE_EMPTY_PROTOCOL(NSApplicationDelegate) |
| 31 DEFINE_EMPTY_PROTOCOL(NSControlTextEditingDelegate) | 31 DEFINE_EMPTY_PROTOCOL(NSControlTextEditingDelegate) |
| 32 DEFINE_EMPTY_PROTOCOL(NSMatrixDelegate) | 32 DEFINE_EMPTY_PROTOCOL(NSMatrixDelegate) |
| 33 DEFINE_EMPTY_PROTOCOL(NSMenuDelegate) | 33 DEFINE_EMPTY_PROTOCOL(NSMenuDelegate) |
| 34 DEFINE_EMPTY_PROTOCOL(NSOpenSavePanelDelegate) | 34 DEFINE_EMPTY_PROTOCOL(NSOpenSavePanelDelegate) |
| 35 DEFINE_EMPTY_PROTOCOL(NSOutlineViewDataSource) | 35 DEFINE_EMPTY_PROTOCOL(NSOutlineViewDataSource) |
| 36 DEFINE_EMPTY_PROTOCOL(NSOutlineViewDelegate) | 36 DEFINE_EMPTY_PROTOCOL(NSOutlineViewDelegate) |
| 37 DEFINE_EMPTY_PROTOCOL(NSSpeechSynthesizerDelegate) | 37 DEFINE_EMPTY_PROTOCOL(NSSpeechSynthesizerDelegate) |
| 38 DEFINE_EMPTY_PROTOCOL(NSSplitViewDelegate) | 38 DEFINE_EMPTY_PROTOCOL(NSSplitViewDelegate) |
| 39 DEFINE_EMPTY_PROTOCOL(NSTableViewDataSource) | 39 DEFINE_EMPTY_PROTOCOL(NSTableViewDataSource) |
| 40 DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate) | 40 DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate) |
| 41 DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate) | 41 DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate) |
| 42 DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate) | 42 DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate) |
| 43 DEFINE_EMPTY_PROTOCOL(NSWindowDelegate) | 43 DEFINE_EMPTY_PROTOCOL(NSWindowDelegate) |
| 44 | 44 |
| 45 #endif // MAC_OS_X_VERSION_10_6 |
| 46 |
| 47 #if !defined(MAC_OS_X_VERSION_10_8) || \ |
| 48 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8 |
| 49 |
| 50 DEFINE_EMPTY_PROTOCOL(NSUserNotificationCenterDelegate) |
| 51 |
| 52 #endif // MAC_OS_X_VERSION_10_6 |
| 53 |
| 45 #undef DEFINE_EMPTY_PROTOCOL | 54 #undef DEFINE_EMPTY_PROTOCOL |
| 46 | 55 |
| 47 #endif | |
| 48 | |
| 49 #endif // BASE_COCOA_PROTOCOLS_MAC_H_ | 56 #endif // BASE_COCOA_PROTOCOLS_MAC_H_ |
| OLD | NEW |