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/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 const GoogleServiceAuthError& ProfileSyncService::GetAuthError() const { | 986 const GoogleServiceAuthError& ProfileSyncService::GetAuthError() const { |
987 return last_auth_error_; | 987 return last_auth_error_; |
988 } | 988 } |
989 | 989 |
990 bool ProfileSyncService::FirstSetupInProgress() const { | 990 bool ProfileSyncService::FirstSetupInProgress() const { |
991 return !HasSyncSetupCompleted() && setup_in_progress_; | 991 return !HasSyncSetupCompleted() && setup_in_progress_; |
992 } | 992 } |
993 | 993 |
994 void ProfileSyncService::SetSetupInProgress(bool setup_in_progress) { | 994 void ProfileSyncService::SetSetupInProgress(bool setup_in_progress) { |
| 995 bool was_in_progress = setup_in_progress_; |
995 setup_in_progress_ = setup_in_progress; | 996 setup_in_progress_ = setup_in_progress; |
996 if (!setup_in_progress) { | 997 if (!setup_in_progress && was_in_progress) { |
997 if (sync_initialized()) { | 998 if (sync_initialized()) { |
998 ReconfigureDatatypeManager(); | 999 ReconfigureDatatypeManager(); |
999 } | 1000 } |
1000 } | 1001 } |
1001 } | 1002 } |
1002 | 1003 |
1003 bool ProfileSyncService::sync_initialized() const { | 1004 bool ProfileSyncService::sync_initialized() const { |
1004 return backend_initialized_; | 1005 return backend_initialized_; |
1005 } | 1006 } |
1006 | 1007 |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1764 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
1764 ProfileSyncService* old_this = this; | 1765 ProfileSyncService* old_this = this; |
1765 this->~ProfileSyncService(); | 1766 this->~ProfileSyncService(); |
1766 new(old_this) ProfileSyncService( | 1767 new(old_this) ProfileSyncService( |
1767 new ProfileSyncComponentsFactoryImpl(profile, | 1768 new ProfileSyncComponentsFactoryImpl(profile, |
1768 CommandLine::ForCurrentProcess()), | 1769 CommandLine::ForCurrentProcess()), |
1769 profile, | 1770 profile, |
1770 signin, | 1771 signin, |
1771 behavior); | 1772 behavior); |
1772 } | 1773 } |
OLD | NEW |