mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-16 20:20:51 +01:00
Mac: Fix 10.6 SDK compile errors due to delegate protocol requirement.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@287 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
44946a7752
commit
a412f079d7
@ -40,9 +40,13 @@
|
|||||||
// Use the existing CrAppProtocol definition.
|
// Use the existing CrAppProtocol definition.
|
||||||
#include "base/message_pump_mac.h"
|
#include "base/message_pump_mac.h"
|
||||||
|
|
||||||
|
// Use the existing empty protocol definitions.
|
||||||
|
#import "base/mac/cocoa_protocols.h"
|
||||||
|
|
||||||
#else // BUILDING_CEF_SHARED
|
#else // BUILDING_CEF_SHARED
|
||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
// Copy of CrAppProtocol definition from base/message_pump_mac.h.
|
// Copy of CrAppProtocol definition from base/message_pump_mac.h.
|
||||||
@protocol CrAppProtocol
|
@protocol CrAppProtocol
|
||||||
@ -50,6 +54,40 @@
|
|||||||
- (BOOL)isHandlingSendEvent;
|
- (BOOL)isHandlingSendEvent;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// The Mac OS X 10.6 SDK introduced new protocols used for delegates. These
|
||||||
|
// protocol defintions were not present in earlier releases of the Mac OS X
|
||||||
|
// SDK. In order to support building against the new SDK, which requires
|
||||||
|
// delegates to conform to these protocols, and earlier SDKs, which do not
|
||||||
|
// define these protocols at all, this file will provide empty protocol
|
||||||
|
// definitions when used with earlier SDK versions.
|
||||||
|
|
||||||
|
#if !defined(MAC_OS_X_VERSION_10_6) || \
|
||||||
|
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
|
||||||
|
|
||||||
|
#define DEFINE_EMPTY_PROTOCOL(p) \
|
||||||
|
@protocol p \
|
||||||
|
@end
|
||||||
|
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSAlertDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSApplicationDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSControlTextEditingDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSMatrixDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSMenuDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSOpenSavePanelDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSOutlineViewDataSource)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSOutlineViewDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSSpeechSynthesizerDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSSplitViewDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSTableViewDataSource)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSTableViewDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSTextFieldDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSTextViewDelegate)
|
||||||
|
DEFINE_EMPTY_PROTOCOL(NSWindowDelegate)
|
||||||
|
|
||||||
|
#undef DEFINE_EMPTY_PROTOCOL
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // BUILDING_CEF_SHARED
|
#endif // BUILDING_CEF_SHARED
|
||||||
|
|
||||||
// All CEF client applications must subclass NSApplication and implement this
|
// All CEF client applications must subclass NSApplication and implement this
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
#import "base/mac/cocoa_protocols.h"
|
||||||
#include "base/memory/scoped_nsobject.h"
|
#include "base/memory/scoped_nsobject.h"
|
||||||
|
|
||||||
class CefBrowserImpl;
|
class CefBrowserImpl;
|
||||||
@ -13,7 +14,7 @@ struct WebDropData;
|
|||||||
// A view to wrap the WebCore view and help it live in a Cocoa world. The
|
// A view to wrap the WebCore view and help it live in a Cocoa world. The
|
||||||
// (rough) equivalent of Apple's WebView.
|
// (rough) equivalent of Apple's WebView.
|
||||||
|
|
||||||
@interface BrowserWebView : NSView {
|
@interface BrowserWebView : NSView <NSMenuDelegate> {
|
||||||
@private
|
@private
|
||||||
CefBrowserImpl *browser_; // weak
|
CefBrowserImpl *browser_; // weak
|
||||||
NSTrackingArea *trackingArea_;
|
NSTrackingArea *trackingArea_;
|
||||||
|
@ -58,7 +58,7 @@ static NSAutoreleasePool* g_autopool = nil;
|
|||||||
|
|
||||||
// Receives notifications from controls and the browser window. Will delete
|
// Receives notifications from controls and the browser window. Will delete
|
||||||
// itself when done.
|
// itself when done.
|
||||||
@interface ClientWindowDelegate : NSObject
|
@interface ClientWindowDelegate : NSObject <NSWindowDelegate>
|
||||||
- (IBAction)goBack:(id)sender;
|
- (IBAction)goBack:(id)sender;
|
||||||
- (IBAction)goForward:(id)sender;
|
- (IBAction)goForward:(id)sender;
|
||||||
- (IBAction)reload:(id)sender;
|
- (IBAction)reload:(id)sender;
|
||||||
@ -286,7 +286,7 @@ NSButton* MakeButton(NSRect* rect, NSString* title, NSView* parent) {
|
|||||||
[menubar addItem:testItem];
|
[menubar addItem:testItem];
|
||||||
|
|
||||||
// Create the delegate for control and browser window events.
|
// Create the delegate for control and browser window events.
|
||||||
NSObject* delegate = [[ClientWindowDelegate alloc] init];
|
ClientWindowDelegate* delegate = [[ClientWindowDelegate alloc] init];
|
||||||
|
|
||||||
// Create the main application window.
|
// Create the main application window.
|
||||||
NSRect screen_rect = [[NSScreen mainScreen] visibleFrame];
|
NSRect screen_rect = [[NSScreen mainScreen] visibleFrame];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user