| 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/files/file_util.h" | 15 #include "base/files/file_util.h" |
| 16 #include "base/i18n/rtl.h" | 16 #include "base/i18n/rtl.h" |
| 17 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
| 19 #include "base/path_service.h" | 20 #include "base/path_service.h" |
| 20 #include "base/scoped_native_library.h" | 21 #include "base/scoped_native_library.h" |
| 21 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/win/metro.h" | 24 #include "base/win/metro.h" |
| 24 #include "base/win/win_util.h" | 25 #include "base/win/win_util.h" |
| 25 #include "base/win/windows_version.h" | 26 #include "base/win/windows_version.h" |
| 26 #include "base/win/wrapped_window_proc.h" | 27 #include "base/win/wrapped_window_proc.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // installer_util references strings that are normally compiled into | 205 // installer_util references strings that are normally compiled into |
| 205 // setup.exe. In Chrome, these strings are in the locale files. | 206 // setup.exe. In Chrome, these strings are in the locale files. |
| 206 SetupInstallerUtilStrings(); | 207 SetupInstallerUtilStrings(); |
| 207 | 208 |
| 208 ChromeBrowserMainParts::PreMainMessageLoopStart(); | 209 ChromeBrowserMainParts::PreMainMessageLoopStart(); |
| 209 if (!parameters().ui_task) { | 210 if (!parameters().ui_task) { |
| 210 // Make sure that we know how to handle exceptions from the message loop. | 211 // Make sure that we know how to handle exceptions from the message loop. |
| 211 InitializeWindowProcExceptions(); | 212 InitializeWindowProcExceptions(); |
| 212 } | 213 } |
| 213 | 214 |
| 214 IncognitoModePrefs::InitializePlatformParentalControls(); | 215 // Prime the parental controls cache on Windows. |
| 216 ignore_result(IncognitoModePrefs::ArePlatformParentalControlsEnabled()); |
| 215 } | 217 } |
| 216 | 218 |
| 217 int ChromeBrowserMainPartsWin::PreCreateThreads() { | 219 int ChromeBrowserMainPartsWin::PreCreateThreads() { |
| 218 int rv = ChromeBrowserMainParts::PreCreateThreads(); | 220 int rv = ChromeBrowserMainParts::PreCreateThreads(); |
| 219 | 221 |
| 220 // TODO(viettrungluu): why don't we run this earlier? | 222 // TODO(viettrungluu): why don't we run this earlier? |
| 221 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && | 223 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && |
| 222 base::win::GetVersion() < base::win::VERSION_XP) { | 224 base::win::GetVersion() < base::win::VERSION_XP) { |
| 223 chrome::ShowMessageBox(NULL, | 225 chrome::ShowMessageBox(NULL, |
| 224 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 226 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 if (resource_id) | 459 if (resource_id) |
| 458 return l10n_util::GetStringUTF16(resource_id); | 460 return l10n_util::GetStringUTF16(resource_id); |
| 459 return base::string16(); | 461 return base::string16(); |
| 460 } | 462 } |
| 461 | 463 |
| 462 // static | 464 // static |
| 463 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 465 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 464 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 466 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 465 installer::SetTranslationDelegate(&delegate); | 467 installer::SetTranslationDelegate(&delegate); |
| 466 } | 468 } |
| OLD | NEW |