From bd9b578f05ceca7b34fe19ba1644fa13be7e1de4 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 30 Jan 2015 18:13:39 +0000 Subject: [PATCH] cefclient: Mac: Clean up ClientAppDelegate initialization (issue #1500) git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2007 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- tests/cefclient/cefclient_mac.mm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/cefclient/cefclient_mac.mm b/tests/cefclient/cefclient_mac.mm index 460d60ece..36118b559 100644 --- a/tests/cefclient/cefclient_mac.mm +++ b/tests/cefclient/cefclient_mac.mm @@ -31,8 +31,7 @@ void AddMenuItem(NSMenu *menu, NSString* label, int idval) { bool with_osr_; } -@property (nonatomic, readwrite) bool with_osr; - +- (id)initWithOsr:(bool)with_osr; - (void)createApplication:(id)object; - (void)tryToTerminateApplication:(NSApplication*)app; - (IBAction)menuItemSelected:(id)sender; @@ -47,8 +46,6 @@ void AddMenuItem(NSMenu *menu, NSString* label, int idval) { @implementation ClientApplication -@synthesize with_osr = with_osr_; - - (BOOL)isHandlingSendEvent { return handlingSendEvent_; } @@ -109,6 +106,13 @@ void AddMenuItem(NSMenu *menu, NSString* label, int idval) { @implementation ClientAppDelegate +- (id)initWithOsr:(bool)with_osr { + if (self = [super init]) { + with_osr_ = with_osr; + } + return self; +} + // Create the application on the UI thread. - (void)createApplication:(id)object { NSApplication* application = [NSApplication sharedApplication]; @@ -205,8 +209,8 @@ int RunMain(int argc, char* argv[]) { test_runner::RegisterSchemeHandlers(); // Create the application delegate and window. - ClientAppDelegate* delegate = [[ClientAppDelegate alloc] init]; - delegate->with_osr = settings.windowless_rendering_enabled ? true : false; + ClientAppDelegate* delegate = [[ClientAppDelegate alloc] + initWithOsr:settings.windowless_rendering_enabled ? true : false]; [delegate performSelectorOnMainThread:@selector(createApplication:) withObject:nil waitUntilDone:NO];