Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Side by Side Diff: chrome/browser/google/google_update_win.cc

Issue 1212783003: Make Win HRESULT into link to help-center. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: create link in updater where hresult is known Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/url_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/google/google_update_win.h" 5 #include "chrome/browser/google/google_update_win.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/metrics/sparse_histogram.h" 15 #include "base/metrics/sparse_histogram.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/sequenced_task_runner_helpers.h" 17 #include "base/sequenced_task_runner_helpers.h"
18 #include "base/single_thread_task_runner.h" 18 #include "base/single_thread_task_runner.h"
19 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
20 #include "base/strings/stringprintf.h" 20 #include "base/strings/stringprintf.h"
21 #include "base/strings/utf_string_conversions.h" 21 #include "base/strings/utf_string_conversions.h"
22 #include "base/thread_task_runner_handle.h" 22 #include "base/thread_task_runner_handle.h"
23 #include "base/time/time.h" 23 #include "base/time/time.h"
24 #include "base/win/scoped_bstr.h" 24 #include "base/win/scoped_bstr.h"
25 #include "base/win/windows_version.h" 25 #include "base/win/windows_version.h"
26 #include "chrome/common/url_constants.h"
26 #include "chrome/grit/generated_resources.h" 27 #include "chrome/grit/generated_resources.h"
27 #include "chrome/installer/util/browser_distribution.h" 28 #include "chrome/installer/util/browser_distribution.h"
28 #include "chrome/installer/util/helper.h" 29 #include "chrome/installer/util/helper.h"
29 #include "chrome/installer/util/install_util.h" 30 #include "chrome/installer/util/install_util.h"
30 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
31 #include "ui/base/win/atl_module.h" 32 #include "ui/base/win/atl_module.h"
32 #include "ui/gfx/geometry/safe_integer_conversions.h" 33 #include "ui/gfx/geometry/safe_integer_conversions.h"
33 34
34 namespace { 35 namespace {
35 36
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 713
713 void UpdateCheckDriver::OnUpgradeError(GoogleUpdateErrorCode error_code, 714 void UpdateCheckDriver::OnUpgradeError(GoogleUpdateErrorCode error_code,
714 HRESULT hresult, 715 HRESULT hresult,
715 int installer_exit_code, 716 int installer_exit_code,
716 const base::string16& error_string) { 717 const base::string16& error_string) {
717 status_ = UPGRADE_ERROR; 718 status_ = UPGRADE_ERROR;
718 error_code_ = error_code; 719 error_code_ = error_code;
719 hresult_ = hresult; 720 hresult_ = hresult;
720 installer_exit_code_ = installer_exit_code; 721 installer_exit_code_ = installer_exit_code;
721 base::string16 error_msg = 722 base::string16 error_msg =
722 base::StringPrintf(L"%d: 0x%x", error_code_, hresult_); 723 base::StringPrintf(L"%d: <a href='%s0x%X' target=_blank>0x%X</a>",
724 error_code_, base::UTF8ToUTF16(
725 chrome::kUpgradeHelpCenterBaseURL).c_str(),
726 hresult_, hresult_);
723 if (installer_exit_code_ != -1) 727 if (installer_exit_code_ != -1)
724 error_msg += base::StringPrintf(L": %d", installer_exit_code_); 728 error_msg += base::StringPrintf(L": %d", installer_exit_code_);
725 if (system_level_install_) 729 if (system_level_install_)
726 error_msg += L" -- system level"; 730 error_msg += L" -- system level";
727 if (error_string.empty()) { 731 if (error_string.empty()) {
728 error_message_ = l10n_util::GetStringFUTF16( 732 error_message_ = l10n_util::GetStringFUTF16(
729 IDS_ABOUT_BOX_ERROR_UPDATE_CHECK_FAILED, error_msg); 733 IDS_ABOUT_BOX_ERROR_UPDATE_CHECK_FAILED, error_msg);
730 } else { 734 } else {
731 error_message_ = l10n_util::GetStringFUTF16( 735 error_message_ = l10n_util::GetStringFUTF16(
732 IDS_ABOUT_BOX_GOOGLE_UPDATE_ERROR, error_string, error_msg); 736 IDS_ABOUT_BOX_GOOGLE_UPDATE_ERROR, error_string, error_msg);
(...skipping 23 matching lines...) Expand all
756 const GoogleUpdate3ClassFactory& google_update_factory) { 760 const GoogleUpdate3ClassFactory& google_update_factory) {
757 if (g_google_update_factory) { 761 if (g_google_update_factory) {
758 delete g_google_update_factory; 762 delete g_google_update_factory;
759 g_google_update_factory = nullptr; 763 g_google_update_factory = nullptr;
760 } 764 }
761 if (!google_update_factory.is_null()) { 765 if (!google_update_factory.is_null()) {
762 g_google_update_factory = 766 g_google_update_factory =
763 new GoogleUpdate3ClassFactory(google_update_factory); 767 new GoogleUpdate3ClassFactory(google_update_factory);
764 } 768 }
765 } 769 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698