| Index: chrome/browser/extensions/tab_helper.cc
|
| diff --git a/chrome/browser/extensions/tab_helper.cc b/chrome/browser/extensions/tab_helper.cc
|
| index 570f7b7cbd0ce8b136becce73bf29301d777819f..d0b2d86c270db0bde00d87931c9ac7513dad5821 100644
|
| --- a/chrome/browser/extensions/tab_helper.cc
|
| +++ b/chrome/browser/extensions/tab_helper.cc
|
| @@ -34,6 +34,7 @@
|
| #include "chrome/browser/ui/browser_dialogs.h"
|
| #include "chrome/browser/ui/browser_finder.h"
|
| #include "chrome/browser/ui/host_desktop.h"
|
| +#include "chrome/browser/ui/web_applications/hosted_app_tab_helper.h"
|
| #include "chrome/browser/ui/web_applications/web_app_ui.h"
|
| #include "chrome/browser/web_applications/web_app.h"
|
| #include "chrome/common/extensions/extension.h"
|
| @@ -309,7 +310,8 @@ void TabHelper::OnDidGetApplicationInfo(int32 page_id,
|
| break;
|
| }
|
| case CREATE_HOSTED_APP: {
|
| - CreateHostedApp(info);
|
| + HostedAppTabHelper::FromWebContents(web_contents())->
|
| + CreateHostedApp(info);
|
| break;
|
| }
|
| case UPDATE_SHORTCUT: {
|
| @@ -328,39 +330,6 @@ void TabHelper::OnDidGetApplicationInfo(int32 page_id,
|
| #endif
|
| }
|
|
|
| -void TabHelper::CreateHostedApp(const WebApplicationInfo& info) {
|
| - ShellIntegration::ShortcutInfo shortcut_info;
|
| - web_app::GetShortcutInfoForTab(web_contents(), &shortcut_info);
|
| - WebApplicationInfo web_app_info;
|
| -
|
| - web_app_info.is_bookmark_app = true;
|
| - web_app_info.app_url = shortcut_info.url;
|
| - web_app_info.title = shortcut_info.title;
|
| - web_app_info.urls.push_back(web_app_info.app_url);
|
| -
|
| - // TODO(calamity): this should attempt to download the best icon that it can
|
| - // from |info.icons| rather than just using the favicon as it scales up badly.
|
| - // Fix this once |info.icons| gets populated commonly.
|
| -
|
| - // Get the smallest icon in the icon family (should have only 1).
|
| - const gfx::Image* icon = shortcut_info.favicon.GetBest(0, 0);
|
| - SkBitmap bitmap = icon ? icon->AsBitmap() : SkBitmap();
|
| -
|
| - if (!icon->IsEmpty()) {
|
| - WebApplicationInfo::IconInfo icon_info;
|
| - icon_info.data = bitmap;
|
| - icon_info.width = icon_info.data.width();
|
| - icon_info.height = icon_info.data.height();
|
| - web_app_info.icons.push_back(icon_info);
|
| - }
|
| -
|
| - ExtensionService* service = profile_->GetExtensionService();
|
| - scoped_refptr<extensions::CrxInstaller> installer(
|
| - extensions::CrxInstaller::CreateSilent(service));
|
| - installer->set_error_on_unsupported_requirements(true);
|
| - installer->InstallWebApp(web_app_info);
|
| -}
|
| -
|
| void TabHelper::OnInlineWebstoreInstall(
|
| int install_id,
|
| int return_route_id,
|
|
|