| 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/first_run/first_run.h" | 25 #include "chrome/browser/first_run/first_run.h" |
| 26 #include "chrome/browser/metrics/metrics_service.h" | 26 #include "chrome/browser/metrics/metrics_service.h" |
| 27 #include "chrome/browser/profiles/profile_info_cache.h" | 27 #include "chrome/browser/profiles/profile_info_cache.h" |
| 28 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 28 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 29 #include "chrome/browser/shell_integration.h" | 29 #include "chrome/browser/shell_integration.h" |
| 30 #include "chrome/browser/storage_monitor/storage_monitor_win.h" | |
| 31 #include "chrome/browser/ui/simple_message_box.h" | 30 #include "chrome/browser/ui/simple_message_box.h" |
| 32 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 31 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
| 33 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
| 34 #include "chrome/common/chrome_result_codes.h" | 33 #include "chrome/common/chrome_result_codes.h" |
| 35 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 36 #include "chrome/common/env_vars.h" | 35 #include "chrome/common/env_vars.h" |
| 37 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | 36 #include "chrome/installer/launcher_support/chrome_launcher_support.h" |
| 38 #include "chrome/installer/util/browser_distribution.h" | 37 #include "chrome/installer/util/browser_distribution.h" |
| 39 #include "chrome/installer/util/helper.h" | 38 #include "chrome/installer/util/helper.h" |
| 40 #include "chrome/installer/util/install_util.h" | 39 #include "chrome/installer/util/install_util.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 // setup.exe. In Chrome, these strings are in the locale files. | 191 // setup.exe. In Chrome, these strings are in the locale files. |
| 193 SetupInstallerUtilStrings(); | 192 SetupInstallerUtilStrings(); |
| 194 | 193 |
| 195 ChromeBrowserMainParts::PreMainMessageLoopStart(); | 194 ChromeBrowserMainParts::PreMainMessageLoopStart(); |
| 196 if (!parameters().ui_task) { | 195 if (!parameters().ui_task) { |
| 197 // Make sure that we know how to handle exceptions from the message loop. | 196 // Make sure that we know how to handle exceptions from the message loop. |
| 198 InitializeWindowProcExceptions(); | 197 InitializeWindowProcExceptions(); |
| 199 } | 198 } |
| 200 } | 199 } |
| 201 | 200 |
| 202 void ChromeBrowserMainPartsWin::PreProfileInit() { | |
| 203 storage_monitor_.reset(chrome::StorageMonitorWin::Create()); | |
| 204 | |
| 205 ChromeBrowserMainParts::PreProfileInit(); | |
| 206 } | |
| 207 | |
| 208 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { | 201 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { |
| 209 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), | 202 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), |
| 210 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), | 203 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), |
| 211 MB_OK | MB_ICONERROR | MB_TOPMOST); | 204 MB_OK | MB_ICONERROR | MB_TOPMOST); |
| 212 } | 205 } |
| 213 | 206 |
| 214 // static | 207 // static |
| 215 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 208 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
| 216 const CommandLine& parsed_command_line) { | 209 const CommandLine& parsed_command_line) { |
| 217 // Clear this var so child processes don't show the dialog by default. | 210 // Clear this var so child processes don't show the dialog by default. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 if (resource_id) | 373 if (resource_id) |
| 381 return l10n_util::GetStringUTF16(resource_id); | 374 return l10n_util::GetStringUTF16(resource_id); |
| 382 return string16(); | 375 return string16(); |
| 383 } | 376 } |
| 384 | 377 |
| 385 // static | 378 // static |
| 386 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 379 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 387 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 380 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 388 installer::SetTranslationDelegate(&delegate); | 381 installer::SetTranslationDelegate(&delegate); |
| 389 } | 382 } |
| OLD | NEW |