| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chrome_browser_main_mac.h" | 5 #include "chrome/browser/chrome_browser_main_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 #include <sys/sysctl.h> | 8 #include <sys/sysctl.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // Now load the nib (from the right bundle). | 222 // Now load the nib (from the right bundle). |
| 223 base::scoped_nsobject<NSNib> nib( | 223 base::scoped_nsobject<NSNib> nib( |
| 224 [[NSNib alloc] initWithNibNamed:@"MainMenu" | 224 [[NSNib alloc] initWithNibNamed:@"MainMenu" |
| 225 bundle:base::mac::FrameworkBundle()]); | 225 bundle:base::mac::FrameworkBundle()]); |
| 226 // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you | 226 // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you |
| 227 // change this, you'll probably need to change the Valgrind suppression. | 227 // change this, you'll probably need to change the Valgrind suppression. |
| 228 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; | 228 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; |
| 229 // Make sure the app controller has been created. | 229 // Make sure the app controller has been created. |
| 230 DCHECK([NSApp delegate]); | 230 DCHECK([NSApp delegate]); |
| 231 | 231 |
| 232 // Prevent Cocoa from turning command-line arguments into | 232 [[NSUserDefaults standardUserDefaults] registerDefaults:@{ |
| 233 // |-application:openFiles:|, since we already handle them directly. | 233 // Prevent Cocoa from turning command-line arguments into |
| 234 [[NSUserDefaults standardUserDefaults] | 234 // |-application:openFiles:|, since we already handle them directly. |
| 235 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; | 235 // @"NO" looks like a mistake, but the value really is supposed to be a |
| 236 // CoreAnimation has poor performance and CoreAnimation and non-CoreAnimation | 236 // string. |
| 237 // exhibit window flickering when layers are not hosted in the window server, | 237 @"NSTreatUnknownArgumentsAsOpen": @"NO", |
| 238 // which is the default when not not using the 10.9 SDK. | 238 // CoreAnimation has poor performance and CoreAnimation and |
| 239 // TODO: Remove this when we build with the 10.9 SDK. | 239 // non-CoreAnimation exhibit window flickering when layers are not hosted |
| 240 if (base::mac::IsOSMavericksOrLater()) | 240 // in the window server, which is the default when not not using the |
| 241 [[NSUserDefaults standardUserDefaults] | 241 // 10.9 SDK. |
| 242 setObject:@"YES" | 242 // TODO: Remove this when we build with the 10.9 SDK. |
| 243 forKey:@"NSWindowHostsLayersInWindowServer"]; | 243 @"NSWindowHostsLayersInWindowServer": @(base::mac::IsOSMavericksOrLater()) |
| 244 }]; |
| 244 } | 245 } |
| 245 | 246 |
| 246 void ChromeBrowserMainPartsMac::PostProfileInit() { | 247 void ChromeBrowserMainPartsMac::PostProfileInit() { |
| 247 ChromeBrowserMainPartsPosix::PostProfileInit(); | 248 ChromeBrowserMainPartsPosix::PostProfileInit(); |
| 248 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 249 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
| 249 breakpad::IsCrashReporterEnabled()); | 250 breakpad::IsCrashReporterEnabled()); |
| 250 } | 251 } |
| 251 | 252 |
| 252 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 253 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
| 253 AppController* appController = [NSApp delegate]; | 254 AppController* appController = [NSApp delegate]; |
| 254 [appController didEndMainMessageLoop]; | 255 [appController didEndMainMessageLoop]; |
| 255 } | 256 } |
| OLD | NEW |