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

Unified Diff: chrome/browser/ui/web_applications/web_app_ui.cc

Issue 10917026: Switch Extensions::TabHelper to use WebContents, WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only 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
Index: chrome/browser/ui/web_applications/web_app_ui.cc
diff --git a/chrome/browser/ui/web_applications/web_app_ui.cc b/chrome/browser/ui/web_applications/web_app_ui.cc
index bcfb9f4c311ba8ef0e47f2bbd4aa613e0ec4e349..48ab1623352ae72380f912f6cb7039e86ee39936 100644
--- a/chrome/browser/ui/web_applications/web_app_ui.cc
+++ b/chrome/browser/ui/web_applications/web_app_ui.cc
@@ -102,8 +102,10 @@ class UpdateShortcutWorker : public content::NotificationObserver {
UpdateShortcutWorker::UpdateShortcutWorker(TabContents* tab_contents)
: tab_contents_(tab_contents),
profile_path_(tab_contents->profile()->GetPath()) {
+ extensions::TabHelper* extensions_tab_helper =
+ extensions::TabHelper::FromWebContents(tab_contents->web_contents());
web_app::GetShortcutInfoForTab(tab_contents_, &shortcut_info_);
- web_app::GetIconsInfo(tab_contents_->extension_tab_helper()->web_app_info(),
+ web_app::GetIconsInfo(extensions_tab_helper->web_app_info(),
&unprocessed_icons_);
file_name_ = web_app::internals::GetSanitizedFileName(shortcut_info_.title);
@@ -168,7 +170,9 @@ void UpdateShortcutWorker::OnIconDownloaded(int download_id,
if (!errored && !image.isNull()) {
// Update icon with download image and update shortcut.
shortcut_info_.favicon = gfx::Image(image);
- tab_contents_->extension_tab_helper()->SetAppIcon(image);
+ extensions::TabHelper* extensions_tab_helper =
+ extensions::TabHelper::FromWebContents(tab_contents_->web_contents());
+ extensions_tab_helper->SetAppIcon(image);
UpdateShortcuts();
} else {
// Try the next icon otherwise.
@@ -305,8 +309,9 @@ void GetShortcutInfoForTab(TabContents* tab_contents,
DCHECK(info); // Must provide a valid info.
const WebContents* web_contents = tab_contents->web_contents();
- const WebApplicationInfo& app_info =
- tab_contents->extension_tab_helper()->web_app_info();
+ const extensions::TabHelper* extensions_tab_helper =
+ extensions::TabHelper::FromWebContents(web_contents);
+ const WebApplicationInfo& app_info = extensions_tab_helper->web_app_info();
info->url = app_info.app_url.is_empty() ? web_contents->GetURL() :
app_info.app_url;
« no previous file with comments | « chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698