Chromium Code Reviews| 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 CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 explicit ChromeBookmarkClient(Profile* profile); | 27 explicit ChromeBookmarkClient(Profile* profile); |
| 28 ~ChromeBookmarkClient() override; | 28 ~ChromeBookmarkClient() override; |
| 29 | 29 |
| 30 void Init(BookmarkModel* model); | 30 void Init(BookmarkModel* model); |
| 31 | 31 |
| 32 // KeyedService: | 32 // KeyedService: |
| 33 void Shutdown() override; | 33 void Shutdown() override; |
| 34 | 34 |
| 35 // Returns the managed_node. | 35 // Returns the managed_node. |
| 36 const BookmarkNode* managed_node() { return managed_node_; } | 36 const BookmarkNode* managed_node() { return managed_node_; } |
| 37 // Returns the supervised_node. | |
|
Pam (message me for reviews)
2015/01/14 14:03:37
This comment (and the managed_node() one above) is
Marc Treib
2015/01/14 16:40:50
I guess somebody wanted every public method to hav
| |
| 38 const BookmarkNode* supervised_node() { return supervised_node_; } | |
| 37 | 39 |
| 38 // Returns true if the given node belongs to the managed bookmarks tree. | 40 // Returns true if the given node belongs to the managed bookmarks tree. |
| 39 bool IsDescendantOfManagedNode(const BookmarkNode* node); | 41 bool IsDescendantOfManagedNode(const BookmarkNode* node); |
| 40 | |
| 41 // Returns true if there is at least one managed node in the |list|. | 42 // Returns true if there is at least one managed node in the |list|. |
| 42 bool HasDescendantsOfManagedNode( | 43 bool HasDescendantsOfManagedNode( |
| 43 const std::vector<const BookmarkNode*>& list); | 44 const std::vector<const BookmarkNode*>& list); |
| 44 | 45 |
| 46 // Returns true if the given node belongs to the supervised bookmarks tree. | |
| 47 bool IsDescendantOfSupervisedNode(const BookmarkNode* node); | |
| 48 // Returns true if there is at least one supervised node in the |list|. | |
| 49 bool HasDescendantsOfSupervisedNode( | |
| 50 const std::vector<const BookmarkNode*>& list); | |
| 51 | |
| 52 // Returns true if the given node belongs to either the managed or the | |
| 53 // supervised bookmarks tree. | |
| 54 bool IsDescendantOfManagedOrSupervisedNode(const BookmarkNode* node); | |
| 55 // Returns true if there is at least one managed or supervised node in the | |
| 56 // |list|. | |
| 57 bool HasDescendantsOfManagedOrSupervisedNode( | |
| 58 const std::vector<const BookmarkNode*>& list); | |
| 59 | |
| 45 // bookmarks::BookmarkClient: | 60 // bookmarks::BookmarkClient: |
| 46 bool PreferTouchIcon() override; | 61 bool PreferTouchIcon() override; |
| 47 base::CancelableTaskTracker::TaskId GetFaviconImageForPageURL( | 62 base::CancelableTaskTracker::TaskId GetFaviconImageForPageURL( |
| 48 const GURL& page_url, | 63 const GURL& page_url, |
| 49 favicon_base::IconType type, | 64 favicon_base::IconType type, |
| 50 const favicon_base::FaviconImageCallback& callback, | 65 const favicon_base::FaviconImageCallback& callback, |
| 51 base::CancelableTaskTracker* tracker) override; | 66 base::CancelableTaskTracker* tracker) override; |
| 52 bool SupportsTypedCountForNodes() override; | 67 bool SupportsTypedCountForNodes() override; |
| 53 void GetTypedCountForNodes( | 68 void GetTypedCountForNodes( |
| 54 const NodeSet& nodes, | 69 const NodeSet& nodes, |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 72 const BookmarkNode* node, | 87 const BookmarkNode* node, |
| 73 const std::set<GURL>& removed_urls) override; | 88 const std::set<GURL>& removed_urls) override; |
| 74 void BookmarkAllUserNodesRemoved(BookmarkModel* model, | 89 void BookmarkAllUserNodesRemoved(BookmarkModel* model, |
| 75 const std::set<GURL>& removed_urls) override; | 90 const std::set<GURL>& removed_urls) override; |
| 76 void BookmarkModelLoaded(BookmarkModel* model, bool ids_reassigned) override; | 91 void BookmarkModelLoaded(BookmarkModel* model, bool ids_reassigned) override; |
| 77 | 92 |
| 78 // Helper for GetLoadExtraNodesCallback(). | 93 // Helper for GetLoadExtraNodesCallback(). |
| 79 static bookmarks::BookmarkPermanentNodeList LoadExtraNodes( | 94 static bookmarks::BookmarkPermanentNodeList LoadExtraNodes( |
| 80 scoped_ptr<BookmarkPermanentNode> managed_node, | 95 scoped_ptr<BookmarkPermanentNode> managed_node, |
| 81 scoped_ptr<base::ListValue> initial_managed_bookmarks, | 96 scoped_ptr<base::ListValue> initial_managed_bookmarks, |
| 97 scoped_ptr<BookmarkPermanentNode> supervised_node, | |
| 98 scoped_ptr<base::ListValue> initial_supervised_bookmarks, | |
| 82 int64* next_node_id); | 99 int64* next_node_id); |
| 83 | 100 |
| 84 // Returns the management domain that configured the managed bookmarks, | 101 // Returns the management domain that configured the managed bookmarks, |
| 85 // or an empty string. | 102 // or an empty string. |
| 86 std::string GetManagedBookmarksDomain(); | 103 std::string GetManagedBookmarksDomain(); |
| 87 | 104 |
| 88 Profile* profile_; | 105 Profile* profile_; |
| 89 | 106 |
| 90 // HistoryService associated to the Profile. Due to circular dependency, this | 107 // HistoryService associated to the Profile. Due to circular dependency, this |
| 91 // cannot be passed to the constructor, nor lazily fetched. Instead the value | 108 // cannot be passed to the constructor, nor lazily fetched. Instead the value |
| 92 // is initialized from HistoryServiceFactory. | 109 // is initialized from HistoryServiceFactory. |
| 93 HistoryService* history_service_; | 110 HistoryService* history_service_; |
| 94 | 111 |
| 95 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> | 112 scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription> |
| 96 favicon_changed_subscription_; | 113 favicon_changed_subscription_; |
| 97 | 114 |
| 98 // Pointer to the BookmarkModel. Will be non-NULL from the call to Init to | 115 // Pointer to the BookmarkModel. Will be non-NULL from the call to Init to |
| 99 // the call to Shutdown. Must be valid for the whole interval. | 116 // the call to Shutdown. Must be valid for the whole interval. |
| 100 BookmarkModel* model_; | 117 BookmarkModel* model_; |
| 101 | 118 |
| 102 scoped_ptr<policy::ManagedBookmarksTracker> managed_bookmarks_tracker_; | 119 scoped_ptr<policy::ManagedBookmarksTracker> managed_bookmarks_tracker_; |
| 103 BookmarkPermanentNode* managed_node_; | 120 BookmarkPermanentNode* managed_node_; |
|
Pam (message me for reviews)
2015/01/14 14:03:37
Somewhere in this file, maybe as comments for mana
Marc Treib
2015/01/14 16:40:50
Done.
| |
| 104 | 121 |
| 122 scoped_ptr<policy::ManagedBookmarksTracker> supervised_bookmarks_tracker_; | |
| 123 BookmarkPermanentNode* supervised_node_; | |
| 124 | |
| 105 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); | 125 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); |
| 106 }; | 126 }; |
| 107 | 127 |
| 108 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 128 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
| OLD | NEW |