OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_main_posix.h" | 5 #include "chrome/browser/browser_main_posix.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "app/app_switches.h" | 9 #include "app/app_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/debugger.h" | 11 #include "base/debug/debugger.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/mac/mac_util.h" | 13 #include "base/mac/mac_util.h" |
14 #include "base/nss_util.h" | 14 #include "base/nss_util.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/scoped_nsobject.h" | 16 #include "base/scoped_nsobject.h" |
17 #include "chrome/app/breakpad_mac.h" | 17 #include "chrome/app/breakpad_mac.h" |
18 #import "chrome/browser/app_controller_mac.h" | 18 #import "chrome/browser/app_controller_mac.h" |
19 #include "chrome/browser/browser_main_win.h" | 19 #include "chrome/browser/browser_main_win.h" |
20 #import "chrome/browser/chrome_browser_application_mac.h" | 20 #import "chrome/browser/chrome_browser_application_mac.h" |
21 #import "chrome/browser/cocoa/keystone_glue.h" | 21 #import "chrome/browser/cocoa/keystone_glue.h" |
22 #include "chrome/browser/metrics/metrics_service.h" | 22 #include "chrome/browser/metrics/metrics_service.h" |
23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/main_function_params.h" | 25 #include "chrome/common/main_function_params.h" |
26 #include "chrome/common/result_codes.h" | 26 #include "chrome/common/result_codes.h" |
27 #include "net/socket/ssl_client_socket_mac_factory.h" | 27 #include "net/socket/client_socket_factory.h" |
28 #include "ui/base/l10n/l10n_util_mac.h" | 28 #include "ui/base/l10n/l10n_util_mac.h" |
29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
30 | 30 |
31 void DidEndMainMessageLoop() { | 31 void DidEndMainMessageLoop() { |
32 AppController* appController = [NSApp delegate]; | 32 AppController* appController = [NSApp delegate]; |
33 [appController didEndMainMessageLoop]; | 33 [appController didEndMainMessageLoop]; |
34 } | 34 } |
35 | 35 |
36 void RecordBreakpadStatusUMA(MetricsService* metrics) { | 36 void RecordBreakpadStatusUMA(MetricsService* metrics) { |
37 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); | 37 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // |-application:openFiles:|, since we already handle them directly. | 128 // |-application:openFiles:|, since we already handle them directly. |
129 [[NSUserDefaults standardUserDefaults] | 129 [[NSUserDefaults standardUserDefaults] |
130 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; | 130 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; |
131 } | 131 } |
132 | 132 |
133 private: | 133 private: |
134 virtual void InitializeSSL() { | 134 virtual void InitializeSSL() { |
135 // Use NSS for SSL by default. | 135 // Use NSS for SSL by default. |
136 // The default client socket factory uses NSS for SSL by default on Mac. | 136 // The default client socket factory uses NSS for SSL by default on Mac. |
137 if (parsed_command_line().HasSwitch(switches::kUseSystemSSL)) { | 137 if (parsed_command_line().HasSwitch(switches::kUseSystemSSL)) { |
138 net::ClientSocketFactory::SetSSLClientSocketFactory( | 138 net::ClientSocketFactory::UseSystemSSL(); |
139 net::SSLClientSocketMacFactory); | |
140 } else { | 139 } else { |
141 // We want to be sure to init NSPR on the main thread. | 140 // We want to be sure to init NSPR on the main thread. |
142 base::EnsureNSPRInit(); | 141 base::EnsureNSPRInit(); |
143 } | 142 } |
144 } | 143 } |
145 }; | 144 }; |
146 | 145 |
147 // static | 146 // static |
148 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 147 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
149 const MainFunctionParams& parameters) { | 148 const MainFunctionParams& parameters) { |
150 return new BrowserMainPartsMac(parameters); | 149 return new BrowserMainPartsMac(parameters); |
151 } | 150 } |
OLD | NEW |