X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fui%2Fcocoa%2Fcustom_frame_view.mm;h=2db6103c14ebf3b6f2e4d49efbdef7621f207b32;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=47b46ed2746f8a4b39c0ac2e310171adf3e94e63;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/ui/cocoa/custom_frame_view.mm b/src/chrome/browser/ui/cocoa/custom_frame_view.mm index 47b46ed..2db6103 100644 --- a/src/chrome/browser/ui/cocoa/custom_frame_view.mm +++ b/src/chrome/browser/ui/cocoa/custom_frame_view.mm @@ -4,8 +4,10 @@ #import "chrome/browser/ui/cocoa/custom_frame_view.h" -#import #import +#include +#import +#include #include "base/logging.h" #include "base/mac/mac_util.h" @@ -43,6 +45,20 @@ BOOL gCanGetCornerRadius = NO; // roll overs for our close widgets, but things should still function // correctly. + (void)load { + // Swizzling should only happen in the browser process. Interacting with + // AppKit will run +[borderViewClass initialize] in the renderer, which + // may establish Mach IPC with com.apple.windowserver. + // Note that CommandLine has not been initialized yet, since this is running + // as a module initializer. + const char* const* const argv = *_NSGetArgv(); + const int argc = *_NSGetArgc(); + const char kType[] = "--type="; + for (int i = 1; i < argc; ++i) { + const char* arg = argv[i]; + if (strncmp(arg, kType, strlen(kType)) == 0) + return; + } + base::mac::ScopedNSAutoreleasePool pool; // On 10.8+ the background for textured windows are no longer drawn by