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

Unified Diff: chrome/browser/ui/extensions/extension_install_ui_default.cc

Issue 16172005: Clean up async app launcher enabled checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 7 years, 7 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/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 eff9b8a23fb31632bacfa588ce0ad04ae313d236..5c7e5e1c0f4efd374bf046cf9c7254d6261fefad 100644
--- a/chrome/browser/ui/extensions/extension_install_ui_default.cc
+++ b/chrome/browser/ui/extensions/extension_install_ui_default.cc
@@ -70,30 +70,6 @@ void ShowExtensionInstalledBubble(const extensions::Extension* extension,
chrome::ShowExtensionInstalledBubble(extension, browser, icon);
}
-void OnAppLauncherEnabledCompleted(const extensions::Extension* extension,
- Profile* profile,
- SkBitmap* icon,
- bool use_bubble,
- bool use_launcher) {
- if (use_launcher) {
- AppListService::Get()->ShowAppList(profile);
-
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST,
- content::Source<Profile>(profile),
- content::Details<const std::string>(&extension->id()));
- return;
- }
-
- if (use_bubble) {
- ShowExtensionInstalledBubble(extension, profile, *icon);
- return;
- }
-
- ExtensionInstallUI::OpenAppInstalledUI(profile, extension->id());
-}
-
-
// ErrorInfobarDelegate -------------------------------------------------------
// Helper class to put up an infobar when installation fails.
@@ -265,9 +241,22 @@ void ExtensionInstallUIDefault::OnInstallSuccess(const Extension* extension,
cmdline->HasSwitch(switches::kAppsNewInstallBubble));
#endif
- apps::GetIsAppLauncherEnabled(
- base::Bind(&OnAppLauncherEnabledCompleted, extension, current_profile,
- icon, use_bubble));
+ if (apps::IsAppLauncherEnabled()) {
+ AppListService::Get()->ShowAppList(current_profile);
+
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_APP_INSTALLED_TO_APPLIST,
+ content::Source<Profile>(current_profile),
+ content::Details<const std::string>(&extension->id()));
+ return;
+ }
+
+ if (use_bubble) {
+ ShowExtensionInstalledBubble(extension, current_profile, *icon);
+ return;
+ }
+
+ ExtensionInstallUI::OpenAppInstalledUI(current_profile, extension->id());
return;
}
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698