| 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 #ifndef COMPONENTS_BOOKMARKS_TEST_TEST_BOOKMARK_CLIENT_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_TEST_TEST_BOOKMARK_CLIENT_H_ |
| 6 #define COMPONENTS_BOOKMARKS_TEST_TEST_BOOKMARK_CLIENT_H_ | 6 #define COMPONENTS_BOOKMARKS_TEST_TEST_BOOKMARK_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "components/bookmarks/browser/bookmark_client.h" | 13 #include "components/bookmarks/browser/bookmark_client.h" |
| 13 | 14 |
| 14 namespace bookmarks { | 15 namespace bookmarks { |
| 15 | 16 |
| 16 class BookmarkModel; | 17 class BookmarkModel; |
| 17 | 18 |
| 18 class TestBookmarkClient : public BookmarkClient { | 19 class TestBookmarkClient : public BookmarkClient { |
| 19 public: | 20 public: |
| 20 TestBookmarkClient(); | 21 TestBookmarkClient(); |
| 21 ~TestBookmarkClient() override; | 22 ~TestBookmarkClient() override; |
| 22 | 23 |
| 23 // Returns a new BookmarkModel using a TestBookmarkClient. | 24 // Returns a new BookmarkModel using a TestBookmarkClient. |
| 24 static scoped_ptr<BookmarkModel> CreateModel(); | 25 static std::unique_ptr<BookmarkModel> CreateModel(); |
| 25 | 26 |
| 26 // Returns a new BookmarkModel using |client|. | 27 // Returns a new BookmarkModel using |client|. |
| 27 static scoped_ptr<BookmarkModel> CreateModelWithClient( | 28 static std::unique_ptr<BookmarkModel> CreateModelWithClient( |
| 28 scoped_ptr<BookmarkClient> client); | 29 std::unique_ptr<BookmarkClient> client); |
| 29 | 30 |
| 30 // Sets the list of extra nodes to be returned by the next call to | 31 // Sets the list of extra nodes to be returned by the next call to |
| 31 // CreateModel() or GetLoadExtraNodesCallback(). | 32 // CreateModel() or GetLoadExtraNodesCallback(). |
| 32 void SetExtraNodesToLoad(BookmarkPermanentNodeList extra_nodes); | 33 void SetExtraNodesToLoad(BookmarkPermanentNodeList extra_nodes); |
| 33 | 34 |
| 34 // Returns the current extra_nodes, set via SetExtraNodesToLoad(). | 35 // Returns the current extra_nodes, set via SetExtraNodesToLoad(). |
| 35 const std::vector<BookmarkPermanentNode*>& extra_nodes() { | 36 const std::vector<BookmarkPermanentNode*>& extra_nodes() { |
| 36 return extra_nodes_; | 37 return extra_nodes_; |
| 37 } | 38 } |
| 38 | 39 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 58 | 59 |
| 59 BookmarkPermanentNodeList extra_nodes_to_load_; | 60 BookmarkPermanentNodeList extra_nodes_to_load_; |
| 60 std::vector<BookmarkPermanentNode*> extra_nodes_; | 61 std::vector<BookmarkPermanentNode*> extra_nodes_; |
| 61 | 62 |
| 62 DISALLOW_COPY_AND_ASSIGN(TestBookmarkClient); | 63 DISALLOW_COPY_AND_ASSIGN(TestBookmarkClient); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace bookmarks | 66 } // namespace bookmarks |
| 66 | 67 |
| 67 #endif // COMPONENTS_BOOKMARKS_TEST_TEST_BOOKMARK_CLIENT_H_ | 68 #endif // COMPONENTS_BOOKMARKS_TEST_TEST_BOOKMARK_CLIENT_H_ |
| OLD | NEW |