| Index: chrome/browser/ui/extensions/extension_install_ui_default.cc
|
| diff --git a/chrome/browser/ui/extensions/extension_install_ui_default.cc b/chrome/browser/ui/extensions/extension_install_ui_default.cc
|
| index dd8ca0a2a5d74221ff523234e8c5b994fd9763ad..e736da84535f43f3c45baccc1a41b94b22695fba 100644
|
| --- a/chrome/browser/ui/extensions/extension_install_ui_default.cc
|
| +++ b/chrome/browser/ui/extensions/extension_install_ui_default.cc
|
| @@ -139,60 +139,6 @@ bool ErrorInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) {
|
|
|
| } // namespace
|
|
|
| -
|
| -// ExtensionInstallUI ---------------------------------------------------------
|
| -
|
| -// static
|
| -ExtensionInstallUI* ExtensionInstallUI::Create(Profile* profile) {
|
| - return new ExtensionInstallUIDefault(profile);
|
| -}
|
| -
|
| -// static
|
| -void ExtensionInstallUI::OpenAppInstalledUI(Profile* profile,
|
| - const std::string& app_id) {
|
| -#if defined(OS_CHROMEOS)
|
| - // App Launcher always enabled on ChromeOS, so always handled in
|
| - // OnInstallSuccess.
|
| - NOTREACHED();
|
| -#else
|
| - Browser* browser = FindOrCreateVisibleBrowser(profile);
|
| - if (browser) {
|
| - GURL url(chrome::IsInstantExtendedAPIEnabled() ?
|
| - chrome::kChromeUIAppsURL : chrome::kChromeUINewTabURL);
|
| - chrome::NavigateParams params(
|
| - chrome::GetSingletonTabNavigateParams(browser, url));
|
| - chrome::Navigate(¶ms);
|
| -
|
| - content::NotificationService::current()->Notify(
|
| - chrome::NOTIFICATION_APP_INSTALLED_TO_NTP,
|
| - content::Source<WebContents>(params.target_contents),
|
| - content::Details<const std::string>(&app_id));
|
| - }
|
| -#endif
|
| -}
|
| -
|
| -// static
|
| -ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithBrowser(
|
| - Browser* browser) {
|
| - content::WebContents* web_contents = NULL;
|
| - if (browser)
|
| - web_contents = browser->tab_strip_model()->GetActiveWebContents();
|
| - return new ExtensionInstallPrompt(web_contents);
|
| -}
|
| -
|
| -// static
|
| -ExtensionInstallPrompt* ExtensionInstallUI::CreateInstallPromptWithProfile(
|
| - Profile* profile) {
|
| - Browser* browser = chrome::FindLastActiveWithProfile(profile,
|
| - chrome::GetActiveDesktop());
|
| - if (browser)
|
| - return CreateInstallPromptWithBrowser(browser);
|
| - // No browser window is open yet. Create a free-standing dialog associated
|
| - // with |profile|.
|
| - return new ExtensionInstallPrompt(profile, NULL, NULL);
|
| -}
|
| -
|
| -
|
| // ExtensionInstallUIDefault --------------------------------------------------
|
|
|
| ExtensionInstallUIDefault::ExtensionInstallUIDefault(Profile* profile)
|
| @@ -254,7 +200,7 @@ void ExtensionInstallUIDefault::OnInstallSuccess(const Extension* extension,
|
| return;
|
| }
|
|
|
| - ExtensionInstallUI::OpenAppInstalledUI(current_profile, extension->id());
|
| + OpenAppInstalledUI(extension->id());
|
| return;
|
| }
|
|
|
| @@ -279,6 +225,41 @@ void ExtensionInstallUIDefault::OnInstallFailure(
|
| error);
|
| }
|
|
|
| +void ExtensionInstallUIDefault::OpenAppInstalledUI(const std::string& app_id) {
|
| +#if defined(OS_CHROMEOS)
|
| + // App Launcher always enabled on ChromeOS, so always handled in
|
| + // OnInstallSuccess.
|
| + NOTREACHED();
|
| +#else
|
| + Browser* browser = FindOrCreateVisibleBrowser(profile);
|
| + if (browser) {
|
| + GURL url(chrome::IsInstantExtendedAPIEnabled() ?
|
| + chrome::kChromeUIAppsURL : chrome::kChromeUINewTabURL);
|
| + chrome::NavigateParams params(
|
| + chrome::GetSingletonTabNavigateParams(browser, url));
|
| + chrome::Navigate(¶ms);
|
| +
|
| + content::NotificationService::current()->Notify(
|
| + chrome::NOTIFICATION_APP_INSTALLED_TO_NTP,
|
| + content::Source<WebContents>(params.target_contents),
|
| + content::Details<const std::string>(&app_id));
|
| + }
|
| +#endif
|
| +}
|
| +
|
| +ExtensionInstallPrompt* ExtensionInstallUIDefault::CreateInstallPrompt() {
|
| + Browser* browser = chrome::FindLastActiveWithProfile(profile(),
|
| + chrome::GetActiveDesktop());
|
| + if (browser) {
|
| + content::WebContents* web_contents =
|
| + browser->tab_strip_model()->GetActiveWebContents();
|
| + return new ExtensionInstallPrompt(web_contents);
|
| + }
|
| + // No browser window is open yet. Create a free-standing dialog associated
|
| + // with |profile|.
|
| + return new ExtensionInstallPrompt(profile(), NULL, NULL);
|
| +}
|
| +
|
| void ExtensionInstallUIDefault::SetUseAppInstalledBubble(bool use_bubble) {
|
| use_app_installed_bubble_ = use_bubble;
|
| }
|
|
|