Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: components/bookmarks/browser/bookmark_model.h

Issue 1133463005: Update all bookmarks which use an icon URL when a favicon's bitmap is updated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@startup_do_not_unexpire
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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);
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // Returns the set of meta info keys that should not be copied when a node is 293 // Returns the set of meta info keys that should not be copied when a node is
290 // cloned. 294 // cloned.
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 the given page URLs
304 // (e.g. http://www.google.com) and the given icon URLs (e.g.
305 // http://www.google.com/favicon.ico) have changed and have to
300 // be refetched. This notification is sent by BookmarkClient. 306 // be refetched. This notification is sent by BookmarkClient.
301 void OnFaviconChanged(const std::set<GURL>& urls); 307 void OnFaviconsChanged(const std::vector<GURL>& page_urls,
308 const std::vector<GURL>& icon_urls);
302 309
303 // Returns the client used by this BookmarkModel. 310 // Returns the client used by this BookmarkModel.
304 BookmarkClient* client() const { return client_; } 311 BookmarkClient* client() const { return client_; }
305 312
306 private: 313 private:
307 friend class BookmarkCodecTest; 314 friend class BookmarkCodecTest;
308 friend class BookmarkStorage; 315 friend class BookmarkStorage;
309 friend class ScopedGroupBookmarkActions; 316 friend class ScopedGroupBookmarkActions;
310 friend class TestBookmarkClient; 317 friend class TestBookmarkClient;
311 318
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_; 449 scoped_ptr<BookmarkExpandedStateTracker> expanded_state_tracker_;
443 450
444 std::set<std::string> non_cloned_keys_; 451 std::set<std::string> non_cloned_keys_;
445 452
446 DISALLOW_COPY_AND_ASSIGN(BookmarkModel); 453 DISALLOW_COPY_AND_ASSIGN(BookmarkModel);
447 }; 454 };
448 455
449 } // namespace bookmarks 456 } // namespace bookmarks
450 457
451 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_ 458 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698