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

Side by Side 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: renamed methods 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_BROWSER_BOOKMARK_CLIENT_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/task/cancelable_task_tracker.h" 13 #include "base/task/cancelable_task_tracker.h"
14 #include "components/bookmarks/browser/bookmark_storage.h"
14 #include "components/favicon_base/favicon_callback.h" 15 #include "components/favicon_base/favicon_callback.h"
15 16
16 class BookmarkNode; 17 class BookmarkNode;
18 class BookmarkPermanentNode;
17 class GURL; 19 class GURL;
18 20
19 namespace base { 21 namespace base {
20 struct UserMetricsAction; 22 struct UserMetricsAction;
21 } 23 }
22 24
23 // This class abstracts operations that depends on the embedder's environment, 25 // This class abstracts operations that depends on the embedder's environment,
24 // e.g. Chrome. 26 // e.g. Chrome.
25 class BookmarkClient { 27 class BookmarkClient {
26 public: 28 public:
(...skipping 21 matching lines...) Expand all
48 50
49 // Returns true if the embedder supports typed count for URL. 51 // Returns true if the embedder supports typed count for URL.
50 virtual bool SupportsTypedCountForNodes(); 52 virtual bool SupportsTypedCountForNodes();
51 53
52 // Retrieves the number of time each BookmarkNode URL has been typed in 54 // Retrieves the number of time each BookmarkNode URL has been typed in
53 // the Omnibox by the user. 55 // the Omnibox by the user.
54 virtual void GetTypedCountForNodes( 56 virtual void GetTypedCountForNodes(
55 const NodeSet& nodes, 57 const NodeSet& nodes,
56 NodeTypedCountPairs* node_typed_count_pairs); 58 NodeTypedCountPairs* node_typed_count_pairs);
57 59
58 // Returns whether the embedder wants permanent node of type |node_type| 60 // Returns whether the embedder wants permanent node |node|
59 // to always be visible or to only show them when not empty. 61 // to always be visible or to only show them when not empty.
60 virtual bool IsPermanentNodeVisible(int node_type) = 0; 62 virtual bool IsPermanentNodeVisible(const BookmarkPermanentNode* node) = 0;
61 63
62 // Wrapper around RecordAction defined in base/metrics/user_metrics.h 64 // Wrapper around RecordAction defined in base/metrics/user_metrics.h
63 // that ensure that the action is posted from the correct thread. 65 // that ensure that the action is posted from the correct thread.
64 virtual void RecordAction(const base::UserMetricsAction& action) = 0; 66 virtual void RecordAction(const base::UserMetricsAction& action) = 0;
65 67
68 // Returns a task that will be used to load any additional root nodes. This
69 // task will be invoked in the Profile's IO task runner.
70 virtual bookmarks::LoadExtraCallback GetLoadExtraNodesCallback() = 0;
71
72 // Checks if the children of the given permanent |node| can be removed from
73 // the bookmark model.
74 virtual bool CanRemovePermanentNodeChildren(const BookmarkNode* node) = 0;
75
76 // Checks if the |permanent_node| can have its title updated.
77 virtual bool CanSetPermanentNodeTitle(const BookmarkNode* permanent_node) = 0;
78
79 // Checks if |node| should sync.
80 virtual bool CanSyncNode(const BookmarkNode* node) = 0;
81
82 // Checks if the children of |parent| can be reordered or sorted.
83 virtual bool CanReorderChildren(const BookmarkNode* parent) = 0;
84
66 protected: 85 protected:
67 virtual ~BookmarkClient() {} 86 virtual ~BookmarkClient() {}
68 }; 87 };
69 88
70 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_ 89 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698