| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/bookmarks/test/test_bookmark_client.h" | 5 #include "components/bookmarks/test/test_bookmark_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
| 16 #include "components/bookmarks/browser/bookmark_node.h" | 16 #include "components/bookmarks/browser/bookmark_node.h" |
| 17 #include "components/bookmarks/browser/bookmark_storage.h" | 17 #include "components/bookmarks/browser/bookmark_storage.h" |
| 18 #include "components/bookmarks/browser/offline_page_bookmark_observer.h" |
| 18 | 19 |
| 19 namespace bookmarks { | 20 namespace bookmarks { |
| 20 | 21 |
| 21 TestBookmarkClient::TestBookmarkClient() {} | 22 TestBookmarkClient::TestBookmarkClient() {} |
| 22 | 23 |
| 23 TestBookmarkClient::~TestBookmarkClient() {} | 24 TestBookmarkClient::~TestBookmarkClient() {} |
| 24 | 25 |
| 25 // static | 26 // static |
| 26 std::unique_ptr<BookmarkModel> TestBookmarkClient::CreateModel() { | 27 std::unique_ptr<BookmarkModel> TestBookmarkClient::CreateModel() { |
| 27 return CreateModelWithClient(base::WrapUnique(new TestBookmarkClient)); | 28 return CreateModelWithClient(base::WrapUnique(new TestBookmarkClient)); |
| 28 } | 29 } |
| 29 | 30 |
| 30 // static | 31 // static |
| 31 std::unique_ptr<BookmarkModel> TestBookmarkClient::CreateModelWithClient( | 32 std::unique_ptr<BookmarkModel> TestBookmarkClient::CreateModelWithClient( |
| 32 std::unique_ptr<BookmarkClient> client) { | 33 std::unique_ptr<BookmarkClient> client) { |
| 34 std::unique_ptr<OfflinePageBookmarkObserver> offline_page_observer; |
| 33 std::unique_ptr<BookmarkModel> bookmark_model( | 35 std::unique_ptr<BookmarkModel> bookmark_model( |
| 34 new BookmarkModel(std::move(client))); | 36 new BookmarkModel(std::move(client), std::move(offline_page_observer))); |
| 35 std::unique_ptr<BookmarkLoadDetails> details = | 37 std::unique_ptr<BookmarkLoadDetails> details = |
| 36 bookmark_model->CreateLoadDetails(); | 38 bookmark_model->CreateLoadDetails(); |
| 37 details->LoadExtraNodes(); | 39 details->LoadExtraNodes(); |
| 38 bookmark_model->DoneLoading(std::move(details)); | 40 bookmark_model->DoneLoading(std::move(details)); |
| 39 return bookmark_model; | 41 return bookmark_model; |
| 40 } | 42 } |
| 41 | 43 |
| 42 void TestBookmarkClient::SetExtraNodesToLoad( | 44 void TestBookmarkClient::SetExtraNodesToLoad( |
| 43 BookmarkPermanentNodeList extra_nodes) { | 45 BookmarkPermanentNodeList extra_nodes) { |
| 44 extra_nodes_to_load_ = std::move(extra_nodes); | 46 extra_nodes_to_load_ = std::move(extra_nodes); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 97 } |
| 96 | 98 |
| 97 // static | 99 // static |
| 98 BookmarkPermanentNodeList TestBookmarkClient::LoadExtraNodes( | 100 BookmarkPermanentNodeList TestBookmarkClient::LoadExtraNodes( |
| 99 BookmarkPermanentNodeList extra_nodes, | 101 BookmarkPermanentNodeList extra_nodes, |
| 100 int64_t* next_id) { | 102 int64_t* next_id) { |
| 101 return extra_nodes; | 103 return extra_nodes; |
| 102 } | 104 } |
| 103 | 105 |
| 104 } // namespace bookmarks | 106 } // namespace bookmarks |
| OLD | NEW |