Chromium Code Reviews| 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 // | |
| 57 // Note that this is not guaranteed to be populated until the tab is fully | |
| 58 // loaded. Callers that want to handle favicon urls before the page has loaded | |
| 59 // should implement WebContentsObserver::DidUpdateFaviconURL. | |
|
pkotwicz
2013/12/02 01:00:57
"Callers that want to handle favicon urls before t
calamity
2013/12/03 05:52:15
Done.
| |
| 60 const std::vector<content::FaviconURL>* GetFaviconURLs() { | |
| 61 return favicon_urls_.get(); | |
| 62 } | |
| 63 | |
| 54 // Allows the client to determine if they want to fetch the Favicons as | 64 // Allows the client to determine if they want to fetch the Favicons as |
| 55 // they are discovered. | 65 // they are discovered. |
| 56 void set_should_fetch_icons(bool fetch) { | 66 void set_should_fetch_icons(bool fetch) { |
| 57 should_fetch_icons_ = fetch; | 67 should_fetch_icons_ = fetch; |
| 58 } | 68 } |
| 59 | 69 |
| 60 // content::WebContentsObserver override. Must be public, because also | 70 // content::WebContentsObserver override. Must be public, because also |
| 61 // called from PrerenderContents. | 71 // called from PrerenderContents. |
| 62 virtual void DidUpdateFaviconURL( | 72 virtual void DidUpdateFaviconURL( |
| 63 int32 page_id, | 73 int32 page_id, |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 87 virtual void NavigateToPendingEntry( | 97 virtual void NavigateToPendingEntry( |
| 88 const GURL& url, | 98 const GURL& url, |
| 89 content::NavigationController::ReloadType reload_type) OVERRIDE; | 99 content::NavigationController::ReloadType reload_type) OVERRIDE; |
| 90 virtual void DidNavigateMainFrame( | 100 virtual void DidNavigateMainFrame( |
| 91 const content::LoadCommittedDetails& details, | 101 const content::LoadCommittedDetails& details, |
| 92 const content::FrameNavigateParams& params) OVERRIDE; | 102 const content::FrameNavigateParams& params) OVERRIDE; |
| 93 | 103 |
| 94 Profile* profile_; | 104 Profile* profile_; |
| 95 bool should_fetch_icons_; | 105 bool should_fetch_icons_; |
| 96 | 106 |
| 107 scoped_ptr<std::vector<content::FaviconURL> > favicon_urls_; | |
|
pkotwicz
2013/12/02 01:00:57
Can this just be a std::vector<content::FaviconURL
calamity
2013/12/03 05:52:15
This would require a separate bool to track whethe
pkotwicz
2013/12/03 19:06:49
Given the current implementation, we should make t
| |
| 108 | |
| 97 scoped_ptr<FaviconHandler> favicon_handler_; | 109 scoped_ptr<FaviconHandler> favicon_handler_; |
| 98 | 110 |
| 99 // Handles downloading touchicons. It is NULL if | 111 // Handles downloading touchicons. It is NULL if |
| 100 // browser_defaults::kEnableTouchIcon is false. | 112 // browser_defaults::kEnableTouchIcon is false. |
| 101 scoped_ptr<FaviconHandler> touch_icon_handler_; | 113 scoped_ptr<FaviconHandler> touch_icon_handler_; |
| 102 | 114 |
| 103 DISALLOW_COPY_AND_ASSIGN(FaviconTabHelper); | 115 DISALLOW_COPY_AND_ASSIGN(FaviconTabHelper); |
| 104 }; | 116 }; |
| 105 | 117 |
| 106 #endif // CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ | 118 #endif // CHROME_BROWSER_FAVICON_FAVICON_TAB_HELPER_H_ |
| OLD | NEW |