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

Unified Diff: chrome/browser/sync/sync_ui_util.cc

Issue 2044003005: [Sync] Display correct message for actionable error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sync_ui_util.cc
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index 966ce9f4cf6483eb819f93dbea6712893d0d74e9..10f359bd74d19cfad92a2d317524a2b9b290d432 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -6,6 +6,8 @@
#include <stdint.h>
+#include <string>
+
#include "base/i18n/number_formatting.h"
#include "base/i18n/time_formatting.h"
#include "base/metrics/field_trial.h"
@@ -166,9 +168,19 @@ MessageType GetStatusInfo(Profile* profile,
if (service && service->HasUnrecoverableError()) {
if (status_label) {
- status_label->assign(l10n_util::GetStringFUTF16(
- IDS_SYNC_STATUS_UNRECOVERABLE_ERROR,
- l10n_util::GetStringUTF16(IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL)));
+ // Unrecoverable error is sometimes accompanied by actionable error.
+ // If actionable error is set then display corresponding message,
+ // otherwise show generic unrecoverable error message.
+ ProfileSyncService::Status status;
+ service->QueryDetailedSyncStatus(&status);
+ if (ShouldShowActionOnUI(status.sync_protocol_error)) {
+ GetStatusForActionableError(status.sync_protocol_error, status_label);
+ } else {
+ status_label->assign(l10n_util::GetStringFUTF16(
+ IDS_SYNC_STATUS_UNRECOVERABLE_ERROR,
+ l10n_util::GetStringUTF16(
+ IDS_SYNC_UNRECOVERABLE_ERROR_HELP_URL)));
+ }
}
return SYNC_ERROR;
}
« no previous file with comments | « no previous file | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698