Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/legacy/supervised_user_shared_settings_ service.h" | 5 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
| 13 #include "base/metrics/histogram.h" | |
| 13 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 14 #include "base/prefs/scoped_user_pref_update.h" | 15 #include "base/prefs/scoped_user_pref_update.h" |
| 15 #include "base/values.h" | 16 #include "base/values.h" |
| 16 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 17 #include "components/pref_registry/pref_registry_syncable.h" | 18 #include "components/pref_registry/pref_registry_syncable.h" |
| 18 #include "sync/api/sync_change.h" | 19 #include "sync/api/sync_change.h" |
| 19 #include "sync/api/sync_data.h" | 20 #include "sync/api/sync_data.h" |
| 20 #include "sync/api/sync_error.h" | 21 #include "sync/api/sync_error.h" |
| 21 #include "sync/api/sync_error_factory.h" | 22 #include "sync/api/sync_error_factory.h" |
| 22 #include "sync/api/sync_merge_result.h" | 23 #include "sync/api/sync_merge_result.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 } | 253 } |
| 253 } | 254 } |
| 254 | 255 |
| 255 SyncMergeResult result(SUPERVISED_USER_SHARED_SETTINGS); | 256 SyncMergeResult result(SUPERVISED_USER_SHARED_SETTINGS); |
| 256 // Process all the accumulated changes. | 257 // Process all the accumulated changes. |
| 257 if (change_list.size() > 0) { | 258 if (change_list.size() > 0) { |
| 258 result.set_error( | 259 result.set_error( |
| 259 sync_processor_->ProcessSyncChanges(FROM_HERE, change_list)); | 260 sync_processor_->ProcessSyncChanges(FROM_HERE, change_list)); |
| 260 } | 261 } |
| 261 | 262 |
| 262 // TODO(bauerb): Statistics? | 263 UMA_HISTOGRAM_ENUMERATION("SupervisedUserSettingService.SyncMergeResult", |
|
Bernhard Bauer
2016/01/04 12:53:30
Sorry, that comment should have been more detailed
Deepak
2016/01/05 03:45:16
Done.
| |
| 264 result.model_type(), syncer::MODEL_TYPE_COUNT); | |
| 265 | |
| 263 return result; | 266 return result; |
| 264 } | 267 } |
| 265 | 268 |
| 266 void SupervisedUserSharedSettingsService::StopSyncing(syncer::ModelType type) { | 269 void SupervisedUserSharedSettingsService::StopSyncing(syncer::ModelType type) { |
| 267 DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type); | 270 DCHECK_EQ(SUPERVISED_USER_SHARED_SETTINGS, type); |
| 268 sync_processor_.reset(); | 271 sync_processor_.reset(); |
| 269 error_handler_.reset(); | 272 error_handler_.reset(); |
| 270 } | 273 } |
| 271 | 274 |
| 272 syncer::SyncDataList SupervisedUserSharedSettingsService::GetAllSyncData( | 275 syncer::SyncDataList SupervisedUserSharedSettingsService::GetAllSyncData( |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 NOTREACHED(); | 340 NOTREACHED(); |
| 338 break; | 341 break; |
| 339 } | 342 } |
| 340 } | 343 } |
| 341 callbacks_.Notify(su_id, key); | 344 callbacks_.Notify(su_id, key); |
| 342 } | 345 } |
| 343 | 346 |
| 344 SyncError error; | 347 SyncError error; |
| 345 return error; | 348 return error; |
| 346 } | 349 } |
| OLD | NEW |