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 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // change this, you'll probably need to change the Valgrind suppression. | 149 // change this, you'll probably need to change the Valgrind suppression. |
150 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; | 150 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; |
151 // Make sure the app controller has been created. | 151 // Make sure the app controller has been created. |
152 DCHECK([NSApp delegate]); | 152 DCHECK([NSApp delegate]); |
153 | 153 |
154 [[NSUserDefaults standardUserDefaults] registerDefaults:@{ | 154 [[NSUserDefaults standardUserDefaults] registerDefaults:@{ |
155 // Prevent Cocoa from turning command-line arguments into | 155 // Prevent Cocoa from turning command-line arguments into |
156 // |-application:openFiles:|, since we already handle them directly. | 156 // |-application:openFiles:|, since we already handle them directly. |
157 // @"NO" looks like a mistake, but the value really is supposed to be a | 157 // @"NO" looks like a mistake, but the value really is supposed to be a |
158 // string. | 158 // string. |
159 @"NSTreatUnknownArgumentsAsOpen": @"NO", | 159 @"NSTreatUnknownArgumentsAsOpen": @"NO" |
160 // CoreAnimation has poor performance and CoreAnimation and | |
161 // non-CoreAnimation exhibit window flickering when layers are not hosted | |
162 // in the window server, which is the default when not not using the | |
163 // 10.9 SDK. | |
164 // TODO: Remove this when we build with the 10.9 SDK. | |
165 @"NSWindowHostsLayersInWindowServer": @(base::mac::IsOSMavericksOrLater()) | |
166 }]; | 160 }]; |
167 } | 161 } |
168 | 162 |
169 void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() { | 163 void ChromeBrowserMainPartsMac::PostMainMessageLoopStart() { |
170 MacStartupProfiler::GetInstance()->Profile( | 164 MacStartupProfiler::GetInstance()->Profile( |
171 MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START); | 165 MacStartupProfiler::POST_MAIN_MESSAGE_LOOP_START); |
172 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); | 166 ChromeBrowserMainPartsPosix::PostMainMessageLoopStart(); |
173 } | 167 } |
174 | 168 |
175 void ChromeBrowserMainPartsMac::PreProfileInit() { | 169 void ChromeBrowserMainPartsMac::PreProfileInit() { |
(...skipping 19 matching lines...) Expand all Loading... |
195 // TODO(calamity): Make this gated on first_run::IsChromeFirstRun() in M45. | 189 // TODO(calamity): Make this gated on first_run::IsChromeFirstRun() in M45. |
196 content::BrowserThread::PostAfterStartupTask( | 190 content::BrowserThread::PostAfterStartupTask( |
197 FROM_HERE, base::ThreadTaskRunnerHandle::Get(), | 191 FROM_HERE, base::ThreadTaskRunnerHandle::Get(), |
198 base::Bind(&EnsureMetadataNeverIndexFile, user_data_dir())); | 192 base::Bind(&EnsureMetadataNeverIndexFile, user_data_dir())); |
199 } | 193 } |
200 | 194 |
201 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 195 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
202 AppController* appController = [NSApp delegate]; | 196 AppController* appController = [NSApp delegate]; |
203 [appController didEndMainMessageLoop]; | 197 [appController didEndMainMessageLoop]; |
204 } | 198 } |
OLD | NEW |