| 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 <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/common/chrome_features.h" | 50 #include "chrome/common/chrome_features.h" |
| 51 #include "chrome/common/chrome_paths.h" | 51 #include "chrome/common/chrome_paths.h" |
| 52 #include "chrome/common/chrome_result_codes.h" | 52 #include "chrome/common/chrome_result_codes.h" |
| 53 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
| 54 #include "chrome/common/chrome_utility_messages.h" | 54 #include "chrome/common/chrome_utility_messages.h" |
| 55 #include "chrome/common/conflicts/module_watcher_win.h" | 55 #include "chrome/common/conflicts/module_watcher_win.h" |
| 56 #include "chrome/common/crash_keys.h" | 56 #include "chrome/common/crash_keys.h" |
| 57 #include "chrome/common/env_vars.h" | 57 #include "chrome/common/env_vars.h" |
| 58 #include "chrome/grit/chromium_strings.h" | 58 #include "chrome/grit/chromium_strings.h" |
| 59 #include "chrome/grit/generated_resources.h" | 59 #include "chrome/grit/generated_resources.h" |
| 60 #include "chrome/install_static/install_details.h" |
| 60 #include "chrome/installer/util/browser_distribution.h" | 61 #include "chrome/installer/util/browser_distribution.h" |
| 61 #include "chrome/installer/util/helper.h" | 62 #include "chrome/installer/util/helper.h" |
| 62 #include "chrome/installer/util/install_util.h" | 63 #include "chrome/installer/util/install_util.h" |
| 63 #include "chrome/installer/util/installer_util_strings.h" | 64 #include "chrome/installer/util/installer_util_strings.h" |
| 64 #include "chrome/installer/util/l10n_string_util.h" | 65 #include "chrome/installer/util/l10n_string_util.h" |
| 65 #include "chrome/installer/util/shell_util.h" | 66 #include "chrome/installer/util/shell_util.h" |
| 66 #include "content/public/browser/browser_thread.h" | 67 #include "content/public/browser/browser_thread.h" |
| 67 #include "content/public/browser/utility_process_host.h" | 68 #include "content/public/browser/utility_process_host.h" |
| 68 #include "content/public/browser/utility_process_host_client.h" | 69 #include "content/public/browser/utility_process_host_client.h" |
| 69 #include "content/public/common/content_switches.h" | 70 #include "content/public/common/content_switches.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 315 } |
| 315 } | 316 } |
| 316 | 317 |
| 317 int ChromeBrowserMainPartsWin::PreCreateThreads() { | 318 int ChromeBrowserMainPartsWin::PreCreateThreads() { |
| 318 // Record whether the machine is enterprise managed in a crash key. This will | 319 // Record whether the machine is enterprise managed in a crash key. This will |
| 319 // be used to better identify whether crashes are from enterprise users. | 320 // be used to better identify whether crashes are from enterprise users. |
| 320 base::debug::SetCrashKeyValue( | 321 base::debug::SetCrashKeyValue( |
| 321 crash_keys::kIsEnterpriseManaged, | 322 crash_keys::kIsEnterpriseManaged, |
| 322 base::win::IsEnterpriseManaged() ? "yes" : "no"); | 323 base::win::IsEnterpriseManaged() ? "yes" : "no"); |
| 323 | 324 |
| 325 // Set crash keys containing the registry values used to determine Chrome's |
| 326 // update channel at process startup; see https://crbug.com/579504. |
| 327 const auto& details = install_static::InstallDetails::Get(); |
| 328 base::debug::SetCrashKeyValue(crash_keys::kApValue, |
| 329 base::UTF16ToUTF8(details.update_ap())); |
| 330 base::debug::SetCrashKeyValue( |
| 331 crash_keys::kCohortName, base::UTF16ToUTF8(details.update_cohort_name())); |
| 332 |
| 324 int rv = ChromeBrowserMainParts::PreCreateThreads(); | 333 int rv = ChromeBrowserMainParts::PreCreateThreads(); |
| 325 | 334 |
| 326 // TODO(viettrungluu): why don't we run this earlier? | 335 // TODO(viettrungluu): why don't we run this earlier? |
| 327 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && | 336 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && |
| 328 base::win::GetVersion() < base::win::VERSION_XP) { | 337 base::win::GetVersion() < base::win::VERSION_XP) { |
| 329 chrome::ShowWarningMessageBox( | 338 chrome::ShowWarningMessageBox( |
| 330 NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 339 NULL, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
| 331 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP)); | 340 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP)); |
| 332 } | 341 } |
| 333 | 342 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 if (resource_id) | 561 if (resource_id) |
| 553 return l10n_util::GetStringUTF16(resource_id); | 562 return l10n_util::GetStringUTF16(resource_id); |
| 554 return base::string16(); | 563 return base::string16(); |
| 555 } | 564 } |
| 556 | 565 |
| 557 // static | 566 // static |
| 558 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 567 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
| 559 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 568 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
| 560 installer::SetTranslationDelegate(&delegate); | 569 installer::SetTranslationDelegate(&delegate); |
| 561 } | 570 } |
| OLD | NEW |