OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/sync/glue/preference_model_associator.h" | 5 #include "chrome/browser/sync/glue/preference_model_associator.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 << "might be running against an out-of-date server."; | 158 << "might be running against an out-of-date server."; |
159 return false; | 159 return false; |
160 } | 160 } |
161 | 161 |
162 // The sync model has user created nodes if the preferences folder has any | 162 // The sync model has user created nodes if the preferences folder has any |
163 // children. | 163 // children. |
164 *has_nodes = sync_api::kInvalidId != preferences_node.GetFirstChildId(); | 164 *has_nodes = sync_api::kInvalidId != preferences_node.GetFirstChildId(); |
165 return true; | 165 return true; |
166 } | 166 } |
167 | 167 |
| 168 const PrefService::Preference* |
| 169 PreferenceModelAssociator::GetChromeNodeFromSyncId(int64 sync_id) { |
| 170 return NULL; |
| 171 } |
| 172 |
| 173 bool PreferenceModelAssociator::InitSyncNodeFromChromeId( |
| 174 const std::string& node_id, |
| 175 sync_api::BaseNode* sync_node) { |
| 176 return false; |
| 177 } |
| 178 |
168 int64 PreferenceModelAssociator::GetSyncIdFromChromeId( | 179 int64 PreferenceModelAssociator::GetSyncIdFromChromeId( |
169 const std::string& preference_name) { | 180 const std::string& preference_name) { |
170 PreferenceNameToSyncIdMap::const_iterator iter = | 181 PreferenceNameToSyncIdMap::const_iterator iter = |
171 id_map_.find(preference_name); | 182 id_map_.find(preference_name); |
172 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; | 183 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; |
173 } | 184 } |
174 | 185 |
175 void PreferenceModelAssociator::Associate( | 186 void PreferenceModelAssociator::Associate( |
176 const PrefService::Preference* preference, int64 sync_id) { | 187 const PrefService::Preference* preference, int64 sync_id) { |
177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 188 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // notification to update the UI. | 318 // notification to update the UI. |
308 if (0 == pref_name.compare(prefs::kShowBookmarkBar)) { | 319 if (0 == pref_name.compare(prefs::kShowBookmarkBar)) { |
309 NotificationService::current()->Notify( | 320 NotificationService::current()->Notify( |
310 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, | 321 NotificationType::BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, |
311 Source<PreferenceModelAssociator>(this), | 322 Source<PreferenceModelAssociator>(this), |
312 NotificationService::NoDetails()); | 323 NotificationService::NoDetails()); |
313 } | 324 } |
314 } | 325 } |
315 | 326 |
316 } // namespace browser_sync | 327 } // namespace browser_sync |
OLD | NEW |