| 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/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 19 #include "base/scoped_native_library.h" | 19 #include "base/scoped_native_library.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 22 #include "base/win/metro.h" | 22 #include "base/win/metro.h" |
| 23 #include "base/win/win_util.h" | 23 #include "base/win/win_util.h" |
| 24 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 25 #include "base/win/wrapped_window_proc.h" | 25 #include "base/win/wrapped_window_proc.h" |
| 26 #include "chrome/browser/browser_util_win.h" | 26 #include "chrome/browser/browser_util_win.h" |
| 27 #include "chrome/browser/chrome_elf_init_win.h" | 27 #include "chrome/browser/chrome_elf_init_win.h" |
| 28 #include "chrome/browser/first_run/first_run.h" | 28 #include "chrome/browser/first_run/first_run.h" |
| 29 #include "chrome/browser/install_verification/win/install_verification.h" | 29 #include "chrome/browser/install_verification/win/install_verification.h" |
| 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 30 #include "chrome/browser/profiles/profile_info_cache.h" | 31 #include "chrome/browser/profiles/profile_info_cache.h" |
| 31 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 32 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 32 #include "chrome/browser/shell_integration.h" | 33 #include "chrome/browser/shell_integration.h" |
| 33 #include "chrome/browser/ui/simple_message_box.h" | 34 #include "chrome/browser/ui/simple_message_box.h" |
| 34 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 35 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
| 35 #include "chrome/common/chrome_constants.h" | 36 #include "chrome/common/chrome_constants.h" |
| 36 #include "chrome/common/chrome_result_codes.h" | 37 #include "chrome/common/chrome_result_codes.h" |
| 37 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/chrome_version_info.h" | 39 #include "chrome/common/chrome_version_info.h" |
| 39 #include "chrome/common/env_vars.h" | 40 #include "chrome/common/env_vars.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() { | 207 void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() { |
| 207 // installer_util references strings that are normally compiled into | 208 // installer_util references strings that are normally compiled into |
| 208 // setup.exe. In Chrome, these strings are in the locale files. | 209 // setup.exe. In Chrome, these strings are in the locale files. |
| 209 SetupInstallerUtilStrings(); | 210 SetupInstallerUtilStrings(); |
| 210 | 211 |
| 211 ChromeBrowserMainParts::PreMainMessageLoopStart(); | 212 ChromeBrowserMainParts::PreMainMessageLoopStart(); |
| 212 if (!parameters().ui_task) { | 213 if (!parameters().ui_task) { |
| 213 // Make sure that we know how to handle exceptions from the message loop. | 214 // Make sure that we know how to handle exceptions from the message loop. |
| 214 InitializeWindowProcExceptions(); | 215 InitializeWindowProcExceptions(); |
| 215 } | 216 } |
| 217 |
| 218 IncognitoModePrefs::InitializePlatformParentalControls(); |
| 216 } | 219 } |
| 217 | 220 |
| 218 int ChromeBrowserMainPartsWin::PreCreateThreads() { | 221 int ChromeBrowserMainPartsWin::PreCreateThreads() { |
| 219 int rv = ChromeBrowserMainParts::PreCreateThreads(); | 222 int rv = ChromeBrowserMainParts::PreCreateThreads(); |
| 220 | 223 |
| 221 if (IsSafeModeStart()) { | 224 if (IsSafeModeStart()) { |
| 222 // TODO(cpu): disable other troublesome features for safe mode. | 225 // TODO(cpu): disable other troublesome features for safe mode. |
| 223 CommandLine::ForCurrentProcess()->AppendSwitch( | 226 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 224 switches::kDisableGpu); | 227 switches::kDisableGpu); |
| 225 } | 228 } |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 if (resource_id) | 441 if (resource_id) |
| 439 return l10n_util::GetStringUTF16(resource_id); | 442 return l10n_util::GetStringUTF16(resource_id); |
| 440 return base::string16(); | 443 return base::string16(); |
| 441 } | 444 } |
| 442 | 445 |
| 443 // static | 446 // static |
| 444 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 447 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 445 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 448 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 446 installer::SetTranslationDelegate(&delegate); | 449 installer::SetTranslationDelegate(&delegate); |
| 447 } | 450 } |
| OLD | NEW |