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

Unified Diff: chrome/browser/ui/webui/settings/people_handler.cc

Issue 2457483002: [MD Settings][Sync Settings] Updates sync status messages (Closed)
Patch Set: Created 4 years, 2 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
Index: chrome/browser/ui/webui/settings/people_handler.cc
diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc
index 55ebfe8cc730bdb06ba1a7e24bf6a7ee4473c378..2e0cf50d52bb47729f106464c002fae8febd658d 100644
--- a/chrome/browser/ui/webui/settings/people_handler.cc
+++ b/chrome/browser/ui/webui/settings/people_handler.cc
@@ -152,6 +152,19 @@ void ParseConfigurationArguments(const base::ListValue* args,
NOTREACHED();
}
+std::string getSyncErrorAction(sync_ui_util::ActionType actionType) {
+ switch (actionType) {
+ case sync_ui_util::REAUTHENTICATE:
+ return std::string("reauthenticate");
tommycli 2016/10/28 21:21:09 nit: are you sure it's necessary to wrap all these
Moe 2016/11/01 19:44:01 Done.
+ case sync_ui_util::UPGRADE_CLIENT:
+ return std::string("upgradeClient");
+ case sync_ui_util::ENTER_PASSPHRASE:
+ return std::string("enterPassphrase");
+ default:
+ return std::string("noAction");
+ }
+}
+
} // namespace
namespace settings {
@@ -731,13 +744,15 @@ PeopleHandler::GetSyncStatusDictionary() {
base::string16 status_label;
base::string16 link_label;
+ sync_ui_util::ActionType actionType(sync_ui_util::NO_ACTION);
bool status_has_error =
sync_ui_util::GetStatusLabels(profile_, service, *signin,
sync_ui_util::PLAIN_TEXT, &status_label,
- &link_label) == sync_ui_util::SYNC_ERROR;
+ &link_label, &actionType) ==
+ sync_ui_util::SYNC_ERROR;
sync_status->SetString("statusText", status_label);
- sync_status->SetString("actionLinkText", link_label);
sync_status->SetBoolean("hasError", status_has_error);
+ sync_status->SetString("statusAction", getSyncErrorAction(actionType));
sync_status->SetBoolean("managed", service && service->IsManaged());
sync_status->SetBoolean("signedIn", signin->IsAuthenticated());

Powered by Google App Engine
This is Rietveld 408576698