Index: chrome/browser/ui/webui/help/version_updater_mac.mm |
diff --git a/chrome/browser/ui/webui/help/version_updater_mac.mm b/chrome/browser/ui/webui/help/version_updater_mac.mm |
index be9c08fae51df9624654a2f48ced5f131d66cfcf..a12e3304d6580bf276c3fc6d5cfb45bce8f8ca16 100644 |
--- a/chrome/browser/ui/webui/help/version_updater_mac.mm |
+++ b/chrome/browser/ui/webui/help/version_updater_mac.mm |
@@ -6,6 +6,8 @@ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
+#include "base/strings/stringprintf.h" |
+#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/lifetime/application_lifetime.h" |
#import "chrome/browser/mac/keystone_glue.h" |
#include "chrome/browser/obsolete_system/obsolete_system.h" |
@@ -132,6 +134,8 @@ void VersionUpdaterMac::RelaunchBrowser() const { |
void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) { |
AutoupdateStatus keystone_status = static_cast<AutoupdateStatus>( |
[[dictionary objectForKey:kAutoupdateStatusStatus] intValue]); |
+ const char* keystone_errors_utf8 = |
+ [[dictionary objectForKey:kAutoupdateStatusErrorMessages] UTF8String]; |
bool enable_promote_button = true; |
base::string16 message; |
@@ -211,6 +215,20 @@ void VersionUpdaterMac::UpdateStatus(NSDictionary* dictionary) { |
NOTREACHED(); |
return; |
} |
+ |
+ // If there are any specific error messages being passed along by Keystone, |
+ // include them in a <pre> block. |
+ if (!message.empty() && |
+ keystone_errors_utf8 && strlen(keystone_errors_utf8)) { |
+ // TODO: Should we localize the "Error details" string? If so, get the |
+ // string translated and into GRD, then replace this StringPrintf call |
+ // with a call to l10n_util::GetStringFUTF16(IDS_KEYSTONE_ERROR_DETAILS). |
+ std::string formatted_errors = |
+ base::StringPrintf("<br/><br/>Error details:<br/><pre>%s</pre>", |
+ keystone_errors_utf8); |
Boris Vidolov
2016/03/08 22:32:52
The code needs to sanitize the contents of keyston
|
+ message += base::UTF8ToUTF16(formatted_errors.c_str()); |
+ } |
+ |
if (!status_callback_.is_null()) |
status_callback_.Run(status, 0, message); |