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> | 8 #include <vector> |
9 | 9 |
10 #include "base/deferred_sequenced_task_runner.h" | 10 #include "base/deferred_sequenced_task_runner.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | |
13 #include "components/bookmarks/browser/base_bookmark_model_observer.h" | 12 #include "components/bookmarks/browser/base_bookmark_model_observer.h" |
14 #include "components/bookmarks/browser/bookmark_client.h" | 13 #include "components/bookmarks/browser/bookmark_client.h" |
15 #include "components/policy/core/browser/managed_bookmarks_tracker.h" | 14 #include "components/policy/core/browser/managed_bookmarks_tracker.h" |
16 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
18 | 17 |
19 class BookmarkModel; | 18 class BookmarkModel; |
20 class Profile; | 19 class Profile; |
21 | 20 |
22 class ChromeBookmarkClient : public bookmarks::BookmarkClient, | 21 class ChromeBookmarkClient : public bookmarks::BookmarkClient, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 const BookmarkNode* node, | 75 const BookmarkNode* node, |
77 const std::set<GURL>& removed_urls) OVERRIDE; | 76 const std::set<GURL>& removed_urls) OVERRIDE; |
78 virtual void BookmarkAllUserNodesRemoved( | 77 virtual void BookmarkAllUserNodesRemoved( |
79 BookmarkModel* model, | 78 BookmarkModel* model, |
80 const std::set<GURL>& removed_urls) OVERRIDE; | 79 const std::set<GURL>& removed_urls) OVERRIDE; |
81 virtual void BookmarkModelLoaded(BookmarkModel* model, | 80 virtual void BookmarkModelLoaded(BookmarkModel* model, |
82 bool ids_reassigned) OVERRIDE; | 81 bool ids_reassigned) OVERRIDE; |
83 | 82 |
84 // Helper for GetLoadExtraNodesCallback(). | 83 // Helper for GetLoadExtraNodesCallback(). |
85 static bookmarks::BookmarkPermanentNodeList LoadExtraNodes( | 84 static bookmarks::BookmarkPermanentNodeList LoadExtraNodes( |
86 const scoped_refptr<base::DeferredSequencedTaskRunner>& profile_io_runner, | |
87 scoped_ptr<BookmarkPermanentNode> managed_node, | 85 scoped_ptr<BookmarkPermanentNode> managed_node, |
88 scoped_ptr<base::ListValue> initial_managed_bookmarks, | 86 scoped_ptr<base::ListValue> initial_managed_bookmarks, |
89 int64* next_node_id); | 87 int64* next_node_id); |
90 | 88 |
91 // Returns the management domain that configured the managed bookmarks, | 89 // Returns the management domain that configured the managed bookmarks, |
92 // or an empty string. | 90 // or an empty string. |
93 std::string GetManagedBookmarksDomain(); | 91 std::string GetManagedBookmarksDomain(); |
94 | 92 |
95 Profile* profile_; | 93 Profile* profile_; |
96 | 94 |
97 content::NotificationRegistrar registrar_; | 95 content::NotificationRegistrar registrar_; |
98 | 96 |
99 // Pointer to the BookmarkModel. Will be non-NULL from the call to Init to | 97 // Pointer to the BookmarkModel. Will be non-NULL from the call to Init to |
100 // the call to Shutdown. Must be valid for the whole interval. | 98 // the call to Shutdown. Must be valid for the whole interval. |
101 BookmarkModel* model_; | 99 BookmarkModel* model_; |
102 | 100 |
103 scoped_ptr<policy::ManagedBookmarksTracker> managed_bookmarks_tracker_; | 101 scoped_ptr<policy::ManagedBookmarksTracker> managed_bookmarks_tracker_; |
104 BookmarkPermanentNode* managed_node_; | 102 BookmarkPermanentNode* managed_node_; |
105 | 103 |
106 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); | 104 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient); |
107 }; | 105 }; |
108 | 106 |
109 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ | 107 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_ |
OLD | NEW |