| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 // Prevent Cocoa from turning command-line arguments into | 252 // Prevent Cocoa from turning command-line arguments into |
| 253 // |-application:openFiles:|, since we already handle them directly. | 253 // |-application:openFiles:|, since we already handle them directly. |
| 254 // @"NO" looks like a mistake, but the value really is supposed to be a | 254 // @"NO" looks like a mistake, but the value really is supposed to be a |
| 255 // string. | 255 // string. |
| 256 @"NSTreatUnknownArgumentsAsOpen": @"NO", | 256 @"NSTreatUnknownArgumentsAsOpen": @"NO", |
| 257 // CoreAnimation has poor performance and CoreAnimation and | 257 // CoreAnimation has poor performance and CoreAnimation and |
| 258 // non-CoreAnimation exhibit window flickering when layers are not hosted | 258 // non-CoreAnimation exhibit window flickering when layers are not hosted |
| 259 // in the window server, which is the default when not not using the | 259 // in the window server, which is the default when not not using the |
| 260 // 10.9 SDK. | 260 // 10.9 SDK. |
| 261 // TODO: Remove this when we build with the 10.9 SDK. | 261 // TODO: Remove this when we build with the 10.9 SDK. |
| 262 @"NSWindowHostsLayersInWindowServer": @(base::mac::IsOSMavericksOrLater()) | 262 @"NSWindowHostsLayersInWindowServer": |
| 263 @(base::mac::IsOSMavericksOrLater()), |
| 264 // This setting prevents views from ditching their layers when the view |
| 265 // gets removed from the view hierarchy. It defaults to YES for |
| 266 // applications linked against an OSX 10.8+ SDK. In Yosemite, failing to |
| 267 // set this to YES causes an AppKit crash. http://crbug.com/428977 |
| 268 // TODO(erikchen): Remove this when we build with an OSX 10.8+ SDK. |
| 269 @"NSViewKeepLayersAround": @(YES) |
| 263 }]; | 270 }]; |
| 264 } | 271 } |
| 265 | 272 |
| 266 void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() { | 273 void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() { |
| 267 MacStartupProfiler::GetInstance()->Profile( | 274 MacStartupProfiler::GetInstance()->Profile( |
| 268 MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START); | 275 MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START); |
| 269 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); | 276 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); |
| 270 } | 277 } |
| 271 | 278 |
| 272 void ChromeBrowserMainPartsMac::PreProfileInit() { | 279 void ChromeBrowserMainPartsMac::PreProfileInit() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 286 MacStartupProfiler::POST_PROFILE_INIT); | 293 MacStartupProfiler::POST_PROFILE_INIT); |
| 287 ChromeBrowserMainPartsPosix::PostProfileInit(); | 294 ChromeBrowserMainPartsPosix::PostProfileInit(); |
| 288 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 295 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
| 289 breakpad::IsCrashReporterEnabled()); | 296 breakpad::IsCrashReporterEnabled()); |
| 290 } | 297 } |
| 291 | 298 |
| 292 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 299 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
| 293 AppController* appController = [NSApp delegate]; | 300 AppController* appController = [NSApp delegate]; |
| 294 [appController didEndMainMessageLoop]; | 301 [appController didEndMainMessageLoop]; |
| 295 } | 302 } |
| OLD | NEW |