Index: chrome/browser/ui/cocoa/custom_frame_view.mm |
diff --git a/chrome/browser/ui/cocoa/custom_frame_view.mm b/chrome/browser/ui/cocoa/custom_frame_view.mm |
index 47b46ed2746f8a4b39c0ac2e310171adf3e94e63..a366f696c20a78f91d3b062649ddb0251877cc1f 100644 |
--- a/chrome/browser/ui/cocoa/custom_frame_view.mm |
+++ b/chrome/browser/ui/cocoa/custom_frame_view.mm |
@@ -4,6 +4,9 @@ |
#import "chrome/browser/ui/cocoa/custom_frame_view.h" |
+#include <crt_externs.h> |
+#include <string.h> |
+ |
#import <objc/runtime.h> |
Mark Mentovai
2014/02/07 18:49:39
Why are these in a separate section from the ones
Robert Sesek
2014/02/07 19:05:11
Done.
|
#import <Carbon/Carbon.h> |
@@ -43,6 +46,18 @@ 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. Running AppKit |
+ // +initialize methods in the renderer may establish Mach IPC with |
Mark Mentovai
2014/02/07 18:49:39
This comment should say the thing about +[NSThemeF
Robert Sesek
2014/02/07 19:05:11
Done.
|
+ // 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(); |
+ for (int i = 0; i < *_NSGetArgc(); ++i) { |
Mark Mentovai
2014/02/07 18:49:39
Don’t keep calling this and dereferencing it.
int
Mark Mentovai
2014/02/07 18:49:39
argv[0] is the executable name. Command-line argum
Robert Sesek
2014/02/07 19:05:11
Done.
Robert Sesek
2014/02/07 19:05:11
Done.
|
+ const char* arg = argv[i]; |
+ if (strstr(arg, "--type=") != NULL) |
Mark Mentovai
2014/02/07 18:49:39
Don’t scan the whole |arg|, --type= is only signif
Robert Sesek
2014/02/07 19:05:11
Done.
|
+ return; |
+ } |
+ |
base::mac::ScopedNSAutoreleasePool pool; |
// On 10.8+ the background for textured windows are no longer drawn by |