| 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.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/l10n_util_win.h" |
| 14 #include "app/win_util.h" | 15 #include "app/win_util.h" |
| 15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 16 #include "base/environment.h" | 17 #include "base/environment.h" |
| 17 #include "base/i18n/rtl.h" | 18 #include "base/i18n/rtl.h" |
| 18 #include "base/nss_util.h" | 19 #include "base/nss_util.h" |
| 19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 20 #include "base/scoped_ptr.h" | 21 #include "base/scoped_ptr.h" |
| 21 #include "base/utf_string_conversions.h" | 22 #include "base/utf_string_conversions.h" |
| 22 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
| 23 #include "chrome/browser/browser_list.h" | 24 #include "chrome/browser/browser_list.h" |
| 24 #include "chrome/browser/first_run/first_run.h" | 25 #include "chrome/browser/first_run/first_run.h" |
| 25 #include "chrome/browser/metrics/metrics_service.h" | 26 #include "chrome/browser/metrics/metrics_service.h" |
| 26 #include "chrome/browser/views/uninstall_view.h" | 27 #include "chrome/browser/views/uninstall_view.h" |
| 27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/env_vars.h" | 29 #include "chrome/common/env_vars.h" |
| 30 #include "chrome/common/main_function_params.h" |
| 29 #include "chrome/common/result_codes.h" | 31 #include "chrome/common/result_codes.h" |
| 30 #include "chrome/installer/util/helper.h" | 32 #include "chrome/installer/util/helper.h" |
| 31 #include "chrome/installer/util/install_util.h" | 33 #include "chrome/installer/util/install_util.h" |
| 32 #include "chrome/installer/util/shell_util.h" | 34 #include "chrome/installer/util/shell_util.h" |
| 33 #include "grit/chromium_strings.h" | 35 #include "grit/chromium_strings.h" |
| 34 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
| 35 #include "net/base/winsock_init.h" | 37 #include "net/base/winsock_init.h" |
| 36 #include "net/socket/ssl_client_socket_nss_factory.h" | 38 #include "net/socket/ssl_client_socket_nss_factory.h" |
| 37 #include "views/focus/accelerator_handler.h" | 39 #include "views/focus/accelerator_handler.h" |
| 38 #include "views/window/window.h" | 40 #include "views/window/window.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 : BrowserMainParts(parameters) {} | 212 : BrowserMainParts(parameters) {} |
| 211 | 213 |
| 212 protected: | 214 protected: |
| 213 virtual void PreEarlyInitialization() { | 215 virtual void PreEarlyInitialization() { |
| 214 // Initialize Winsock. | 216 // Initialize Winsock. |
| 215 net::EnsureWinsockInit(); | 217 net::EnsureWinsockInit(); |
| 216 } | 218 } |
| 217 | 219 |
| 218 virtual void PreMainMessageLoopStart() { | 220 virtual void PreMainMessageLoopStart() { |
| 219 OleInitialize(NULL); | 221 OleInitialize(NULL); |
| 222 |
| 223 // If we're running tests (ui_task is non-null), then the ResourceBundle |
| 224 // has already been initialized. |
| 225 if (!parameters().ui_task) { |
| 226 // Override the configured locale with the user's preferred UI language. |
| 227 l10n_util::OverrideLocaleWithUILanguageList(); |
| 228 } |
| 220 } | 229 } |
| 221 | 230 |
| 222 private: | 231 private: |
| 223 virtual void InitializeSSL() { | 232 virtual void InitializeSSL() { |
| 224 // Use NSS for SSL by default. | 233 // Use NSS for SSL by default. |
| 225 // Because of a build system issue (http://crbug.com/43461), the default | 234 // 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 | 235 // client socket factory uses SChannel (the system SSL library) for SSL by |
| 227 // default on Windows. | 236 // default on Windows. |
| 228 if (!parsed_command_line().HasSwitch(switches::kUseSystemSSL)) { | 237 if (!parsed_command_line().HasSwitch(switches::kUseSystemSSL)) { |
| 229 net::ClientSocketFactory::SetSSLClientSocketFactory( | 238 net::ClientSocketFactory::SetSSLClientSocketFactory( |
| 230 net::SSLClientSocketNSSFactory); | 239 net::SSLClientSocketNSSFactory); |
| 231 // We want to be sure to init NSPR on the main thread. | 240 // We want to be sure to init NSPR on the main thread. |
| 232 base::EnsureNSPRInit(); | 241 base::EnsureNSPRInit(); |
| 233 } | 242 } |
| 234 } | 243 } |
| 235 }; | 244 }; |
| 236 | 245 |
| 237 // static | 246 // static |
| 238 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 247 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
| 239 const MainFunctionParams& parameters) { | 248 const MainFunctionParams& parameters) { |
| 240 return new BrowserMainPartsWin(parameters); | 249 return new BrowserMainPartsWin(parameters); |
| 241 } | 250 } |
| OLD | NEW |