| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 // On ChromeOS, we need to sign out the user session to fix an auth error, so | 497 // On ChromeOS, we need to sign out the user session to fix an auth error, so |
| 498 // the user goes through the real signin flow to generate a new auth token. | 498 // the user goes through the real signin flow to generate a new auth token. |
| 499 void PeopleHandler::HandleDoSignOutOnAuthError(const base::ListValue* args) { | 499 void PeopleHandler::HandleDoSignOutOnAuthError(const base::ListValue* args) { |
| 500 DVLOG(1) << "Signing out the user to fix a sync error."; | 500 DVLOG(1) << "Signing out the user to fix a sync error."; |
| 501 chrome::AttemptUserExit(); | 501 chrome::AttemptUserExit(); |
| 502 } | 502 } |
| 503 #endif | 503 #endif |
| 504 | 504 |
| 505 #if !defined(OS_CHROMEOS) | 505 #if !defined(OS_CHROMEOS) |
| 506 void PeopleHandler::HandleStartSignin(const base::ListValue* args) { | 506 void PeopleHandler::HandleStartSignin(const base::ListValue* args) { |
| 507 AllowJavascript(); |
| 508 |
| 507 // Should only be called if the user is not already signed in. | 509 // Should only be called if the user is not already signed in. |
| 508 DCHECK(!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated()); | 510 DCHECK(!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated()); |
| 509 bool creating_supervised_user = false; | 511 bool creating_supervised_user = false; |
| 510 args->GetBoolean(0, &creating_supervised_user); | 512 args->GetBoolean(0, &creating_supervised_user); |
| 511 OpenSyncSetup(creating_supervised_user); | 513 OpenSyncSetup(creating_supervised_user); |
| 512 } | 514 } |
| 513 | 515 |
| 514 void PeopleHandler::HandleStopSyncing(const base::ListValue* args) { | 516 void PeopleHandler::HandleStopSyncing(const base::ListValue* args) { |
| 515 if (GetSyncService()) | 517 if (GetSyncService()) |
| 516 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); | 518 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 base::FilePath profile_file_path = profile_->GetPath(); | 892 base::FilePath profile_file_path = profile_->GetPath(); |
| 891 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); | 893 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); |
| 892 | 894 |
| 893 // We're done configuring, so notify ProfileSyncService that it is OK to | 895 // We're done configuring, so notify ProfileSyncService that it is OK to |
| 894 // start syncing. | 896 // start syncing. |
| 895 sync_blocker_.reset(); | 897 sync_blocker_.reset(); |
| 896 service->SetFirstSetupComplete(); | 898 service->SetFirstSetupComplete(); |
| 897 } | 899 } |
| 898 | 900 |
| 899 } // namespace settings | 901 } // namespace settings |
| OLD | NEW |