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 "base/prefs/pref_service.h" | 11 #include "components/prefs/pref_service.h" |
12 #include "components/sync_driver/sync_prefs.h" | 12 #include "components/sync_driver/sync_prefs.h" |
13 #include "components/sync_driver/sync_service.h" | 13 #include "components/sync_driver/sync_service.h" |
14 #include "google_apis/gaia/google_service_auth_error.h" | 14 #include "google_apis/gaia/google_service_auth_error.h" |
15 #include "ios/chrome/browser/pref_names.h" | 15 #include "ios/chrome/browser/pref_names.h" |
16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | 16 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" |
17 #include "net/base/network_change_notifier.h" | 17 #include "net/base/network_change_notifier.h" |
18 #include "sync/internal_api/public/base/stop_source.h" | 18 #include "sync/internal_api/public/base/stop_source.h" |
19 #include "sync/protocol/sync_protocol_error.h" | 19 #include "sync/protocol/sync_protocol_error.h" |
20 | 20 |
21 namespace { | 21 namespace { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 bool sync_enabled) { | 194 bool sync_enabled) { |
195 sync_service_->SetSetupInProgress(true); | 195 sync_service_->SetSetupInProgress(true); |
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 |