OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/password_model_associator.h" | 5 #include "chrome/browser/sync/glue/password_model_associator.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 sync_api::ReadNode password_node(&trans); | 203 sync_api::ReadNode password_node(&trans); |
204 if (!password_node.InitByIdLookup(password_sync_id)) { | 204 if (!password_node.InitByIdLookup(password_sync_id)) { |
205 LOG(ERROR) << "Server did not create the top-level password node. We " | 205 LOG(ERROR) << "Server did not create the top-level password node. We " |
206 << "might be running against an out-of-date server."; | 206 << "might be running against an out-of-date server."; |
207 return false; | 207 return false; |
208 } | 208 } |
209 | 209 |
210 // The sync model has user created nodes if the password folder has any | 210 // The sync model has user created nodes if the password folder has any |
211 // children. | 211 // children. |
212 *has_nodes = sync_api::kInvalidId != password_node.GetFirstChildId(); | 212 *has_nodes = password_node.HasChildren(); |
213 return true; | 213 return true; |
214 } | 214 } |
215 | 215 |
216 void PasswordModelAssociator::AbortAssociation() { | 216 void PasswordModelAssociator::AbortAssociation() { |
217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
218 base::AutoLock lock(abort_association_pending_lock_); | 218 base::AutoLock lock(abort_association_pending_lock_); |
219 abort_association_pending_ = true; | 219 abort_association_pending_ = true; |
220 } | 220 } |
221 | 221 |
222 bool PasswordModelAssociator::CryptoReadyIfNecessary() { | 222 bool PasswordModelAssociator::CryptoReadyIfNecessary() { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 const std::string& password_element, | 421 const std::string& password_element, |
422 const std::string& signon_realm) { | 422 const std::string& signon_realm) { |
423 return EscapePath(origin_url) + "|" + | 423 return EscapePath(origin_url) + "|" + |
424 EscapePath(username_element) + "|" + | 424 EscapePath(username_element) + "|" + |
425 EscapePath(username_value) + "|" + | 425 EscapePath(username_value) + "|" + |
426 EscapePath(password_element) + "|" + | 426 EscapePath(password_element) + "|" + |
427 EscapePath(signon_realm); | 427 EscapePath(signon_realm); |
428 } | 428 } |
429 | 429 |
430 } // namespace browser_sync | 430 } // namespace browser_sync |
OLD | NEW |