OLD | NEW |
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_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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // entries, which should rarely happen. | 44 // entries, which should rarely happen. |
45 gfx::Image GetFavicon() const; | 45 gfx::Image GetFavicon() const; |
46 | 46 |
47 // Returns true if we have the favicon for the page. | 47 // Returns true if we have the favicon for the page. |
48 bool FaviconIsValid() const; | 48 bool FaviconIsValid() const; |
49 | 49 |
50 // Returns whether the favicon should be displayed. If this returns false, no | 50 // Returns whether the favicon should be displayed. If this returns false, no |
51 // space is provided for the favicon, and the favicon is never displayed. | 51 // space is provided for the favicon, and the favicon is never displayed. |
52 virtual bool ShouldDisplayFavicon(); | 52 virtual bool ShouldDisplayFavicon(); |
53 | 53 |
| 54 // Returns the current tab's favicon urls. Returns NULL if the current tab's |
| 55 // favicon urls have not been populated yet. |
| 56 const std::vector<content::FaviconURL>& favicon_urls() const { |
| 57 return favicon_urls_; |
| 58 } |
| 59 |
54 // Allows the client to determine if they want to fetch the Favicons as | 60 // Allows the client to determine if they want to fetch the Favicons as |
55 // they are discovered. | 61 // they are discovered. |
56 void set_should_fetch_icons(bool fetch) { | 62 void set_should_fetch_icons(bool fetch) { |
57 should_fetch_icons_ = fetch; | 63 should_fetch_icons_ = fetch; |
58 } | 64 } |
59 | 65 |
60 // content::WebContentsObserver override. Must be public, because also | 66 // content::WebContentsObserver override. Must be public, because also |
61 // called from PrerenderContents. | 67 // called from PrerenderContents. |
62 virtual void DidUpdateFaviconURL( | 68 virtual void DidUpdateFaviconURL( |
63 int32 page_id, | 69 int32 page_id, |
(...skipping 23 matching lines...) Expand all Loading... |
87 virtual void DidStartNavigationToPendingEntry( | 93 virtual void DidStartNavigationToPendingEntry( |
88 const GURL& url, | 94 const GURL& url, |
89 content::NavigationController::ReloadType reload_type) OVERRIDE; | 95 content::NavigationController::ReloadType reload_type) OVERRIDE; |
90 virtual void DidNavigateMainFrame( | 96 virtual void DidNavigateMainFrame( |
91 const content::LoadCommittedDetails& details, | 97 const content::LoadCommittedDetails& details, |
92 const content::FrameNavigateParams& params) OVERRIDE; | 98 const content::FrameNavigateParams& params) OVERRIDE; |
93 | 99 |
94 Profile* profile_; | 100 Profile* profile_; |
95 bool should_fetch_icons_; | 101 bool should_fetch_icons_; |
96 | 102 |
| 103 std::vector<content::FaviconURL> favicon_urls_; |
| 104 |
97 scoped_ptr<FaviconHandler> favicon_handler_; | 105 scoped_ptr<FaviconHandler> favicon_handler_; |
98 | 106 |
99 // Handles downloading touchicons. It is NULL if | 107 // Handles downloading touchicons. It is NULL if |
100 // browser_defaults::kEnableTouchIcon is false. | 108 // browser_defaults::kEnableTouchIcon is false. |
101 scoped_ptr<FaviconHandler> touch_icon_handler_; | 109 scoped_ptr<FaviconHandler> touch_icon_handler_; |
102 | 110 |
103 DISALLOW_COPY_AND_ASSIGN(FaviconTabHelper); | 111 DISALLOW_COPY_AND_ASSIGN(FaviconTabHelper); |
104 }; | 112 }; |
105 | 113 |
106 #endif // CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ | 114 #endif // CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ |
OLD | NEW |