Chromium Code Reviews| 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" |
| 11 #include "base/debug/debugger.h" | |
| 12 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 13 #include "base/mac/bundle_locations.h" | 12 #include "base/mac/bundle_locations.h" |
| 14 #include "base/mac/mac_util.h" | 13 #include "base/mac/mac_util.h" |
| 15 #include "base/mac/scoped_nsobject.h" | 14 #include "base/mac/scoped_nsobject.h" |
| 16 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 17 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 18 #include "chrome/app/breakpad_mac.h" | 17 #include "chrome/app/breakpad_mac.h" |
| 19 #import "chrome/browser/app_controller_mac.h" | 18 #import "chrome/browser/app_controller_mac.h" |
| 19 #include "chrome/browser/browser_process.h" | |
| 20 #import "chrome/browser/chrome_browser_application_mac.h" | 20 #import "chrome/browser/chrome_browser_application_mac.h" |
| 21 #include "chrome/browser/mac/install_from_dmg.h" | 21 #include "chrome/browser/mac/install_from_dmg.h" |
| 22 #include "chrome/browser/mac/keychain_reauthorize.h" | 22 #include "chrome/browser/mac/keychain_reauthorize.h" |
| 23 #import "chrome/browser/mac/keystone_glue.h" | 23 #import "chrome/browser/mac/keystone_glue.h" |
| 24 #include "chrome/browser/metrics/metrics_service.h" | 24 #include "chrome/browser/metrics/metrics_service.h" |
| 25 #include "chrome/browser/storage_monitor/storage_monitor_mac.h" | 25 #include "chrome/browser/storage_monitor/storage_monitor_mac.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "content/public/common/main_function_params.h" | 28 #include "content/public/common/main_function_params.h" |
| 29 #include "content/public/common/result_codes.h" | 29 #include "content/public/common/result_codes.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 COMPILE_ASSERT(kMaxCatsAndSixtyFours >= CAT_SIXTY_FOUR_MAX, | 143 COMPILE_ASSERT(kMaxCatsAndSixtyFours >= CAT_SIXTY_FOUR_MAX, |
| 144 CatSixtyFour_enum_grew_too_large); | 144 CatSixtyFour_enum_grew_too_large); |
| 145 | 145 |
| 146 UMA_HISTOGRAM_ENUMERATION("OSX.CatSixtyFour", | 146 UMA_HISTOGRAM_ENUMERATION("OSX.CatSixtyFour", |
| 147 cat_sixty_four, | 147 cat_sixty_four, |
| 148 kMaxCatsAndSixtyFours); | 148 kMaxCatsAndSixtyFours); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| 152 | 152 |
| 153 void RecordBreakpadStatusUMA(MetricsService* metrics) { | |
| 154 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); | |
| 155 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged()); | |
| 156 } | |
| 157 | |
| 158 void WarnAboutMinimumSystemRequirements() { | |
| 159 // Nothing to check for on Mac right now. | |
| 160 } | |
| 161 | |
| 162 // From browser_main_win.h, stubs until we figure out the right thing... | |
| 163 | |
| 164 int DoUninstallTasks(bool chrome_still_running) { | |
| 165 return content::RESULT_CODE_NORMAL_EXIT; | |
| 166 } | |
| 167 | |
| 168 // ChromeBrowserMainPartsMac --------------------------------------------------- | 153 // ChromeBrowserMainPartsMac --------------------------------------------------- |
| 169 | 154 |
| 170 ChromeBrowserMainPartsMac::ChromeBrowserMainPartsMac( | 155 ChromeBrowserMainPartsMac::ChromeBrowserMainPartsMac( |
| 171 const content::MainFunctionParams& parameters) | 156 const content::MainFunctionParams& parameters) |
| 172 : ChromeBrowserMainPartsPosix(parameters) { | 157 : ChromeBrowserMainPartsPosix(parameters) { |
| 173 } | 158 } |
| 174 | 159 |
| 175 ChromeBrowserMainPartsMac::~ChromeBrowserMainPartsMac() { | 160 ChromeBrowserMainPartsMac::~ChromeBrowserMainPartsMac() { |
| 176 } | 161 } |
| 177 | 162 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 [[NSUserDefaults standardUserDefaults] | 264 [[NSUserDefaults standardUserDefaults] |
| 280 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; | 265 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; |
| 281 } | 266 } |
| 282 | 267 |
| 283 void ChromeBrowserMainPartsMac::PreProfileInit() { | 268 void ChromeBrowserMainPartsMac::PreProfileInit() { |
| 284 storage_monitor_.reset(new chrome::StorageMonitorMac()); | 269 storage_monitor_.reset(new chrome::StorageMonitorMac()); |
| 285 | 270 |
| 286 ChromeBrowserMainPartsPosix::PreProfileInit(); | 271 ChromeBrowserMainPartsPosix::PreProfileInit(); |
| 287 } | 272 } |
| 288 | 273 |
| 274 void ChromeBrowserMainPartsMac::PostProfileInit() { | |
| 275 ChromeBrowserMainPartsPosix::PostProfileInit(); | |
| 276 g_browser_process->metrics_service()->RecordBreakpadRegistration( | |
| 277 IsCrashReporterEnabled()); | |
|
Nico
2013/07/10 17:50:52
Ah, I missed this.
| |
| 278 } | |
| 279 | |
| 289 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 280 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
| 290 AppController* appController = [NSApp delegate]; | 281 AppController* appController = [NSApp delegate]; |
| 291 [appController didEndMainMessageLoop]; | 282 [appController didEndMainMessageLoop]; |
| 292 } | 283 } |
| OLD | NEW |