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

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

Issue 7792093: Moved the handling of the initial passphrase into SyncSetupFlow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Painful merge after phajdan's last-minute huge bulk file move. Created 9 years, 3 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_harness.h" 5 #include "chrome/browser/sync/profile_sync_service_harness.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <iterator> 9 #include <iterator>
10 #include <ostream> 10 #include <ostream>
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return false; 190 return false;
191 } 191 }
192 192
193 // Make sure that a partner client hasn't already set an explicit passphrase. 193 // Make sure that a partner client hasn't already set an explicit passphrase.
194 if (wait_state_ == SET_PASSPHRASE_FAILED) { 194 if (wait_state_ == SET_PASSPHRASE_FAILED) {
195 LOG(ERROR) << "A passphrase is required for decryption. Sync cannot proceed" 195 LOG(ERROR) << "A passphrase is required for decryption. Sync cannot proceed"
196 " until SetPassphrase is called."; 196 " until SetPassphrase is called.";
197 return false; 197 return false;
198 } 198 }
199 199
200 // Set our implicit passphrase.
201 service_->SetPassphrase(password_, false);
202
200 // Wait for initial sync cycle to be completed. 203 // Wait for initial sync cycle to be completed.
201 DCHECK_EQ(wait_state_, WAITING_FOR_INITIAL_SYNC); 204 DCHECK_EQ(wait_state_, WAITING_FOR_INITIAL_SYNC);
202 if (!AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs, 205 if (!AwaitStatusChangeWithTimeout(kLiveSyncOperationTimeoutMs,
203 "Waiting for initial sync cycle to complete.")) { 206 "Waiting for initial sync cycle to complete.")) {
204 LOG(ERROR) << "Initial sync cycle did not complete after " 207 LOG(ERROR) << "Initial sync cycle did not complete after "
205 << kLiveSyncOperationTimeoutMs / 1000 208 << kLiveSyncOperationTimeoutMs / 1000
206 << " seconds."; 209 << " seconds.";
207 return false; 210 return false;
208 } 211 }
209 212
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 return (synced_types.count(type) != 0); 1039 return (synced_types.count(type) != 0);
1037 } 1040 }
1038 1041
1039 std::string ProfileSyncServiceHarness::GetServiceStatus() { 1042 std::string ProfileSyncServiceHarness::GetServiceStatus() {
1040 DictionaryValue value; 1043 DictionaryValue value;
1041 sync_ui_util::ConstructAboutInformation(service_, &value); 1044 sync_ui_util::ConstructAboutInformation(service_, &value);
1042 std::string service_status; 1045 std::string service_status;
1043 base::JSONWriter::Write(&value, true, &service_status); 1046 base::JSONWriter::Write(&value, true, &service_status);
1044 return service_status; 1047 return service_status;
1045 } 1048 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_password_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698