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

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

Issue 22375004: Ensure sync footer visibility is always set correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 | « chrome/browser/ui/webui/welcome_handler_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/welcome_handler_android.cc
diff --git a/chrome/browser/ui/webui/welcome_handler_android.cc b/chrome/browser/ui/webui/welcome_handler_android.cc
index 4c05639861db5a8b5355c3a0babd2333a7ef6ddf..aca9068199f30f0a386cea8573ce0b259c570588 100644
--- a/chrome/browser/ui/webui/welcome_handler_android.cc
+++ b/chrome/browser/ui/webui/welcome_handler_android.cc
@@ -42,7 +42,7 @@ void WelcomeHandler::RegisterMessages() {
}
void WelcomeHandler::HandleUpdateSyncFooterVisibility(const ListValue* args) {
- OnStateChanged();
+ UpdateSyncFooterVisibility(true);
}
void WelcomeHandler::HandleShowSyncSettings(const ListValue* args) {
@@ -54,10 +54,14 @@ void WelcomeHandler::HandleShowTermsOfService(const ListValue* args) {
}
void WelcomeHandler::OnStateChanged() {
+ UpdateSyncFooterVisibility(false);
+}
+
+void WelcomeHandler::UpdateSyncFooterVisibility(bool forced) {
bool is_sync_enabled =
sync_service_ && sync_service_->IsSyncEnabledAndLoggedIn();
- if (is_sync_footer_visible_ != is_sync_enabled) {
+ if (forced || is_sync_footer_visible_ != is_sync_enabled) {
is_sync_footer_visible_ = is_sync_enabled;
web_ui()->CallJavascriptFunction("welcome.setSyncFooterVisible",
base::FundamentalValue(is_sync_enabled));
« no previous file with comments | « chrome/browser/ui/webui/welcome_handler_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698