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

Unified Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 5208001: Fix a bug where installing an extension in incognito would not show the help (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove check Created 10 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698