mirror of
https://github.com/atom/atom.git
synced 2026-02-12 15:45:23 -05:00
Refactor ad hoc delegate methods into BrowserDelegate protocol.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
11
Atom/src/BrowserDelegate.h
Normal file
11
Atom/src/BrowserDelegate.h
Normal 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
|
||||
Reference in New Issue
Block a user