Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Unified Diff: chrome/browser/ui/cocoa/custom_frame_view.mm

Issue 157763002: [Mac] In +[CustomFrameView load], do not perform any work if the process has a --type flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2db6103c14ebf3b6f2e4d49efbdef7621f207b32 100644
--- a/chrome/browser/ui/cocoa/custom_frame_view.mm
+++ b/chrome/browser/ui/cocoa/custom_frame_view.mm
@@ -4,8 +4,10 @@
#import "chrome/browser/ui/cocoa/custom_frame_view.h"
-#import <objc/runtime.h>
#import <Carbon/Carbon.h>
+#include <crt_externs.h>
+#import <objc/runtime.h>
+#include <string.h>
#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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698