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

Side by Side Diff: chrome/browser/favicon/favicon_handler.h

Issue 684983003: Add Observer in FaviconTabHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_FAVICON_FAVICON_HANDLER_H_ 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_
6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ 6 #define CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 base::CancelableTaskTracker* tracker); 141 base::CancelableTaskTracker* tracker);
142 142
143 virtual void SetHistoryFavicons(const GURL& page_url, 143 virtual void SetHistoryFavicons(const GURL& page_url,
144 const GURL& icon_url, 144 const GURL& icon_url,
145 favicon_base::IconType icon_type, 145 favicon_base::IconType icon_type,
146 const gfx::Image& image); 146 const gfx::Image& image);
147 147
148 // Returns true if the favicon should be saved. 148 // Returns true if the favicon should be saved.
149 virtual bool ShouldSaveFavicon(const GURL& url); 149 virtual bool ShouldSaveFavicon(const GURL& url);
150 150
151 // Notifies the driver that the favicon for the active entry was updated. 151 // Notifies the driver that the icon was updated and could be retreived
sky 2014/10/29 15:50:55 retrieved
152 // |icon_url_changed| is true if a favicon with a different icon URL has been 152 // from FaviconService, the favicon is also availabe from the active entry
153 // selected since the previous call to NotifyFaviconUpdated(). 153 // if download_largest_icon_ is not enabled for FAVICON type of icon.
154 virtual void NotifyFaviconUpdated(bool icon_url_changed); 154 // |icon_url| is current icon url and used to check whether a different icon
155 // URL has been selected since the previous call to NotifyFaviconUpdated().
156 virtual void NotifyFaviconUpdated(const GURL& icon_url);
155 157
156 private: 158 private:
157 friend class TestFaviconHandler; // For testing 159 friend class TestFaviconHandler; // For testing
158 160
159 // Represents an in progress download of an image from the renderer. 161 // Represents an in progress download of an image from the renderer.
160 struct DownloadRequest { 162 struct DownloadRequest {
161 DownloadRequest(); 163 DownloadRequest();
162 ~DownloadRequest(); 164 ~DownloadRequest();
163 165
164 DownloadRequest(const GURL& url, 166 DownloadRequest(const GURL& url,
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 290
289 // This handler's driver. 291 // This handler's driver.
290 FaviconDriver* driver_; // weak 292 FaviconDriver* driver_; // weak
291 293
292 // Best image we've seen so far. As images are downloaded from the page they 294 // Best image we've seen so far. As images are downloaded from the page they
293 // are stored here. When there is an exact match, or no more images are 295 // are stored here. When there is an exact match, or no more images are
294 // available the favicon service and the current page are updated (assuming 296 // available the favicon service and the current page are updated (assuming
295 // the image is for a favicon). 297 // the image is for a favicon).
296 FaviconCandidate best_favicon_candidate_; 298 FaviconCandidate best_favicon_candidate_;
297 299
300 // The URL of TOUCH_ICON or TOUCH_PRCOMPOSED_ICON which has been used to
301 // notify the driver in the previous call of NotifyFaviconUpdated().
302 GURL notified_touch_icon_url_;
303
298 DISALLOW_COPY_AND_ASSIGN(FaviconHandler); 304 DISALLOW_COPY_AND_ASSIGN(FaviconHandler);
299 }; 305 };
300 306
301 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_ 307 #endif // CHROME_BROWSER_FAVICON_FAVICON_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | chrome/browser/favicon/favicon_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698