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

Unified Diff: components/bookmarks/test/test_bookmark_client.h

Issue 305973004: BookmarkClient can add extra nodes to BookmarkModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added support for extra nodes from the client Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/bookmarks/test/test_bookmark_client.h
diff --git a/components/bookmarks/test/test_bookmark_client.h b/components/bookmarks/test/test_bookmark_client.h
index 13307282c3c8eb1d386e9de85b6600041972420c..298453515c872d17c9c6c3f264f05a98429760a2 100644
--- a/components/bookmarks/test/test_bookmark_client.h
+++ b/components/bookmarks/test/test_bookmark_client.h
@@ -21,10 +21,41 @@ class TestBookmarkClient : public BookmarkClient {
// BookmarkModel* is owned by the caller.
scoped_ptr<BookmarkModel> CreateModel(bool index_urls);
+ // Sets the list of extra nodes to be returned by the next call to
+ // GetLoadExtraNodesCallback(). CreateModel() won't pick this up; the model
+ // needs to get Load() invoked to reach to the client for this call.
+ void SetExtraNodesToLoad(bookmarks::BookmarkPermanentNodeList extra_nodes);
+
+ // Returns the current extra_nodes, set via ExtraNodesLoaded().
+ const std::vector<BookmarkPermanentNode*>& extra_nodes() {
+ return extra_nodes_;
+ }
+
+ // Returns true if |node| is one of the |extra_nodes_|.
+ bool IsExtraNodeRoot(const BookmarkNode* node);
+
+ // Returns true if |node| belongs to the tree of one of the |extra_nodes_|.
+ bool IsAnExtraNode(const BookmarkNode* node);
+
private:
// BookmarkClient:
- virtual bool IsPermanentNodeVisible(int node_type) OVERRIDE;
+ virtual bool IsPermanentNodeVisible(const BookmarkNode* node) OVERRIDE;
virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE;
+ virtual bookmarks::LoadExtraCallback GetLoadExtraNodesCallback() OVERRIDE;
+ virtual void ExtraNodesLoaded(
+ const std::vector<BookmarkPermanentNode*>& extra_nodes) OVERRIDE;
+ virtual bool CanRemoveNode(const BookmarkNode* node) OVERRIDE;
+ virtual bool CanSetTitle(const BookmarkNode* permanent_node) OVERRIDE;
+ virtual bool CanSyncNode(const BookmarkNode* node) OVERRIDE;
+ virtual bool CanReorderChildren(const BookmarkNode* parent) OVERRIDE;
+
+ // Helpers for GetLoadExtraNodesCallback().
+ static bookmarks::BookmarkPermanentNodeList LoadExtraNodes(
+ bookmarks::BookmarkPermanentNodeList extra_nodes,
+ int64* next_id);
+
+ bookmarks::BookmarkPermanentNodeList extra_nodes_to_load_;
+ std::vector<BookmarkPermanentNode*> extra_nodes_;
DISALLOW_COPY_AND_ASSIGN(TestBookmarkClient);
};

Powered by Google App Engine
This is Rietveld 408576698