| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/options/sync_setup_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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 #if defined(OS_CHROMEOS) | 640 #if defined(OS_CHROMEOS) |
| 641 // On ChromeOS, we need to sign out the user session to fix an auth error, so | 641 // On ChromeOS, we need to sign out the user session to fix an auth error, so |
| 642 // the user goes through the real signin flow to generate a new auth token. | 642 // the user goes through the real signin flow to generate a new auth token. |
| 643 void SyncSetupHandler::HandleAttemptUserExit(const base::ListValue* args) { | 643 void SyncSetupHandler::HandleAttemptUserExit(const base::ListValue* args) { |
| 644 chrome::AttemptUserExit(); | 644 chrome::AttemptUserExit(); |
| 645 } | 645 } |
| 646 #endif | 646 #endif |
| 647 | 647 |
| 648 #if !defined(OS_CHROMEOS) | 648 #if !defined(OS_CHROMEOS) |
| 649 void SyncSetupHandler::HandleStartSignin(const base::ListValue* args) { | 649 void SyncSetupHandler::HandleStartSignin(const base::ListValue* args) { |
| 650 // Should only be called if the user is not already signed in. | 650 // Should only be called if the user is not already signed in or has an auth |
| 651 DCHECK(!SigninManagerFactory::GetForProfile(GetProfile())->IsAuthenticated()); | 651 // error. |
| 652 DCHECK( |
| 653 !SigninManagerFactory::GetForProfile(GetProfile())->IsAuthenticated() || |
| 654 SigninErrorControllerFactory::GetForProfile(GetProfile())->HasError()); |
| 652 bool creating_supervised_user = false; | 655 bool creating_supervised_user = false; |
| 653 args->GetBoolean(0, &creating_supervised_user); | 656 args->GetBoolean(0, &creating_supervised_user); |
| 654 OpenSyncSetup(creating_supervised_user); | 657 OpenSyncSetup(creating_supervised_user); |
| 655 } | 658 } |
| 656 | 659 |
| 657 void SyncSetupHandler::HandleStopSyncing(const base::ListValue* args) { | 660 void SyncSetupHandler::HandleStopSyncing(const base::ListValue* args) { |
| 658 if (GetSyncService()) | 661 if (GetSyncService()) |
| 659 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); | 662 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); |
| 660 | 663 |
| 661 bool delete_profile = false; | 664 bool delete_profile = false; |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 page, args); | 947 page, args); |
| 945 | 948 |
| 946 // Make sure the tab used for the Gaia sign in does not cover the settings | 949 // Make sure the tab used for the Gaia sign in does not cover the settings |
| 947 // tab. | 950 // tab. |
| 948 FocusUI(); | 951 FocusUI(); |
| 949 } | 952 } |
| 950 | 953 |
| 951 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 954 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
| 952 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 955 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
| 953 } | 956 } |
| OLD | NEW |