| 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/browser_main_win.h" | 5 #include "chrome/browser/browser_main_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/ui/views/uninstall_view.h" | 25 #include "chrome/browser/ui/views/uninstall_view.h" |
| 26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 27 #include "chrome/common/chrome_result_codes.h" | 27 #include "chrome/common/chrome_result_codes.h" |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/env_vars.h" | 29 #include "chrome/common/env_vars.h" |
| 30 #include "chrome/installer/util/browser_distribution.h" | 30 #include "chrome/installer/util/browser_distribution.h" |
| 31 #include "chrome/installer/util/helper.h" | 31 #include "chrome/installer/util/helper.h" |
| 32 #include "chrome/installer/util/install_util.h" | 32 #include "chrome/installer/util/install_util.h" |
| 33 #include "chrome/installer/util/shell_util.h" | 33 #include "chrome/installer/util/shell_util.h" |
| 34 #include "content/common/main_function_params.h" | 34 #include "content/common/main_function_params.h" |
| 35 #include "crypto/nss_util.h" | |
| 36 #include "grit/chromium_strings.h" | 35 #include "grit/chromium_strings.h" |
| 37 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 38 #include "net/base/winsock_init.h" | |
| 39 #include "net/socket/client_socket_factory.h" | |
| 40 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/l10n/l10n_util_win.h" | |
| 42 #include "ui/base/message_box_win.h" | 38 #include "ui/base/message_box_win.h" |
| 43 #include "views/focus/accelerator_handler.h" | 39 #include "views/focus/accelerator_handler.h" |
| 44 #include "views/widget/widget.h" | 40 #include "views/widget/widget.h" |
| 45 | 41 |
| 46 namespace { | 42 namespace { |
| 47 | 43 |
| 48 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( | 44 typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)( |
| 49 const wchar_t* command_line, | 45 const wchar_t* command_line, |
| 50 DWORD flags); | 46 DWORD flags); |
| 51 | 47 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 276 } |
| 281 return false; | 277 return false; |
| 282 } | 278 } |
| 283 | 279 |
| 284 // BrowserMainPartsWin --------------------------------------------------------- | 280 // BrowserMainPartsWin --------------------------------------------------------- |
| 285 | 281 |
| 286 BrowserMainPartsWin::BrowserMainPartsWin(const MainFunctionParams& parameters) | 282 BrowserMainPartsWin::BrowserMainPartsWin(const MainFunctionParams& parameters) |
| 287 : ChromeBrowserMainParts(parameters) { | 283 : ChromeBrowserMainParts(parameters) { |
| 288 } | 284 } |
| 289 | 285 |
| 290 void BrowserMainPartsWin::PreEarlyInitialization() { | |
| 291 // Initialize Winsock. | |
| 292 net::EnsureWinsockInit(); | |
| 293 } | |
| 294 | |
| 295 void BrowserMainPartsWin::PreMainMessageLoopStart() { | 286 void BrowserMainPartsWin::PreMainMessageLoopStart() { |
| 296 OleInitialize(NULL); | |
| 297 | |
| 298 // If we're running tests (ui_task is non-null), then the ResourceBundle | |
| 299 // has already been initialized. | |
| 300 if (!parameters().ui_task) { | 287 if (!parameters().ui_task) { |
| 301 // Override the configured locale with the user's preferred UI language. | |
| 302 l10n_util::OverrideLocaleWithUILanguageList(); | |
| 303 | |
| 304 // Make sure that we know how to handle exceptions from the message loop. | 288 // Make sure that we know how to handle exceptions from the message loop. |
| 305 InitializeWindowProcExceptions(); | 289 InitializeWindowProcExceptions(); |
| 306 } | 290 } |
| 307 } | 291 } |
| 308 | |
| 309 void BrowserMainPartsWin::InitializeSSL() { | |
| 310 // Use NSS for SSL by default. | |
| 311 // The default client socket factory uses NSS for SSL by default on | |
| 312 // Windows. | |
| 313 if (parsed_command_line().HasSwitch(switches::kUseSystemSSL)) { | |
| 314 net::ClientSocketFactory::UseSystemSSL(); | |
| 315 } else { | |
| 316 // We want to be sure to init NSPR on the main thread. | |
| 317 crypto::EnsureNSPRInit(); | |
| 318 } | |
| 319 } | |
| OLD | NEW |