| Index: chrome/browser/extensions/extension_install_ui.cc
|
| diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
|
| index 2f1efd5039644cac91196e62f75da7d02cef0f25..45900242fb293f0fb8b7e30b7f543e5320c3c9da 100644
|
| --- a/chrome/browser/extensions/extension_install_ui.cc
|
| +++ b/chrome/browser/extensions/extension_install_ui.cc
|
| @@ -128,10 +128,15 @@ void ExtensionInstallUI::OnInstallSuccess(const Extension* extension) {
|
| return;
|
| }
|
|
|
| - // GetLastActiveWithProfile will fail on the build bots. This needs to be
|
| - // implemented differently if any test is created which depends on
|
| - // ExtensionInstalledBubble showing.
|
| - Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
|
| + // Note that browser actions don't appear in incognito mode initially,
|
| + // so be sure to use a normal browser window.
|
| + Profile* profile = profile_;
|
| + if (extension->browser_action())
|
| + profile = profile->GetOriginalProfile();
|
| + Browser* browser = Browser::GetOrCreateTabbedBrowser(profile);
|
| + if (browser->tab_count() == 0)
|
| + browser->AddBlankTab(true);
|
| + browser->window()->Show();
|
|
|
| if (extension->GetFullLaunchURL().is_valid()) {
|
| std::string hash_params = "app-id=";
|
| @@ -146,16 +151,9 @@ void ExtensionInstallUI::OnInstallSuccess(const Extension* extension) {
|
| }
|
|
|
| #if defined(TOOLKIT_VIEWS)
|
| - if (!browser)
|
| - return;
|
| -
|
| ExtensionInstalledBubble::Show(extension, browser, icon_);
|
| #elif defined(OS_MACOSX)
|
| - DCHECK(browser);
|
| - // Note that browser actions don't appear in incognito mode initially,
|
| - // so fall back to the generic case.
|
| - if ((extension->browser_action() && !browser->profile()->IsOffTheRecord()) ||
|
| - !extension->omnibox_keyword().empty() ||
|
| + if ((extension->browser_action()) || !extension->omnibox_keyword().empty() ||
|
| (extension->page_action() &&
|
| !extension->page_action()->default_icon_path().empty())) {
|
| ExtensionInstalledBubbleCocoa::ShowExtensionInstalledBubble(
|
| @@ -168,8 +166,6 @@ void ExtensionInstallUI::OnInstallSuccess(const Extension* extension) {
|
| ShowGenericExtensionInstalledInfoBar(extension);
|
| }
|
| #elif defined(TOOLKIT_GTK)
|
| - if (!browser)
|
| - return;
|
| ExtensionInstalledBubbleGtk::Show(extension, browser, icon_);
|
| #endif // TOOLKIT_VIEWS
|
| }
|
|
|