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

Unified Diff: chrome/browser/ui/webui/history_login_handler.cc

Issue 2191173003: MD History: Get sign in state from backend when refreshing the page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/history_login_handler.cc
diff --git a/chrome/browser/ui/webui/history_login_handler.cc b/chrome/browser/ui/webui/history_login_handler.cc
index c83c72f2abcd227ceb4bec79a3daa6805cfe6ddd..40dc37b631d3b05ce0c6bdee3b1c6e4239f856fe 100644
--- a/chrome/browser/ui/webui/history_login_handler.cc
+++ b/chrome/browser/ui/webui/history_login_handler.cc
@@ -23,6 +23,9 @@ void HistoryLoginHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("otherDevicesInitialized",
base::Bind(&HistoryLoginHandler::HandleOtherDevicesInitialized,
base::Unretained(this)));
calamity 2016/07/29 05:14:59 Can we just reuse this message? It seems to be exa
lshang 2016/07/29 06:11:58 Done. I thought it would be a little confusing to
+ web_ui()->RegisterMessageCallback("getSignInState",
+ base::Bind(&HistoryLoginHandler::HandleGetSignInState,
+ base::Unretained(this)));
}
void HistoryLoginHandler::HandleOtherDevicesInitialized(
@@ -30,6 +33,11 @@ void HistoryLoginHandler::HandleOtherDevicesInitialized(
ProfileInfoChanged();
}
+void HistoryLoginHandler::HandleGetSignInState(
+ const base::ListValue* /*args*/) {
+ ProfileInfoChanged();
+}
+
void HistoryLoginHandler::ProfileInfoChanged() {
bool signed_in = !profile_info_watcher_->GetAuthenticatedUsername().empty();
web_ui()->CallJavascriptFunctionUnsafe("updateSignInState",

Powered by Google App Engine
This is Rietveld 408576698