| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // FetchFavicon fetches the given page's icons. It requests the icons from the | 24 // FetchFavicon fetches the given page's icons. It requests the icons from the |
| 25 // history backend. If the icon is not available or expired, the icon will be | 25 // history backend. If the icon is not available or expired, the icon will be |
| 26 // downloaded and saved in the history backend. | 26 // downloaded and saved in the history backend. |
| 27 // | 27 // |
| 28 // DownloadImage downloads the specified icon and returns it through the given | 28 // DownloadImage downloads the specified icon and returns it through the given |
| 29 // callback. | 29 // callback. |
| 30 // | 30 // |
| 31 class FaviconTabHelper : public content::WebContentsObserver, | 31 class FaviconTabHelper : public content::WebContentsObserver, |
| 32 public FaviconHandlerDelegate { | 32 public FaviconHandlerDelegate { |
| 33 public: | 33 public: |
| 34 explicit FaviconTabHelper(TabContents* tab_contents); | 34 explicit FaviconTabHelper(content::WebContents* web_contents); |
| 35 virtual ~FaviconTabHelper(); | 35 virtual ~FaviconTabHelper(); |
| 36 | 36 |
| 37 // Initiates loading the favicon for the specified url. | 37 // Initiates loading the favicon for the specified url. |
| 38 void FetchFavicon(const GURL& url); | 38 void FetchFavicon(const GURL& url); |
| 39 | 39 |
| 40 // Returns the favicon for this tab, or IDR_DEFAULT_FAVICON if the tab does | 40 // Returns the favicon for this tab, or IDR_DEFAULT_FAVICON if the tab does |
| 41 // not have a favicon. The default implementation uses the current navigation | 41 // not have a favicon. The default implementation uses the current navigation |
| 42 // entry. This will return an isNull bitmap if there are no navigation | 42 // entry. This will return an isNull bitmap if there are no navigation |
| 43 // entries, which should rarely happen. | 43 // entries, which should rarely happen. |
| 44 SkBitmap GetFavicon() const; | 44 SkBitmap GetFavicon() const; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 scoped_ptr<FaviconHandler> favicon_handler_; | 97 scoped_ptr<FaviconHandler> favicon_handler_; |
| 98 | 98 |
| 99 // Handles downloading touchicons. It is NULL if | 99 // Handles downloading touchicons. It is NULL if |
| 100 // browser_defaults::kEnableTouchIcon is false. | 100 // browser_defaults::kEnableTouchIcon is false. |
| 101 scoped_ptr<FaviconHandler> touch_icon_handler_; | 101 scoped_ptr<FaviconHandler> touch_icon_handler_; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(FaviconTabHelper); | 103 DISALLOW_COPY_AND_ASSIGN(FaviconTabHelper); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 #endif // CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ | 106 #endif // CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ |
| OLD | NEW |