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" |
11 #include "components/prefs/pref_service.h" | 11 #include "components/prefs/pref_service.h" |
| 12 #include "components/sync/base/stop_source.h" |
| 13 #include "components/sync/protocol/sync_protocol_error.h" |
12 #include "components/sync_driver/sync_prefs.h" | 14 #include "components/sync_driver/sync_prefs.h" |
13 #include "components/sync_driver/sync_service.h" | 15 #include "components/sync_driver/sync_service.h" |
14 #include "google_apis/gaia/google_service_auth_error.h" | 16 #include "google_apis/gaia/google_service_auth_error.h" |
15 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" | 17 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
16 #include "ios/chrome/browser/pref_names.h" | 18 #include "ios/chrome/browser/pref_names.h" |
17 #include "net/base/network_change_notifier.h" | 19 #include "net/base/network_change_notifier.h" |
18 #include "sync/internal_api/public/base/stop_source.h" | |
19 #include "sync/protocol/sync_protocol_error.h" | |
20 | 20 |
21 namespace { | 21 namespace { |
22 // The set of user-selectable datatypes. This must be in the same order as | 22 // The set of user-selectable datatypes. This must be in the same order as |
23 // |SyncSetupService::SyncableDatatype|. | 23 // |SyncSetupService::SyncableDatatype|. |
24 syncer::ModelType kDataTypes[] = { | 24 syncer::ModelType kDataTypes[] = { |
25 syncer::BOOKMARKS, | 25 syncer::BOOKMARKS, |
26 syncer::TYPED_URLS, | 26 syncer::TYPED_URLS, |
27 syncer::PASSWORDS, | 27 syncer::PASSWORDS, |
28 syncer::PROXY_TABS, | 28 syncer::PROXY_TABS, |
29 syncer::AUTOFILL, | 29 syncer::AUTOFILL, |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 bool sync_enabled) { | 194 bool sync_enabled) { |
195 sync_blocker_ = sync_service_->GetSetupInProgressHandle(); | 195 sync_blocker_ = sync_service_->GetSetupInProgressHandle(); |
196 if (sync_enabled) { | 196 if (sync_enabled) { |
197 sync_service_->RequestStart(); | 197 sync_service_->RequestStart(); |
198 } else { | 198 } else { |
199 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", syncer::CHROME_SYNC_SETTINGS, | 199 UMA_HISTOGRAM_ENUMERATION("Sync.StopSource", syncer::CHROME_SYNC_SETTINGS, |
200 syncer::STOP_SOURCE_LIMIT); | 200 syncer::STOP_SOURCE_LIMIT); |
201 sync_service_->RequestStop(sync_driver::SyncService::KEEP_DATA); | 201 sync_service_->RequestStop(sync_driver::SyncService::KEEP_DATA); |
202 } | 202 } |
203 } | 203 } |
OLD | NEW |