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 <stdint.h> | 8 #include <stdint.h> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // Returns the set of meta info keys that should not be copied when a node is | 290 // Returns the set of meta info keys that should not be copied when a node is |
291 // cloned. | 291 // cloned. |
292 const std::set<std::string>& non_cloned_keys() const { | 292 const std::set<std::string>& non_cloned_keys() const { |
293 return non_cloned_keys_; | 293 return non_cloned_keys_; |
294 } | 294 } |
295 | 295 |
296 // Sets the sync transaction version of |node|. | 296 // Sets the sync transaction version of |node|. |
297 void SetNodeSyncTransactionVersion(const BookmarkNode* node, | 297 void SetNodeSyncTransactionVersion(const BookmarkNode* node, |
298 int64_t sync_transaction_version); | 298 int64_t sync_transaction_version); |
299 | 299 |
300 // Notify BookmarkModel that the favicons for |urls| have changed and have to | 300 // Notify BookmarkModel that the favicons for the given page URLs (e.g. |
301 // be refetched. This notification is sent by BookmarkClient. | 301 // http://www.google.com) and the given icon URL (e.g. |
302 void OnFaviconChanged(const std::set<GURL>& urls); | 302 // http://www.google.com/favicon.ico) have changed. It is valid to call |
| 303 // OnFaviconsChanged() with non-empty |page_urls| and an empty |icon_url| and |
| 304 // vice versa. |
| 305 void OnFaviconsChanged(const std::set<GURL>& page_urls, |
| 306 const GURL& icon_url); |
303 | 307 |
304 // Returns the client used by this BookmarkModel. | 308 // Returns the client used by this BookmarkModel. |
305 BookmarkClient* client() const { return client_; } | 309 BookmarkClient* client() const { return client_; } |
306 | 310 |
307 private: | 311 private: |
308 friend class BookmarkCodecTest; | 312 friend class BookmarkCodecTest; |
| 313 friend class BookmarkModelFaviconTest; |
309 friend class BookmarkStorage; | 314 friend class BookmarkStorage; |
310 friend class ScopedGroupBookmarkActions; | 315 friend class ScopedGroupBookmarkActions; |
311 friend class TestBookmarkClient; | 316 friend class TestBookmarkClient; |
312 | 317 |
313 // Used to order BookmarkNodes by URL. | 318 // Used to order BookmarkNodes by URL. |
314 class NodeURLComparator { | 319 class NodeURLComparator { |
315 public: | 320 public: |
316 bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const { | 321 bool operator()(const BookmarkNode* n1, const BookmarkNode* n2) const { |
317 return n1->url() < n2->url(); | 322 return n1->url() < n2->url(); |
318 } | 323 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; | 448 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; |
444 | 449 |
445 std::set<std::string> non_cloned_keys_; | 450 std::set<std::string> non_cloned_keys_; |
446 | 451 |
447 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); | 452 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); |
448 }; | 453 }; |
449 | 454 |
450 } // namespace bookmarks | 455 } // namespace bookmarks |
451 | 456 |
452 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ | 457 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ |
OLD | NEW |