Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/internal_api/sync_manager.h" | 5 #include "chrome/browser/sync/internal_api/sync_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 780 | 780 |
| 781 bool signed_in = SignIn(credentials); | 781 bool signed_in = SignIn(credentials); |
| 782 | 782 |
| 783 if (signed_in && scheduler()) { | 783 if (signed_in && scheduler()) { |
| 784 scheduler()->Start( | 784 scheduler()->Start( |
| 785 browser_sync::SyncScheduler::CONFIGURATION_MODE, NULL); | 785 browser_sync::SyncScheduler::CONFIGURATION_MODE, NULL); |
| 786 } | 786 } |
| 787 | 787 |
| 788 initialized_ = true; | 788 initialized_ = true; |
| 789 | 789 |
| 790 // The following calls check that initialized_ is true. | |
|
Nicolas Zea
2011/08/25 01:22:46
We can get rid of this comment, it no longer appli
| |
| 791 | |
|
tim (not reviewing)
2011/08/25 15:42:43
remove extra newline.
| |
| 792 BootstrapEncryption(restored_key_for_bootstrapping); | |
| 793 | |
| 790 // Notify that initialization is complete. | 794 // Notify that initialization is complete. |
| 791 ObserverList<SyncManager::Observer> temp_obs_list; | 795 ObserverList<SyncManager::Observer> temp_obs_list; |
| 792 CopyObservers(&temp_obs_list); | 796 CopyObservers(&temp_obs_list); |
| 793 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list, | 797 FOR_EACH_OBSERVER(SyncManager::Observer, temp_obs_list, |
| 794 OnInitializationComplete( | 798 OnInitializationComplete( |
| 795 WeakHandle<JsBackend>(weak_ptr_factory_.GetWeakPtr()))); | 799 WeakHandle<JsBackend>(weak_ptr_factory_.GetWeakPtr()))); |
| 796 | 800 |
| 797 // The following calls check that initialized_ is true. | |
| 798 | |
| 799 BootstrapEncryption(restored_key_for_bootstrapping); | |
| 800 | |
| 801 sync_notifier_->AddObserver(this); | 801 sync_notifier_->AddObserver(this); |
| 802 | 802 |
| 803 return signed_in; | 803 return signed_in; |
| 804 } | 804 } |
| 805 | 805 |
| 806 void SyncManager::SyncInternal::BootstrapEncryption( | 806 void SyncManager::SyncInternal::BootstrapEncryption( |
| 807 const std::string& restored_key_for_bootstrapping) { | 807 const std::string& restored_key_for_bootstrapping) { |
| 808 // Cryptographer should only be accessed while holding a transaction. | 808 // Cryptographer should only be accessed while holding a transaction. |
| 809 ReadTransaction trans(FROM_HERE, GetUserShare()); | 809 ReadTransaction trans(FROM_HERE, GetUserShare()); |
| 810 Cryptographer* cryptographer = trans.GetCryptographer(); | 810 Cryptographer* cryptographer = trans.GetCryptographer(); |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2039 | 2039 |
| 2040 for (syncable::ModelTypeSet::const_iterator i = types.begin(); | 2040 for (syncable::ModelTypeSet::const_iterator i = types.begin(); |
| 2041 i != types.end(); ++i) { | 2041 i != types.end(); ++i) { |
| 2042 if (!lookup->initial_sync_ended_for_type(*i)) | 2042 if (!lookup->initial_sync_ended_for_type(*i)) |
| 2043 return false; | 2043 return false; |
| 2044 } | 2044 } |
| 2045 return true; | 2045 return true; |
| 2046 } | 2046 } |
| 2047 | 2047 |
| 2048 } // namespace sync_api | 2048 } // namespace sync_api |
| OLD | NEW |