Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/browser/browser_main_win.cc

Issue 3073008: BrowserMain() refactoring, part 2.1. (Closed)
Patch Set: build fix Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browser_main_posix.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 5 #include "chrome/browser/browser_main.h"
6 #include "chrome/browser/browser_main_win.h" 6 #include "chrome/browser/browser_main_win.h"
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 10
11 #include <algorithm> 11 #include <algorithm>
12 12
13 #include "app/l10n_util.h" 13 #include "app/l10n_util.h"
14 #include "app/message_box_flags.h" 14 #include "app/message_box_flags.h"
15 #include "app/win_util.h" 15 #include "app/win_util.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/i18n/rtl.h" 17 #include "base/i18n/rtl.h"
18 #include "base/nss_util.h"
18 #include "base/path_service.h" 19 #include "base/path_service.h"
19 #include "base/win_util.h" 20 #include "base/win_util.h"
20 #include "chrome/browser/browser_list.h" 21 #include "chrome/browser/browser_list.h"
21 #include "chrome/browser/first_run.h" 22 #include "chrome/browser/first_run.h"
22 #include "chrome/browser/metrics/metrics_service.h" 23 #include "chrome/browser/metrics/metrics_service.h"
23 #include "chrome/browser/views/uninstall_view.h" 24 #include "chrome/browser/views/uninstall_view.h"
24 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
25 #include "chrome/common/env_vars.h" 26 #include "chrome/common/env_vars.h"
26 #include "chrome/common/result_codes.h" 27 #include "chrome/common/result_codes.h"
27 #include "chrome/installer/util/helper.h" 28 #include "chrome/installer/util/helper.h"
28 #include "chrome/installer/util/install_util.h" 29 #include "chrome/installer/util/install_util.h"
29 #include "chrome/installer/util/shell_util.h" 30 #include "chrome/installer/util/shell_util.h"
30 #include "grit/chromium_strings.h" 31 #include "grit/chromium_strings.h"
31 #include "grit/generated_resources.h" 32 #include "grit/generated_resources.h"
32 #include "net/base/winsock_init.h" 33 #include "net/base/winsock_init.h"
34 #include "net/socket/ssl_client_socket_nss_factory.h"
33 #include "views/focus/accelerator_handler.h" 35 #include "views/focus/accelerator_handler.h"
34 #include "views/window/window.h" 36 #include "views/window/window.h"
35 37
36 void DidEndMainMessageLoop() { 38 void DidEndMainMessageLoop() {
37 OleUninitialize(); 39 OleUninitialize();
38 } 40 }
39 41
40 void RecordBreakpadStatusUMA(MetricsService* metrics) { 42 void RecordBreakpadStatusUMA(MetricsService* metrics) {
41 DWORD len = ::GetEnvironmentVariableW( 43 DWORD len = ::GetEnvironmentVariableW(
42 ASCIIToWide(env_vars::kNoOOBreakpad).c_str() , NULL, 0); 44 ASCIIToWide(env_vars::kNoOOBreakpad).c_str() , NULL, 0);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 211
210 protected: 212 protected:
211 virtual void PreEarlyInitialization() { 213 virtual void PreEarlyInitialization() {
212 // Initialize Winsock. 214 // Initialize Winsock.
213 net::EnsureWinsockInit(); 215 net::EnsureWinsockInit();
214 } 216 }
215 217
216 virtual void PreMainMessageLoopStart() { 218 virtual void PreMainMessageLoopStart() {
217 OleInitialize(NULL); 219 OleInitialize(NULL);
218 } 220 }
221
222 private:
223 virtual void InitializeSSL() {
224 // Use NSS for SSL by default.
225 // Because of a build system issue (http://crbug.com/43461), the default
226 // client socket factory uses SChannel (the system SSL library) for SSL by
227 // default on Windows.
228 if (!parsed_command_line().HasSwitch(switches::kUseSystemSSL)) {
229 net::ClientSocketFactory::SetSSLClientSocketFactory(
230 net::SSLClientSocketNSSFactory);
231 // We want to be sure to init NSPR on the main thread.
232 base::EnsureNSPRInit();
233 }
234 }
219 }; 235 };
220 236
221 // static 237 // static
222 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( 238 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts(
223 const MainFunctionParams& parameters) { 239 const MainFunctionParams& parameters) {
224 return new BrowserMainPartsWin(parameters); 240 return new BrowserMainPartsWin(parameters);
225 } 241 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_main_posix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698