| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 5 #include "chrome/browser/chrome_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> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/environment.h" | 13 #include "base/environment.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/scoped_native_library.h" | 18 #include "base/scoped_native_library.h" |
| 19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 21 #include "base/win/metro.h" | 21 #include "base/win/metro.h" |
| 22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 23 #include "base/win/wrapped_window_proc.h" | 23 #include "base/win/wrapped_window_proc.h" |
| 24 #include "chrome/browser/browser_util_win.h" | 24 #include "chrome/browser/browser_util_win.h" |
| 25 #include "chrome/browser/chrome_elf_init_win.h" | |
| 26 #include "chrome/browser/install_verification/win/install_verification.h" | 25 #include "chrome/browser/install_verification/win/install_verification.h" |
| 27 #include "chrome/browser/profiles/profile_info_cache.h" | 26 #include "chrome/browser/profiles/profile_info_cache.h" |
| 28 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 27 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 29 #include "chrome/browser/shell_integration.h" | 28 #include "chrome/browser/shell_integration.h" |
| 30 #include "chrome/browser/ui/simple_message_box.h" | 29 #include "chrome/browser/ui/simple_message_box.h" |
| 31 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 30 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
| 32 #include "chrome/common/chrome_constants.h" | 31 #include "chrome/common/chrome_constants.h" |
| 33 #include "chrome/common/chrome_result_codes.h" | 32 #include "chrome/common/chrome_result_codes.h" |
| 34 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/chrome_version_info.h" | 34 #include "chrome/common/chrome_version_info.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 void ChromeBrowserMainPartsWin::PostBrowserStart() { | 245 void ChromeBrowserMainPartsWin::PostBrowserStart() { |
| 247 ChromeBrowserMainParts::PostBrowserStart(); | 246 ChromeBrowserMainParts::PostBrowserStart(); |
| 248 | 247 |
| 249 // Set up a task to verify installed modules in the current process. Use a | 248 // Set up a task to verify installed modules in the current process. Use a |
| 250 // delay to reduce the impact on startup time. | 249 // delay to reduce the impact on startup time. |
| 251 content::BrowserThread::GetMessageLoopProxyForThread( | 250 content::BrowserThread::GetMessageLoopProxyForThread( |
| 252 content::BrowserThread::UI)->PostDelayedTask( | 251 content::BrowserThread::UI)->PostDelayedTask( |
| 253 FROM_HERE, | 252 FROM_HERE, |
| 254 base::Bind(&VerifyInstallation), | 253 base::Bind(&VerifyInstallation), |
| 255 base::TimeDelta::FromSeconds(45)); | 254 base::TimeDelta::FromSeconds(45)); |
| 256 | |
| 257 InitializeChromeElf(); | |
| 258 } | 255 } |
| 259 | 256 |
| 260 // static | 257 // static |
| 261 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 258 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
| 262 const CommandLine& parsed_command_line) { | 259 const CommandLine& parsed_command_line) { |
| 263 // Clear this var so child processes don't show the dialog by default. | 260 // Clear this var so child processes don't show the dialog by default. |
| 264 scoped_ptr<base::Environment> env(base::Environment::Create()); | 261 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 265 env->UnSetVar(env_vars::kShowRestart); | 262 env->UnSetVar(env_vars::kShowRestart); |
| 266 | 263 |
| 267 // For non-interactive tests we don't restart on crash. | 264 // For non-interactive tests we don't restart on crash. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (resource_id) | 424 if (resource_id) |
| 428 return l10n_util::GetStringUTF16(resource_id); | 425 return l10n_util::GetStringUTF16(resource_id); |
| 429 return base::string16(); | 426 return base::string16(); |
| 430 } | 427 } |
| 431 | 428 |
| 432 // static | 429 // static |
| 433 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 430 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 434 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 431 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 435 installer::SetTranslationDelegate(&delegate); | 432 installer::SetTranslationDelegate(&delegate); |
| 436 } | 433 } |
| OLD | NEW |