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 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 switch (status) { | 998 switch (status) { |
999 case syncer::CONNECTION_OK: | 999 case syncer::CONNECTION_OK: |
1000 return AuthError::AuthErrorNone(); | 1000 return AuthError::AuthErrorNone(); |
1001 break; | 1001 break; |
1002 case syncer::CONNECTION_AUTH_ERROR: | 1002 case syncer::CONNECTION_AUTH_ERROR: |
1003 return AuthError(AuthError::INVALID_GAIA_CREDENTIALS); | 1003 return AuthError(AuthError::INVALID_GAIA_CREDENTIALS); |
1004 break; | 1004 break; |
1005 case syncer::CONNECTION_SERVER_ERROR: | 1005 case syncer::CONNECTION_SERVER_ERROR: |
1006 return AuthError(AuthError::CONNECTION_FAILED); | 1006 return AuthError(AuthError::CONNECTION_FAILED); |
1007 break; | 1007 break; |
1008 default: | |
1009 NOTREACHED(); | |
1010 return AuthError(AuthError::CONNECTION_FAILED); | |
1011 } | 1008 } |
| 1009 |
| 1010 NOTREACHED(); |
| 1011 return AuthError(AuthError::CONNECTION_FAILED); |
1012 } | 1012 } |
1013 | 1013 |
1014 } // namespace | 1014 } // namespace |
1015 | 1015 |
1016 void ProfileSyncService::OnConnectionStatusChange( | 1016 void ProfileSyncService::OnConnectionStatusChange( |
1017 syncer::ConnectionStatus status) { | 1017 syncer::ConnectionStatus status) { |
1018 const GoogleServiceAuthError auth_error = | 1018 const GoogleServiceAuthError auth_error = |
1019 ConnectionStatusToAuthError(status); | 1019 ConnectionStatusToAuthError(status); |
1020 DVLOG(1) << "Connection status change: " << auth_error.ToString(); | 1020 DVLOG(1) << "Connection status change: " << auth_error.ToString(); |
1021 UpdateAuthErrorState(auth_error); | 1021 UpdateAuthErrorState(auth_error); |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 2026 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
2027 ProfileSyncService* old_this = this; | 2027 ProfileSyncService* old_this = this; |
2028 this->~ProfileSyncService(); | 2028 this->~ProfileSyncService(); |
2029 new(old_this) ProfileSyncService( | 2029 new(old_this) ProfileSyncService( |
2030 new ProfileSyncComponentsFactoryImpl(profile, | 2030 new ProfileSyncComponentsFactoryImpl(profile, |
2031 CommandLine::ForCurrentProcess()), | 2031 CommandLine::ForCurrentProcess()), |
2032 profile, | 2032 profile, |
2033 signin, | 2033 signin, |
2034 behavior); | 2034 behavior); |
2035 } | 2035 } |
OLD | NEW |