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

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

Issue 7529011: Add a flag that lets the webstore show a different UI on app install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed files added in separate CL (r95432) Created 9 years, 4 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/extensions/extension_install_ui.cc
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index bdbd8395385f7052b9611b65233058e7fdc83566..dc9a6a904ef5c509de3f01ed9d0a0f4bfbfc3a76 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/extension_resource.h"
@@ -88,10 +89,8 @@ void ShowAppInstalledAnimation(Browser* browser, const std::string& app_id) {
}
}
- // If there isn't an NTP, open one and pass it the ID of the installed app.
- std::string url = base::StringPrintf(
- "%s#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str());
- browser->AddSelectedTabWithURL(GURL(url), PageTransition::TYPED);
+ // If there isn't an NTP, open one.
+ ExtensionInstallUI::OpenAppInstalledNTP(browser, app_id);
}
} // namespace
@@ -103,7 +102,8 @@ ExtensionInstallUI::ExtensionInstallUI(Profile* profile)
extension_(NULL),
delegate_(NULL),
prompt_type_(NUM_PROMPT_TYPES),
- ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)),
+ use_app_installed_bubble_(false) {
// Remember the current theme in case the user presses undo.
if (profile_) {
const Extension* previous_theme =
@@ -177,7 +177,15 @@ void ExtensionInstallUI::OnInstallSuccess(const Extension* extension,
browser->AddBlankTab(true);
browser->window()->Show();
- if (extension->GetFullLaunchURL().is_valid()) {
+ bool use_bubble_for_apps = false;
+
+#if defined(TOOLKIT_VIEWS)
+ CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ use_bubble_for_apps = (use_app_installed_bubble_ ||
+ cmdline->HasSwitch(switches::kAppsNewInstallBubble));
+#endif
+
+ if (extension->is_app() && !use_bubble_for_apps) {
ShowAppInstalledAnimation(browser, extension->id());
return;
}
@@ -240,6 +248,14 @@ void ExtensionInstallUI::OnImageLoaded(
}
// static
+void ExtensionInstallUI::OpenAppInstalledNTP(Browser* browser,
+ const std::string& app_id) {
+ std::string url = base::StringPrintf(
+ "%s#app-id=%s", chrome::kChromeUINewTabURL, app_id.c_str());
+ browser->AddSelectedTabWithURL(GURL(url), PageTransition::TYPED);
+}
+
+// static
void ExtensionInstallUI::DisableFailureUIForTests() {
disable_failure_ui_for_tests = true;
}
« no previous file with comments | « chrome/browser/extensions/extension_install_ui.h ('k') | chrome/browser/extensions/extension_webstore_private_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698