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/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 return; | 822 return; |
823 } | 823 } |
824 #endif | 824 #endif |
825 | 825 |
826 // Bring up the existing wizard, or just display it on this page. | 826 // Bring up the existing wizard, or just display it on this page. |
827 if (!FocusExistingWizardIfPresent()) | 827 if (!FocusExistingWizardIfPresent()) |
828 OpenSyncSetup(false); | 828 OpenSyncSetup(false); |
829 } | 829 } |
830 | 830 |
831 void SyncSetupHandler::HandleShowSetupUI(const ListValue* args) { | 831 void SyncSetupHandler::HandleShowSetupUI(const ListValue* args) { |
832 DCHECK(!configuring_sync_); | |
833 OpenSyncSetup(false); | 832 OpenSyncSetup(false); |
834 } | 833 } |
835 | 834 |
836 void SyncSetupHandler::HandleStopSyncing(const ListValue* args) { | 835 void SyncSetupHandler::HandleStopSyncing(const ListValue* args) { |
837 ProfileSyncService* service = GetSyncService(); | 836 ProfileSyncService* service = GetSyncService(); |
838 DCHECK(service); | 837 DCHECK(service); |
839 | 838 |
840 if (ProfileSyncService::IsSyncEnabled()) { | 839 if (ProfileSyncService::IsSyncEnabled()) { |
841 service->DisableForUser(); | 840 service->DisableForUser(); |
842 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); | 841 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 if (i != current_profile_index && AreUserNamesEqual( | 1004 if (i != current_profile_index && AreUserNamesEqual( |
1006 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { | 1005 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { |
1007 *error_message = l10n_util::GetStringUTF16( | 1006 *error_message = l10n_util::GetStringUTF16( |
1008 IDS_SYNC_USER_NAME_IN_USE_ERROR); | 1007 IDS_SYNC_USER_NAME_IN_USE_ERROR); |
1009 return false; | 1008 return false; |
1010 } | 1009 } |
1011 } | 1010 } |
1012 | 1011 |
1013 return true; | 1012 return true; |
1014 } | 1013 } |
OLD | NEW |