Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/sync/glue/preference_model_associator.cc

Issue 2867036: sync: Remove unused function ChromeModelHasUserCreatedNodes. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: explicit Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 << "might be running against an out-of-date server."; 147 << "might be running against an out-of-date server.";
148 return false; 148 return false;
149 } 149 }
150 150
151 // The sync model has user created nodes if the preferences folder has any 151 // The sync model has user created nodes if the preferences folder has any
152 // children. 152 // children.
153 *has_nodes = sync_api::kInvalidId != preferences_node.GetFirstChildId(); 153 *has_nodes = sync_api::kInvalidId != preferences_node.GetFirstChildId();
154 return true; 154 return true;
155 } 155 }
156 156
157 bool PreferenceModelAssociator::ChromeModelHasUserCreatedNodes(
158 bool* has_nodes) {
159 DCHECK(has_nodes);
160 // Assume the preferences model always have user-created nodes.
161 *has_nodes = true;
162 return true;
163 }
164
165 int64 PreferenceModelAssociator::GetSyncIdFromChromeId( 157 int64 PreferenceModelAssociator::GetSyncIdFromChromeId(
166 const std::wstring preference_name) { 158 const std::wstring preference_name) {
167 PreferenceNameToSyncIdMap::const_iterator iter = 159 PreferenceNameToSyncIdMap::const_iterator iter =
168 id_map_.find(preference_name); 160 id_map_.find(preference_name);
169 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; 161 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second;
170 } 162 }
171 163
172 void PreferenceModelAssociator::Associate( 164 void PreferenceModelAssociator::Associate(
173 const PrefService::Preference* preference, int64 sync_id) { 165 const PrefService::Preference* preference, int64 sync_id) {
174 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 166 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 // Note that for all other types we want to preserve the "to" 282 // Note that for all other types we want to preserve the "to"
291 // values so we do nothing here. 283 // values so we do nothing here.
292 } else { 284 } else {
293 result->SetWithoutPathExpansion(*key, from_value->DeepCopy()); 285 result->SetWithoutPathExpansion(*key, from_value->DeepCopy());
294 } 286 }
295 } 287 }
296 return result; 288 return result;
297 } 289 }
298 290
299 } // namespace browser_sync 291 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698