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

Unified Diff: chrome/browser/ui/panels/panel_host.cc

Issue 11011002: Switch FaviconTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel_host.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_host.cc
diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc
index b3b51f77acd04eef5fbbea10e0a5a8b066253e74..8dbe2e543a320b65c280aa0d8c83b6c1163934ab 100644
--- a/chrome/browser/ui/panels/panel_host.cc
+++ b/chrome/browser/ui/panels/panel_host.cc
@@ -63,7 +63,7 @@ void PanelHost::Init(const GURL& url) {
SessionTabHelper::FromWebContents(web_contents_.get())->SetWindowID(
panel_->session_id());
- favicon_tab_helper_.reset(new FaviconTabHelper(web_contents_.get()));
+ FaviconTabHelper::CreateForWebContents(web_contents_.get());
prefs_tab_helper_.reset(new PrefsTabHelper(web_contents_.get()));
web_contents_->GetController().LoadURL(
@@ -71,14 +71,17 @@ void PanelHost::Init(const GURL& url) {
}
void PanelHost::DestroyWebContents() {
- favicon_tab_helper_.reset();
prefs_tab_helper_.reset();
web_contents_.reset();
}
gfx::Image PanelHost::GetPageIcon() const {
- return favicon_tab_helper_.get() ?
- favicon_tab_helper_->GetFavicon() : gfx::Image();
+ if (!web_contents_.get())
+ return gfx::Image();
+
+ FaviconTabHelper* favicon_tab_helper =
+ FaviconTabHelper::FromWebContents(web_contents_.get());
+ return favicon_tab_helper->GetFavicon();
}
content::WebContents* PanelHost::OpenURLFromTab(
« no previous file with comments | « chrome/browser/ui/panels/panel_host.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698