| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FAV_ICON_HELPER_H__ | 5 #ifndef CHROME_BROWSER_FAV_ICON_HELPER_H__ |
| 6 #define CHROME_BROWSER_FAV_ICON_HELPER_H__ | 6 #define CHROME_BROWSER_FAV_ICON_HELPER_H__ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // If the TabContents has a delegate, it is notified of the new favicon | 149 // If the TabContents has a delegate, it is notified of the new favicon |
| 150 // (INVALIDATE_FAVICON). | 150 // (INVALIDATE_FAVICON). |
| 151 void UpdateFavIcon(NavigationEntry* entry, | 151 void UpdateFavIcon(NavigationEntry* entry, |
| 152 scoped_refptr<RefCountedMemory> data); | 152 scoped_refptr<RefCountedMemory> data); |
| 153 void UpdateFavIcon(NavigationEntry* entry, const SkBitmap& image); | 153 void UpdateFavIcon(NavigationEntry* entry, const SkBitmap& image); |
| 154 | 154 |
| 155 // Scales the image such that either the width and/or height is 16 pixels | 155 // Scales the image such that either the width and/or height is 16 pixels |
| 156 // wide. Does nothing if the image is empty. | 156 // wide. Does nothing if the image is empty. |
| 157 SkBitmap ConvertToFavIconSize(const SkBitmap& image); | 157 SkBitmap ConvertToFavIconSize(const SkBitmap& image); |
| 158 | 158 |
| 159 // Returns true if the favicon should be saved. |
| 160 bool ShouldSaveFavicon(const GURL& url); |
| 161 |
| 159 // Hosting TabContents. We callback into this when done. | 162 // Hosting TabContents. We callback into this when done. |
| 160 TabContents* tab_contents_; | 163 TabContents* tab_contents_; |
| 161 | 164 |
| 162 // Used for history requests. | 165 // Used for history requests. |
| 163 CancelableRequestConsumer cancelable_consumer_; | 166 CancelableRequestConsumer cancelable_consumer_; |
| 164 | 167 |
| 165 // URL of the page we're requesting the favicon for. | 168 // URL of the page we're requesting the favicon for. |
| 166 GURL url_; | 169 GURL url_; |
| 167 | 170 |
| 168 // Whether we got the url for the page back from the renderer. | 171 // Whether we got the url for the page back from the renderer. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 180 bool fav_icon_expired_; | 183 bool fav_icon_expired_; |
| 181 | 184 |
| 182 // Requests to the renderer to download favicons. | 185 // Requests to the renderer to download favicons. |
| 183 typedef std::map<int, DownloadRequest> DownloadRequests; | 186 typedef std::map<int, DownloadRequest> DownloadRequests; |
| 184 DownloadRequests download_requests_; | 187 DownloadRequests download_requests_; |
| 185 | 188 |
| 186 DISALLOW_COPY_AND_ASSIGN(FavIconHelper); | 189 DISALLOW_COPY_AND_ASSIGN(FavIconHelper); |
| 187 }; | 190 }; |
| 188 | 191 |
| 189 #endif // CHROME_BROWSER_FAV_ICON_HELPER_H__ | 192 #endif // CHROME_BROWSER_FAV_ICON_HELPER_H__ |
| OLD | NEW |