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

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

Issue 6541088: When enabling password sync manually, use the passphrase migration flow to cr... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/sync/sync_setup_flow.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 722
723 // We will skip the passphrase prompt and suppress the warning 723 // We will skip the passphrase prompt and suppress the warning
724 // if the passphrase is needed for decryption but the user is 724 // if the passphrase is needed for decryption but the user is
725 // not syncing an encrypted data type on this machine. 725 // not syncing an encrypted data type on this machine.
726 // Otherwise we prompt. 726 // Otherwise we prompt.
727 if (!IsEncryptedDatatypeEnabled() && for_decryption) { 727 if (!IsEncryptedDatatypeEnabled() && for_decryption) {
728 OnPassphraseAccepted(); 728 OnPassphraseAccepted();
729 return; 729 return;
730 } 730 }
731 731
732 if (WizardIsVisible()) { 732 if (WizardIsVisible() && for_decryption) {
733 wizard_.Step(SyncSetupWizard::ENTER_PASSPHRASE); 733 wizard_.Step(SyncSetupWizard::ENTER_PASSPHRASE);
734 } else if (WizardIsVisible() && !for_decryption) {
735 SigninForPassphraseMigration(NULL);
tim (not reviewing) 2011/02/23 18:10:44 comment explaining why we do this would be nice
734 } 736 }
735 737
736 NotifyObservers(); 738 NotifyObservers();
737 } 739 }
738 740
739 void ProfileSyncService::OnPassphraseAccepted() { 741 void ProfileSyncService::OnPassphraseAccepted() {
740 // Make sure the data types that depend on the passphrase are started at 742 // Make sure the data types that depend on the passphrase are started at
741 // this time. 743 // this time.
742 syncable::ModelTypeSet types; 744 syncable::ModelTypeSet types;
743 GetPreferredDataTypes(&types); 745 GetPreferredDataTypes(&types);
(...skipping 11 matching lines...) Expand all
755 if (!cros_user_.empty()) { 757 if (!cros_user_.empty()) {
756 // For ChromeOS, any login UI needs to be handled by the settings page. 758 // For ChromeOS, any login UI needs to be handled by the settings page.
757 Browser* browser = BrowserList::GetLastActiveWithProfile(profile()); 759 Browser* browser = BrowserList::GetLastActiveWithProfile(profile());
758 if (browser) 760 if (browser)
759 browser->ShowOptionsTab(chrome::kPersonalOptionsSubPage); 761 browser->ShowOptionsTab(chrome::kPersonalOptionsSubPage);
760 return; 762 return;
761 } 763 }
762 764
763 if (WizardIsVisible()) { 765 if (WizardIsVisible()) {
764 wizard_.Focus(); 766 wizard_.Focus();
767 wizard_.Step(SyncSetupWizard::GAIA_LOGIN);
tim (not reviewing) 2011/02/23 18:10:44 Can you add a comment here why the step is necessa
765 return; 768 return;
766 } 769 }
767 770
768 if (!auth_error_time_.is_null()) { 771 if (!auth_error_time_.is_null()) {
769 UMA_HISTOGRAM_LONG_TIMES("Sync.ReauthorizationTime", 772 UMA_HISTOGRAM_LONG_TIMES("Sync.ReauthorizationTime",
770 base::TimeTicks::Now() - auth_error_time_); 773 base::TimeTicks::Now() - auth_error_time_);
771 auth_error_time_ = base::TimeTicks(); // Reset auth_error_time_ to null. 774 auth_error_time_ = base::TimeTicks(); // Reset auth_error_time_ to null.
772 } 775 }
773 776
774 wizard_.SetParent(parent_window); 777 wizard_.SetParent(parent_window);
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 // is initialized, all enabled data types are consistent with one 1321 // is initialized, all enabled data types are consistent with one
1319 // another, and no unrecoverable error has transpired. 1322 // another, and no unrecoverable error has transpired.
1320 if (unrecoverable_error_detected_) 1323 if (unrecoverable_error_detected_)
1321 return false; 1324 return false;
1322 1325
1323 if (!data_type_manager_.get()) 1326 if (!data_type_manager_.get())
1324 return false; 1327 return false;
1325 1328
1326 return data_type_manager_->state() == DataTypeManager::CONFIGURED; 1329 return data_type_manager_->state() == DataTypeManager::CONFIGURED;
1327 } 1330 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/sync_setup_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698