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

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

Issue 907473002: Polish UI of bookmark app creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix another whoopsie Created 5 years, 10 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/bookmark_app_helper.cc
diff --git a/chrome/browser/extensions/bookmark_app_helper.cc b/chrome/browser/extensions/bookmark_app_helper.cc
index 51755bc9eb8bbd1c93e1484b8cc304ed235143e7..7cd87eeea45d441a23dfaa2497d9ac5e2d8ebbda 100644
--- a/chrome/browser/extensions/bookmark_app_helper.cc
+++ b/chrome/browser/extensions/bookmark_app_helper.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/host_desktop.h"
+#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/url_constants.h"
@@ -419,16 +420,30 @@ void BookmarkAppHelper::FinishInstallation(const Extension* extension) {
return;
}
- // Pin the app to the shelf on Ash.
+ // Pin the app to the shelf on Ash, or the taskbar / dock on Windows /
+ // Mac.
sashab 2015/02/06 15:35:44 nit: "Pin the app to the shelf/taskbar/dock on Ash
benwells 2015/02/06 15:52:17 Done.
+ Profile* current_profile = profile_->GetOriginalProfile();
chrome::HostDesktopType desktop = browser->host_desktop_type();
+ if (desktop != chrome::HOST_DESKTOP_TYPE_ASH) {
+ web_app::ShortcutLocations creation_locations;
+#if defined(OS_LINUX)
+ creation_locations.on_desktop = true;
+#else
+ creation_locations.on_desktop = false;
+#endif
+ creation_locations.applications_menu_location =
+ web_app::APP_MENU_LOCATION_HIDDEN;
+ creation_locations.in_quick_launch_bar = true;
+ web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER,
+ creation_locations, current_profile, extension);
#if defined(USE_ASH)
- if (desktop == chrome::HOST_DESKTOP_TYPE_ASH)
+ } else {
ChromeLauncherController::instance()->PinAppWithID(extension->id());
#endif
+ }
// Show the newly installed app in the app launcher, in finder (on Mac) or
// chrome://apps.
- Profile* current_profile = profile_->GetOriginalProfile();
if (IsAppLauncherEnabled()) {
AppListService::Get(desktop)
->ShowForAppInstall(current_profile, extension->id(), false);

Powered by Google App Engine
This is Rietveld 408576698