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

Side by Side Diff: chrome/browser/ui/webui/settings/people_handler.cc

Issue 2393643004: [MD Settings][People] Updates positions of username and sync status message (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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/settings/people_handler.h" 5 #include "chrome/browser/ui/webui/settings/people_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 bool status_has_error = 733 bool status_has_error =
734 sync_ui_util::GetStatusLabels(profile_, service, *signin, 734 sync_ui_util::GetStatusLabels(profile_, service, *signin,
735 sync_ui_util::PLAIN_TEXT, &status_label, 735 sync_ui_util::PLAIN_TEXT, &status_label,
736 &link_label) == sync_ui_util::SYNC_ERROR; 736 &link_label) == sync_ui_util::SYNC_ERROR;
737 sync_status->SetString("statusText", status_label); 737 sync_status->SetString("statusText", status_label);
738 sync_status->SetString("actionLinkText", link_label); 738 sync_status->SetString("actionLinkText", link_label);
739 sync_status->SetBoolean("hasError", status_has_error); 739 sync_status->SetBoolean("hasError", status_has_error);
740 740
741 sync_status->SetBoolean("managed", service && service->IsManaged()); 741 sync_status->SetBoolean("managed", service && service->IsManaged());
742 sync_status->SetBoolean("signedIn", signin->IsAuthenticated()); 742 sync_status->SetBoolean("signedIn", signin->IsAuthenticated());
743 sync_status->SetString("username",
744 sync_ui_util::GetAuthenticatedUsername(signin));
743 sync_status->SetBoolean("hasUnrecoverableError", 745 sync_status->SetBoolean("hasUnrecoverableError",
744 service && service->HasUnrecoverableError()); 746 service && service->HasUnrecoverableError());
745 747
746 return sync_status; 748 return sync_status;
747 } 749 }
748 750
749 void PeopleHandler::PushSyncPrefs() { 751 void PeopleHandler::PushSyncPrefs() {
750 #if !defined(OS_CHROMEOS) 752 #if !defined(OS_CHROMEOS)
751 // Early exit if the user has not signed in yet. 753 // Early exit if the user has not signed in yet.
752 if (!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated() || 754 if (!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated() ||
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 base::FilePath profile_file_path = profile_->GetPath(); 900 base::FilePath profile_file_path = profile_->GetPath();
899 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); 901 ProfileMetrics::LogProfileSyncSignIn(profile_file_path);
900 902
901 // We're done configuring, so notify ProfileSyncService that it is OK to 903 // We're done configuring, so notify ProfileSyncService that it is OK to
902 // start syncing. 904 // start syncing.
903 sync_blocker_.reset(); 905 sync_blocker_.reset();
904 service->SetFirstSetupComplete(); 906 service->SetFirstSetupComplete();
905 } 907 }
906 908
907 } // namespace settings 909 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698