| 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/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 int64 SessionModelAssociator::GetSyncIdFromChromeId(const std::string& id) { | 102 int64 SessionModelAssociator::GetSyncIdFromChromeId(const std::string& id) { |
| 103 sync_api::ReadTransaction trans( | 103 sync_api::ReadTransaction trans( |
| 104 sync_service_->backend()->GetUserShareHandle()); | 104 sync_service_->backend()->GetUserShareHandle()); |
| 105 sync_api::ReadNode node(&trans); | 105 sync_api::ReadNode node(&trans); |
| 106 if (!node.InitByClientTagLookup(syncable::SESSIONS, id)) | 106 if (!node.InitByClientTagLookup(syncable::SESSIONS, id)) |
| 107 return sync_api::kInvalidId; | 107 return sync_api::kInvalidId; |
| 108 return node.GetId(); | 108 return node.GetId(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool SessionModelAssociator::InitSyncNodeFromChromeId( |
| 112 const std::string& id, |
| 113 sync_api::BaseNode* sync_node) { |
| 114 return false; |
| 115 } |
| 116 |
| 111 bool SessionModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { | 117 bool SessionModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { |
| 112 DCHECK(CalledOnValidThread()); | 118 DCHECK(CalledOnValidThread()); |
| 113 CHECK(has_nodes); | 119 CHECK(has_nodes); |
| 114 *has_nodes = false; | 120 *has_nodes = false; |
| 115 sync_api::ReadTransaction trans( | 121 sync_api::ReadTransaction trans( |
| 116 sync_service_->backend()->GetUserShareHandle()); | 122 sync_service_->backend()->GetUserShareHandle()); |
| 117 sync_api::ReadNode root(&trans); | 123 sync_api::ReadNode root(&trans); |
| 118 if (!root.InitByTagLookup(kSessionsTag)) { | 124 if (!root.InitByTagLookup(kSessionsTag)) { |
| 119 LOG(ERROR) << kNoSessionsFolderError; | 125 LOG(ERROR) << kNoSessionsFolderError; |
| 120 return false; | 126 return false; |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 return false; | 569 return false; |
| 564 } | 570 } |
| 565 create_node.SetSessionSpecifics(*session_data); | 571 create_node.SetSessionSpecifics(*session_data); |
| 566 return true; | 572 return true; |
| 567 } | 573 } |
| 568 write_node.SetSessionSpecifics(*session_data); | 574 write_node.SetSessionSpecifics(*session_data); |
| 569 return true; | 575 return true; |
| 570 } | 576 } |
| 571 | 577 |
| 572 } // namespace browser_sync | 578 } // namespace browser_sync |
| OLD | NEW |