cefclient: Mac: Clean up ClientAppDelegate initialization (issue #1500)
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2007 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
c44f6f7efb
commit
bd9b578f05
|
@ -31,8 +31,7 @@ void AddMenuItem(NSMenu *menu, NSString* label, int idval) {
|
||||||
bool with_osr_;
|
bool with_osr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, readwrite) bool with_osr;
|
- (id)initWithOsr:(bool)with_osr;
|
||||||
|
|
||||||
- (void)createApplication:(id)object;
|
- (void)createApplication:(id)object;
|
||||||
- (void)tryToTerminateApplication:(NSApplication*)app;
|
- (void)tryToTerminateApplication:(NSApplication*)app;
|
||||||
- (IBAction)menuItemSelected:(id)sender;
|
- (IBAction)menuItemSelected:(id)sender;
|
||||||
|
@ -47,8 +46,6 @@ void AddMenuItem(NSMenu *menu, NSString* label, int idval) {
|
||||||
|
|
||||||
@implementation ClientApplication
|
@implementation ClientApplication
|
||||||
|
|
||||||
@synthesize with_osr = with_osr_;
|
|
||||||
|
|
||||||
- (BOOL)isHandlingSendEvent {
|
- (BOOL)isHandlingSendEvent {
|
||||||
return handlingSendEvent_;
|
return handlingSendEvent_;
|
||||||
}
|
}
|
||||||
|
@ -109,6 +106,13 @@ void AddMenuItem(NSMenu *menu, NSString* label, int idval) {
|
||||||
|
|
||||||
@implementation ClientAppDelegate
|
@implementation ClientAppDelegate
|
||||||
|
|
||||||
|
- (id)initWithOsr:(bool)with_osr {
|
||||||
|
if (self = [super init]) {
|
||||||
|
with_osr_ = with_osr;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
// Create the application on the UI thread.
|
// Create the application on the UI thread.
|
||||||
- (void)createApplication:(id)object {
|
- (void)createApplication:(id)object {
|
||||||
NSApplication* application = [NSApplication sharedApplication];
|
NSApplication* application = [NSApplication sharedApplication];
|
||||||
|
@ -205,8 +209,8 @@ int RunMain(int argc, char* argv[]) {
|
||||||
test_runner::RegisterSchemeHandlers();
|
test_runner::RegisterSchemeHandlers();
|
||||||
|
|
||||||
// Create the application delegate and window.
|
// Create the application delegate and window.
|
||||||
ClientAppDelegate* delegate = [[ClientAppDelegate alloc] init];
|
ClientAppDelegate* delegate = [[ClientAppDelegate alloc]
|
||||||
delegate->with_osr = settings.windowless_rendering_enabled ? true : false;
|
initWithOsr:settings.windowless_rendering_enabled ? true : false];
|
||||||
[delegate performSelectorOnMainThread:@selector(createApplication:)
|
[delegate performSelectorOnMainThread:@selector(createApplication:)
|
||||||
withObject:nil
|
withObject:nil
|
||||||
waitUntilDone:NO];
|
waitUntilDone:NO];
|
||||||
|
|
Loading…
Reference in New Issue