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 COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 | 159 |
160 // Sets the URL of |node|. | 160 // Sets the URL of |node|. |
161 void SetURL(const BookmarkNode* node, const GURL& url); | 161 void SetURL(const BookmarkNode* node, const GURL& url); |
162 | 162 |
163 // Sets the date added time of |node|. | 163 // Sets the date added time of |node|. |
164 void SetDateAdded(const BookmarkNode* node, base::Time date_added); | 164 void SetDateAdded(const BookmarkNode* node, base::Time date_added); |
165 | 165 |
166 // Returns the set of nodes with the |url|. | 166 // Returns the set of nodes with the |url|. |
167 void GetNodesByURL(const GURL& url, std::vector<const BookmarkNode*>* nodes); | 167 void GetNodesByURL(const GURL& url, std::vector<const BookmarkNode*>* nodes); |
168 | 168 |
169 // Returns the set of nodes which use the favicon at |icon_url|. | |
170 void GetNodesByIconURL(const GURL& icon_url, | |
171 std::vector<const BookmarkNode*>* nodes); | |
sky
2015/06/19 16:38:02
I don't think we need order here. How about a set?
| |
172 | |
169 // Returns the most recently added user node for the |url|; urls from any | 173 // Returns the most recently added user node for the |url|; urls from any |
170 // nodes that are not editable by the user are never returned by this call. | 174 // nodes that are not editable by the user are never returned by this call. |
171 // Returns NULL if |url| is not bookmarked. | 175 // Returns NULL if |url| is not bookmarked. |
172 const BookmarkNode* GetMostRecentlyAddedUserNodeForURL(const GURL& url); | 176 const BookmarkNode* GetMostRecentlyAddedUserNodeForURL(const GURL& url); |
173 | 177 |
174 // Returns true if there are bookmarks, otherwise returns false. | 178 // Returns true if there are bookmarks, otherwise returns false. |
175 // This method is thread safe. | 179 // This method is thread safe. |
176 bool HasBookmarks(); | 180 bool HasBookmarks(); |
177 | 181 |
178 // Returns true if the specified URL is bookmarked. | 182 // Returns true if the specified URL is bookmarked. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 const std::set<std::string>& non_cloned_keys() const { | 295 const std::set<std::string>& non_cloned_keys() const { |
292 return non_cloned_keys_; | 296 return non_cloned_keys_; |
293 } | 297 } |
294 | 298 |
295 // Sets the sync transaction version of |node|. | 299 // Sets the sync transaction version of |node|. |
296 void SetNodeSyncTransactionVersion(const BookmarkNode* node, | 300 void SetNodeSyncTransactionVersion(const BookmarkNode* node, |
297 int64 sync_transaction_version); | 301 int64 sync_transaction_version); |
298 | 302 |
299 // Notify BookmarkModel that the favicons for |urls| have changed and have to | 303 // Notify BookmarkModel that the favicons for |urls| have changed and have to |
300 // be refetched. This notification is sent by BookmarkClient. | 304 // be refetched. This notification is sent by BookmarkClient. |
301 void OnFaviconChanged(const std::set<GURL>& urls); | 305 void OnFaviconsChanged(const std::vector<GURL>& page_urls, |
306 const std::vector<GURL>& icon_urls); | |
302 | 307 |
303 // Returns the client used by this BookmarkModel. | 308 // Returns the client used by this BookmarkModel. |
304 BookmarkClient* client() const { return client_; } | 309 BookmarkClient* client() const { return client_; } |
305 | 310 |
306 private: | 311 private: |
307 friend class BookmarkCodecTest; | 312 friend class BookmarkCodecTest; |
308 friend class BookmarkStorage; | 313 friend class BookmarkStorage; |
309 friend class ScopedGroupBookmarkActions; | 314 friend class ScopedGroupBookmarkActions; |
310 friend class TestBookmarkClient; | 315 friend class TestBookmarkClient; |
311 | 316 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 447 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
443 | 448 |
444 std::set<std::string> non_cloned_keys_; | 449 std::set<std::string> non_cloned_keys_; |
445 | 450 |
446 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 451 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
447 }; | 452 }; |
448 | 453 |
449 } // namespace bookmarks | 454 } // namespace bookmarks |
450 | 455 |
451 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 456 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |