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 <vector> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/deferred_sequenced_task_runner.h" | 11 #include "base/deferred_sequenced_task_runner.h" |
10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
11 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | 13 #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
12 #include "components/bookmarks/browser/bookmark_client.h" | 14 #include "components/bookmarks/browser/bookmark_client.h" |
13 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
14 #include "components/policy/core/browser/managed_bookmarks_tracker.h" | 16 #include "components/policy/core/browser/managed_bookmarks_tracker.h" |
15 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
17 | 19 |
(...skipping 12 matching lines...) Expand all Loading... |
30 | 32 |
31 // Returns the BookmarkModel that corresponds to this ChromeBookmarkClient. | 33 // Returns the BookmarkModel that corresponds to this ChromeBookmarkClient. |
32 BookmarkModel* model() { return model_.get(); } | 34 BookmarkModel* model() { return model_.get(); } |
33 | 35 |
34 // Returns the managed_node. | 36 // Returns the managed_node. |
35 const BookmarkNode* managed_node() { return managed_node_; } | 37 const BookmarkNode* managed_node() { return managed_node_; } |
36 | 38 |
37 // Returns true if the given node belongs to the managed bookmarks tree. | 39 // Returns true if the given node belongs to the managed bookmarks tree. |
38 bool IsDescendantOfManagedNode(const BookmarkNode* node); | 40 bool IsDescendantOfManagedNode(const BookmarkNode* node); |
39 | 41 |
| 42 // Returns true if there is at least one managed node in the |list|. |
| 43 bool HasDescendantsOfManagedNode( |
| 44 const std::vector<const BookmarkNode*>& list); |
| 45 |
40 // BookmarkClient: | 46 // BookmarkClient: |
41 virtual bool PreferTouchIcon() OVERRIDE; | 47 virtual bool PreferTouchIcon() OVERRIDE; |
42 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL( | 48 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL( |
43 const GURL& page_url, | 49 const GURL& page_url, |
44 int icon_types, | 50 int icon_types, |
45 int desired_size_in_dip, | 51 int desired_size_in_dip, |
46 const favicon_base::FaviconImageCallback& callback, | 52 const favicon_base::FaviconImageCallback& callback, |
47 base::CancelableTaskTracker* tracker) OVERRIDE; | 53 base::CancelableTaskTracker* tracker) OVERRIDE; |
48 virtual bool SupportsTypedCountForNodes() OVERRIDE; | 54 virtual bool SupportsTypedCountForNodes() OVERRIDE; |
49 virtual void GetTypedCountForNodes( | 55 virtual void GetTypedCountForNodes( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 105 |
100 scoped_ptr<BookmarkModel> model_; | 106 scoped_ptr<BookmarkModel> model_; |
101 | 107 |
102 policy::ManagedBookmarksTracker managed_bookmarks_tracker_; | 108 policy::ManagedBookmarksTracker managed_bookmarks_tracker_; |
103 BookmarkPermanentNode* managed_node_; | 109 BookmarkPermanentNode* managed_node_; |
104 | 110 |
105 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); | 111 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); |
106 }; | 112 }; |
107 | 113 |
108 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 114 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
OLD | NEW |