| 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/prefs/pref_model_associator.h" | 5 #include "chrome/browser/prefs/pref_model_associator.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/sync/api/sync_change.h" | 14 #include "chrome/browser/sync/api/sync_change.h" |
| 15 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" | |
| 16 #include "chrome/browser/sync/protocol/sync.pb.h" | |
| 17 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "sync/protocol/preference_specifics.pb.h" |
| 18 #include "sync/protocol/sync.pb.h" |
| 19 | 19 |
| 20 using syncable::PREFERENCES; | 20 using syncable::PREFERENCES; |
| 21 | 21 |
| 22 PrefModelAssociator::PrefModelAssociator() | 22 PrefModelAssociator::PrefModelAssociator() |
| 23 : models_associated_(false), | 23 : models_associated_(false), |
| 24 processing_syncer_changes_(false), | 24 processing_syncer_changes_(false), |
| 25 pref_service_(NULL), | 25 pref_service_(NULL), |
| 26 sync_processor_(NULL) { | 26 sync_processor_(NULL) { |
| 27 DCHECK(CalledOnValidThread()); | 27 DCHECK(CalledOnValidThread()); |
| 28 } | 28 } |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 SyncError error = | 426 SyncError error = |
| 427 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 427 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
| 428 if (error.IsSet()) | 428 if (error.IsSet()) |
| 429 StopSyncing(PREFERENCES); | 429 StopSyncing(PREFERENCES); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void PrefModelAssociator::SetPrefService(PrefService* pref_service) { | 432 void PrefModelAssociator::SetPrefService(PrefService* pref_service) { |
| 433 DCHECK(pref_service_ == NULL); | 433 DCHECK(pref_service_ == NULL); |
| 434 pref_service_ = pref_service; | 434 pref_service_ = pref_service; |
| 435 } | 435 } |
| OLD | NEW |