Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 7193031: Move UI specific implementation from ProfileSyncService to SyncSetupFlowHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor ShowSyncSetup Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sync/profile_sync_service.h" 5 #include "chrome/browser/sync/profile_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <map> 8 #include <map>
9 #include <ostream> 9 #include <ostream>
10 #include <set> 10 #include <set>
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 wizard_.Step(SyncSetupWizard::GAIA_LOGIN); 813 wizard_.Step(SyncSetupWizard::GAIA_LOGIN);
814 return; 814 return;
815 } 815 }
816 816
817 if (!auth_error_time_.is_null()) { 817 if (!auth_error_time_.is_null()) {
818 UMA_HISTOGRAM_LONG_TIMES("Sync.ReauthorizationTime", 818 UMA_HISTOGRAM_LONG_TIMES("Sync.ReauthorizationTime",
819 base::TimeTicks::Now() - auth_error_time_); 819 base::TimeTicks::Now() - auth_error_time_);
820 auth_error_time_ = base::TimeTicks(); // Reset auth_error_time_ to null. 820 auth_error_time_ = base::TimeTicks(); // Reset auth_error_time_ to null.
821 } 821 }
822 822
823 ShowSyncSetup(SyncSetupWizard::GAIA_LOGIN); 823 wizard_.ShowSyncSetup(SyncSetupWizard::GAIA_LOGIN);
824 824
825 NotifyObservers(); 825 NotifyObservers();
826 } 826 }
827 827
828 void ProfileSyncService::ShowErrorUI() { 828 void ProfileSyncService::ShowErrorUI() {
829 if (WizardIsVisible()) { 829 wizard_.ShowSyncSetup(SyncSetupWizard::NONFATAL_ERROR);
Andrew T Wilson (Slow) 2011/07/11 18:12:51 Now that these methods are basically just dumb wra
830 wizard_.Focus();
831 return;
832 }
833
834 ShowSyncSetup(SyncSetupWizard::NONFATAL_ERROR);
835 } 830 }
836 831
837 void ProfileSyncService::ShowConfigure(bool sync_everything) { 832 void ProfileSyncService::ShowConfigure(bool sync_everything) {
838 if (WizardIsVisible()) {
839 wizard_.Focus();
840 return;
841 }
842
843 if (sync_everything) 833 if (sync_everything)
844 ShowSyncSetup(SyncSetupWizard::SYNC_EVERYTHING); 834 wizard_.ShowSyncSetup(SyncSetupWizard::SYNC_EVERYTHING);
845 else 835 else
846 ShowSyncSetup(SyncSetupWizard::CONFIGURE); 836 wizard_.ShowSyncSetup(SyncSetupWizard::CONFIGURE);
847 } 837 }
848 838
849 void ProfileSyncService::PromptForExistingPassphrase() { 839 void ProfileSyncService::PromptForExistingPassphrase() {
850 if (WizardIsVisible()) { 840 wizard_.ShowSyncSetup(SyncSetupWizard::ENTER_PASSPHRASE);
851 wizard_.Focus();
852 return;
853 }
854
855 ShowSyncSetup(SyncSetupWizard::ENTER_PASSPHRASE);
856 }
857
858 void ProfileSyncService::ShowSyncSetup(SyncSetupWizard::State state) {
859 wizard_.Step(state);
860 BrowserList::GetLastActiveWithProfile(profile())->ShowOptionsTab(
861 chrome::kSyncSetupSubPage);
862 } 841 }
863 842
864 SyncBackendHost::StatusSummary ProfileSyncService::QuerySyncStatusSummary() { 843 SyncBackendHost::StatusSummary ProfileSyncService::QuerySyncStatusSummary() {
865 if (backend_.get() && backend_initialized_) 844 if (backend_.get() && backend_initialized_)
866 return backend_->GetStatusSummary(); 845 return backend_->GetStatusSummary();
867 else 846 else
868 return SyncBackendHost::Status::OFFLINE_UNUSABLE; 847 return SyncBackendHost::Status::OFFLINE_UNUSABLE;
869 } 848 }
870 849
871 SyncBackendHost::Status ProfileSyncService::QueryDetailedSyncStatus() { 850 SyncBackendHost::Status ProfileSyncService::QueryDetailedSyncStatus() {
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 // is initialized, all enabled data types are consistent with one 1377 // is initialized, all enabled data types are consistent with one
1399 // another, and no unrecoverable error has transpired. 1378 // another, and no unrecoverable error has transpired.
1400 if (unrecoverable_error_detected_) 1379 if (unrecoverable_error_detected_)
1401 return false; 1380 return false;
1402 1381
1403 if (!data_type_manager_.get()) 1382 if (!data_type_manager_.get())
1404 return false; 1383 return false;
1405 1384
1406 return data_type_manager_->state() == DataTypeManager::CONFIGURED; 1385 return data_type_manager_->state() == DataTypeManager::CONFIGURED;
1407 } 1386 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698