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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |