| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 base::Bind(&PeopleHandler::HandleShowSetupUI, base::Unretained(this))); | 206 base::Bind(&PeopleHandler::HandleShowSetupUI, base::Unretained(this))); |
| 207 web_ui()->RegisterMessageCallback( | 207 web_ui()->RegisterMessageCallback( |
| 208 "SyncSetupGetSyncStatus", | 208 "SyncSetupGetSyncStatus", |
| 209 base::Bind(&PeopleHandler::HandleGetSyncStatus, base::Unretained(this))); | 209 base::Bind(&PeopleHandler::HandleGetSyncStatus, base::Unretained(this))); |
| 210 web_ui()->RegisterMessageCallback( | 210 web_ui()->RegisterMessageCallback( |
| 211 "SyncSetupManageOtherPeople", | 211 "SyncSetupManageOtherPeople", |
| 212 base::Bind(&PeopleHandler::HandleManageOtherPeople, | 212 base::Bind(&PeopleHandler::HandleManageOtherPeople, |
| 213 base::Unretained(this))); | 213 base::Unretained(this))); |
| 214 #if defined(OS_CHROMEOS) | 214 #if defined(OS_CHROMEOS) |
| 215 web_ui()->RegisterMessageCallback( | 215 web_ui()->RegisterMessageCallback( |
| 216 "SyncSetupDoSignOutOnAuthError", | 216 "AttemptUserExit", |
| 217 base::Bind(&PeopleHandler::HandleDoSignOutOnAuthError, | 217 base::Bind(&PeopleHandler::HandleAttemptUserExit, |
| 218 base::Unretained(this))); | 218 base::Unretained(this))); |
| 219 #else | 219 #else |
| 220 web_ui()->RegisterMessageCallback( | 220 web_ui()->RegisterMessageCallback( |
| 221 "SyncSetupStopSyncing", | 221 "SyncSetupStopSyncing", |
| 222 base::Bind(&PeopleHandler::HandleStopSyncing, base::Unretained(this))); | 222 base::Bind(&PeopleHandler::HandleStopSyncing, base::Unretained(this))); |
| 223 web_ui()->RegisterMessageCallback( | 223 web_ui()->RegisterMessageCallback( |
| 224 "SyncSetupStartSignIn", | 224 "SyncSetupStartSignIn", |
| 225 base::Bind(&PeopleHandler::HandleStartSignin, base::Unretained(this))); | 225 base::Bind(&PeopleHandler::HandleStartSignin, base::Unretained(this))); |
| 226 #endif | 226 #endif |
| 227 } | 227 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 CloseUI(); | 504 CloseUI(); |
| 505 return; | 505 return; |
| 506 } | 506 } |
| 507 | 507 |
| 508 OpenSyncSetup(false /* creating_supervised_user */); | 508 OpenSyncSetup(false /* creating_supervised_user */); |
| 509 } | 509 } |
| 510 | 510 |
| 511 #if defined(OS_CHROMEOS) | 511 #if defined(OS_CHROMEOS) |
| 512 // On ChromeOS, we need to sign out the user session to fix an auth error, so | 512 // On ChromeOS, we need to sign out the user session to fix an auth error, so |
| 513 // the user goes through the real signin flow to generate a new auth token. | 513 // the user goes through the real signin flow to generate a new auth token. |
| 514 void PeopleHandler::HandleDoSignOutOnAuthError(const base::ListValue* args) { | 514 void PeopleHandler::HandleAttemptUserExit(const base::ListValue* args) { |
| 515 DVLOG(1) << "Signing out the user to fix a sync error."; | 515 DVLOG(1) << "Signing out the user to fix a sync error."; |
| 516 chrome::AttemptUserExit(); | 516 chrome::AttemptUserExit(); |
| 517 } | 517 } |
| 518 #endif | 518 #endif |
| 519 | 519 |
| 520 #if !defined(OS_CHROMEOS) | 520 #if !defined(OS_CHROMEOS) |
| 521 void PeopleHandler::HandleStartSignin(const base::ListValue* args) { | 521 void PeopleHandler::HandleStartSignin(const base::ListValue* args) { |
| 522 AllowJavascript(); | 522 AllowJavascript(); |
| 523 | 523 |
| 524 // Should only be called if the user is not already signed in. | 524 // Should only be called if the user is not already signed in. |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 base::FilePath profile_file_path = profile_->GetPath(); | 913 base::FilePath profile_file_path = profile_->GetPath(); |
| 914 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); | 914 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); |
| 915 | 915 |
| 916 // We're done configuring, so notify ProfileSyncService that it is OK to | 916 // We're done configuring, so notify ProfileSyncService that it is OK to |
| 917 // start syncing. | 917 // start syncing. |
| 918 sync_blocker_.reset(); | 918 sync_blocker_.reset(); |
| 919 service->SetFirstSetupComplete(); | 919 service->SetFirstSetupComplete(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 } // namespace settings | 922 } // namespace settings |
| OLD | NEW |