OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/mac/mac_util.h" | 12 #include "base/mac/mac_util.h" |
13 #include "base/memory/scoped_nsobject.h" | 13 #include "base/memory/scoped_nsobject.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "chrome/app/breakpad_mac.h" | 15 #include "chrome/app/breakpad_mac.h" |
16 #import "chrome/browser/app_controller_mac.h" | 16 #import "chrome/browser/app_controller_mac.h" |
17 #import "chrome/browser/chrome_browser_application_mac.h" | 17 #import "chrome/browser/chrome_browser_application_mac.h" |
18 #import "chrome/browser/mac/keystone_glue.h" | 18 #import "chrome/browser/mac/keystone_glue.h" |
19 #include "chrome/browser/metrics/metrics_service.h" | 19 #include "chrome/browser/metrics/metrics_service.h" |
20 #include "chrome/common/chrome_paths.h" | 20 #include "chrome/common/chrome_paths.h" |
21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
22 #include "content/common/main_function_params.h" | 22 #include "content/public/common/main_function_params.h" |
23 #include "content/public/common/result_codes.h" | 23 #include "content/public/common/result_codes.h" |
24 #include "ui/base/l10n/l10n_util_mac.h" | 24 #include "ui/base/l10n/l10n_util_mac.h" |
25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
26 | 26 |
27 void RecordBreakpadStatusUMA(MetricsService* metrics) { | 27 void RecordBreakpadStatusUMA(MetricsService* metrics) { |
28 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); | 28 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); |
29 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged()); | 29 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged()); |
30 } | 30 } |
31 | 31 |
32 void RecordBrowserStartupTime() { | 32 void RecordBrowserStartupTime() { |
33 // Not implemented on Mac for now. | 33 // Not implemented on Mac for now. |
34 } | 34 } |
35 | 35 |
36 void WarnAboutMinimumSystemRequirements() { | 36 void WarnAboutMinimumSystemRequirements() { |
37 // Nothing to check for on Mac right now. | 37 // Nothing to check for on Mac right now. |
38 } | 38 } |
39 | 39 |
40 // From browser_main_win.h, stubs until we figure out the right thing... | 40 // From browser_main_win.h, stubs until we figure out the right thing... |
41 | 41 |
42 int DoUninstallTasks(bool chrome_still_running) { | 42 int DoUninstallTasks(bool chrome_still_running) { |
43 return content::RESULT_CODE_NORMAL_EXIT; | 43 return content::RESULT_CODE_NORMAL_EXIT; |
44 } | 44 } |
45 | 45 |
46 // ChromeBrowserMainPartsMac --------------------------------------------------- | 46 // ChromeBrowserMainPartsMac --------------------------------------------------- |
47 | 47 |
48 ChromeBrowserMainPartsMac::ChromeBrowserMainPartsMac( | 48 ChromeBrowserMainPartsMac::ChromeBrowserMainPartsMac( |
49 const MainFunctionParams& parameters) | 49 const content::MainFunctionParams& parameters) |
50 : ChromeBrowserMainPartsPosix(parameters) { | 50 : ChromeBrowserMainPartsPosix(parameters) { |
51 } | 51 } |
52 | 52 |
53 void ChromeBrowserMainPartsMac::PreEarlyInitialization() { | 53 void ChromeBrowserMainPartsMac::PreEarlyInitialization() { |
54 ChromeBrowserMainPartsPosix::PreEarlyInitialization(); | 54 ChromeBrowserMainPartsPosix::PreEarlyInitialization(); |
55 | 55 |
56 if (base::mac::WasLaunchedAsHiddenLoginItem()) { | 56 if (base::mac::WasLaunchedAsHiddenLoginItem()) { |
57 CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); | 57 CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); |
58 singleton_command_line->AppendSwitch(switches::kNoStartupWindow); | 58 singleton_command_line->AppendSwitch(switches::kNoStartupWindow); |
59 } | 59 } |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 void ChromeBrowserMainPartsMac::ShowMissingLocaleMessageBox() { | 116 void ChromeBrowserMainPartsMac::ShowMissingLocaleMessageBox() { |
117 // Not called on Mac because we load the locale files differently. | 117 // Not called on Mac because we load the locale files differently. |
118 NOTREACHED(); | 118 NOTREACHED(); |
119 } | 119 } |
120 | 120 |
121 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 121 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
122 AppController* appController = [NSApp delegate]; | 122 AppController* appController = [NSApp delegate]; |
123 [appController didEndMainMessageLoop]; | 123 [appController didEndMainMessageLoop]; |
124 } | 124 } |
OLD | NEW |