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

Unified Diff: components/bookmarks/browser/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/browser/bookmark_client.h
diff --git a/components/bookmarks/browser/bookmark_client.h b/components/bookmarks/browser/bookmark_client.h
index ffdb64c25093a7409b31cecb03602d7c73e7e737..ff256d2341b3667155e75a487b4d1bdcce802d8a 100644
--- a/components/bookmarks/browser/bookmark_client.h
+++ b/components/bookmarks/browser/bookmark_client.h
@@ -11,6 +11,7 @@
#include "base/callback_forward.h"
#include "base/task/cancelable_task_tracker.h"
+#include "components/bookmarks/browser/bookmark_storage.h"
#include "components/favicon_base/favicon_callback.h"
class BookmarkNode;
@@ -55,14 +56,38 @@ class BookmarkClient {
const NodeSet& nodes,
NodeTypedCountPairs* node_typed_count_pairs);
- // Returns whether the embedder wants permanent node of type |node_type|
+ // Returns whether the embedder wants permanent node |node|
// to always be visible or to only show them when not empty.
- virtual bool IsPermanentNodeVisible(int node_type) = 0;
+ virtual bool IsPermanentNodeVisible(const BookmarkNode* node) = 0;
sky 2014/06/04 20:39:52 Shouldn't this continue to take a permanentnode?
Joao da Silva 2014/06/04 22:35:58 Done.
// Wrapper around RecordAction defined in base/metrics/user_metrics.h
// that ensure that the action is posted from the correct thread.
virtual void RecordAction(const base::UserMetricsAction& action) = 0;
+ // Returns a task that will be used to load any additional root nodes. This
+ // task will be invoked in a background thread.
+ virtual bookmarks::LoadExtraCallback GetLoadExtraNodesCallback() = 0;
+
+ // Called after the model has loaded the extra nodes created by the callback
+ // from GetLoadExtraNodesCallback(). These nodes are now children of the
+ // model's root node, and |extra_nodes| lists them in the same order that
+ // was returned from the callback. This allows the BookmarkClient to get
+ // handles to these nodes on the main thread.
+ virtual void ExtraNodesLoaded(
+ const std::vector<BookmarkPermanentNode*>& extra_nodes) = 0;
+
+ // Checks if |node| can be removed from the bookmark tree.
+ virtual bool CanRemoveNode(const BookmarkNode* node) = 0;
+
+ // Checks if the |permanent_node| can have its title updated.
+ virtual bool CanSetTitle(const BookmarkNode* permanent_node) = 0;
+
+ // Checks if |node| should sync.
+ virtual bool CanSyncNode(const BookmarkNode* node) = 0;
+
+ // Checks if the children of |parent| can be reordered or sorted.
+ virtual bool CanReorderChildren(const BookmarkNode* parent) = 0;
+
protected:
virtual ~BookmarkClient() {}
};

Powered by Google App Engine
This is Rietveld 408576698