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" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 DCHECK_EQ(type, PREFERENCES); | 164 DCHECK_EQ(type, PREFERENCES); |
165 models_associated_ = false; | 165 models_associated_ = false; |
166 sync_processor_.reset(); | 166 sync_processor_.reset(); |
167 sync_error_factory_.reset(); | 167 sync_error_factory_.reset(); |
168 } | 168 } |
169 | 169 |
170 Value* PrefModelAssociator::MergePreference( | 170 Value* PrefModelAssociator::MergePreference( |
171 const PrefService::Preference& local_pref, | 171 const PrefService::Preference& local_pref, |
172 const Value& server_value) { | 172 const Value& server_value) { |
173 const std::string& name(local_pref.name()); | 173 const std::string& name(local_pref.name()); |
| 174 DLOG(WARNING) << "MergePreference " << name; |
174 if (name == prefs::kURLsToRestoreOnStartup || | 175 if (name == prefs::kURLsToRestoreOnStartup || |
175 name == prefs::kDesktopNotificationAllowedOrigins || | 176 name == prefs::kDesktopNotificationAllowedOrigins || |
176 name == prefs::kDesktopNotificationDeniedOrigins) { | 177 name == prefs::kDesktopNotificationDeniedOrigins) { |
177 return MergeListValues(*local_pref.GetValue(), server_value); | 178 return MergeListValues(*local_pref.GetValue(), server_value); |
178 } | 179 } |
179 | 180 |
180 if (name == prefs::kContentSettingsPatterns || | 181 if (name == prefs::kContentSettingsPatterns || |
181 name == prefs::kGeolocationContentSettings || | 182 name == prefs::kGeolocationContentSettings || |
182 name == prefs::kContentSettingsPatternPairs) { | 183 name == prefs::kContentSettingsPatternPairs) { |
183 return MergeDictionaryValues(*local_pref.GetValue(), server_value); | 184 return MergeDictionaryValues(*local_pref.GetValue(), server_value); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 } | 428 } |
428 | 429 |
429 SyncError error = | 430 SyncError error = |
430 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); | 431 sync_processor_->ProcessSyncChanges(FROM_HERE, changes); |
431 } | 432 } |
432 | 433 |
433 void PrefModelAssociator::SetPrefService(PrefService* pref_service) { | 434 void PrefModelAssociator::SetPrefService(PrefService* pref_service) { |
434 DCHECK(pref_service_ == NULL); | 435 DCHECK(pref_service_ == NULL); |
435 pref_service_ = pref_service; | 436 pref_service_ = pref_service; |
436 } | 437 } |
OLD | NEW |