| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ios/chrome/browser/sync/sync_setup_service.h" | 5 #include "ios/chrome/browser/sync/sync_setup_service.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // on about:sync. | 131 // on about:sync. |
| 132 case GoogleServiceAuthError::CONNECTION_FAILED: | 132 case GoogleServiceAuthError::CONNECTION_FAILED: |
| 133 case GoogleServiceAuthError::USER_NOT_SIGNED_UP: | 133 case GoogleServiceAuthError::USER_NOT_SIGNED_UP: |
| 134 case GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE: | 134 case GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE: |
| 135 break; | 135 break; |
| 136 // The following errors are unexpected on iOS. | 136 // The following errors are unexpected on iOS. |
| 137 case GoogleServiceAuthError::CAPTCHA_REQUIRED: | 137 case GoogleServiceAuthError::CAPTCHA_REQUIRED: |
| 138 case GoogleServiceAuthError::ACCOUNT_DELETED: | 138 case GoogleServiceAuthError::ACCOUNT_DELETED: |
| 139 case GoogleServiceAuthError::ACCOUNT_DISABLED: | 139 case GoogleServiceAuthError::ACCOUNT_DISABLED: |
| 140 case GoogleServiceAuthError::TWO_FACTOR: | 140 case GoogleServiceAuthError::TWO_FACTOR: |
| 141 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED: | 141 case GoogleServiceAuthError::HOSTED_NOT_ALLOWED_DEPRECATED: |
| 142 case GoogleServiceAuthError::SERVICE_ERROR: | 142 case GoogleServiceAuthError::SERVICE_ERROR: |
| 143 case GoogleServiceAuthError::WEB_LOGIN_REQUIRED: | 143 case GoogleServiceAuthError::WEB_LOGIN_REQUIRED: |
| 144 // Conventional value for counting the states, never used. | 144 // Conventional value for counting the states, never used. |
| 145 case GoogleServiceAuthError::NUM_STATES: | 145 case GoogleServiceAuthError::NUM_STATES: |
| 146 NOTREACHED() << "Unexpected Auth error (" | 146 NOTREACHED() << "Unexpected Auth error (" |
| 147 << sync_service_->GetAuthError().state() | 147 << sync_service_->GetAuthError().state() |
| 148 << "): " << sync_service_->GetAuthError().error_message(); | 148 << "): " << sync_service_->GetAuthError().error_message(); |
| 149 break; | 149 break; |
| 150 } | 150 } |
| 151 if (sync_service_->HasUnrecoverableError()) | 151 if (sync_service_->HasUnrecoverableError()) |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 bool sync_enabled) { | 191 bool sync_enabled) { |
| 192 sync_blocker_ = sync_service_->GetSetupInProgressHandle(); | 192 sync_blocker_ = sync_service_->GetSetupInProgressHandle(); |
| 193 if (sync_enabled) { | 193 if (sync_enabled) { |
| 194 sync_service_->RequestStart(); | 194 sync_service_->RequestStart(); |
| 195 } else { | 195 } else { |
| 196 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", syncer::CHROME_SYNC_SETTINGS, | 196 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", syncer::CHROME_SYNC_SETTINGS, |
| 197 syncer::STOP_SOURCE_LIMIT); | 197 syncer::STOP_SOURCE_LIMIT); |
| 198 sync_service_->RequestStop(sync_driver::SyncService::KEEP_DATA); | 198 sync_service_->RequestStop(sync_driver::SyncService::KEEP_DATA); |
| 199 } | 199 } |
| 200 } | 200 } |
| OLD | NEW |