| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |