Refactor ad hoc delegate methods into BrowserDelegate protocol.

This commit is contained in:
Corey Johnson
2012-02-29 17:30:50 -08:00
parent 670b9dc52d
commit 569bed9ee1
4 changed files with 18 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
#import "BrowserDelegate.h"
#import "include/cef.h"
#import "include/cef_application_mac.h"
@@ -5,7 +6,7 @@ class ClientHandler;
@class AtomController;
@interface Atom : NSApplication<CefAppProtocol> {
@interface Atom : NSApplication<CefAppProtocol, BrowserDelegate> {
NSView *_hiddenGlobalView;
BOOL handlingSendEvent_;
CefRefPtr<ClientHandler> _clientHandler;

View File

@@ -1,9 +1,11 @@
#import <Cocoa/Cocoa.h>
#import "BrowserDelegate.h"
#import "include/cef.h"
class ClientHandler;
@interface AtomController : NSWindowController <NSWindowDelegate> {
@interface AtomController : NSWindowController <NSWindowDelegate, BrowserDelegate> {
NSView *_webView;
NSString *_bootstrapScript;
NSString *_pathToOpen;
@@ -18,11 +20,6 @@ class ClientHandler;
- (void)createBrowser;
- (void)afterCreated;
- (void)loadStart;
- (bool)keyEventOfType:(cef_handler_keyevent_type_t)type code:(int)code modifiers:(int)modifiers isSystemKey:(bool)isSystemKey isAfterJavaScript:(bool)isAfterJavaScript;
@property (nonatomic, retain) IBOutlet NSView *webView;
@end

View File

@@ -0,0 +1,11 @@
#import <Foundation/Foundation.h>
#import "include/cef.h"
@protocol BrowserDelegate <NSObject>
@optional
- (void)afterCreated;
- (void)loadStart;
- (bool)keyEventOfType:(cef_handler_keyevent_type_t)type code:(int)code modifiers:(int)modifiers isSystemKey:(bool)isSystemKey isAfterJavaScript:(bool)isAfterJavaScript;
@end