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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 311293002: Ensure ephemeral apps have dock icons on mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use new enum instead of hidden Created 6 years, 6 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
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 9199441a640622964c01bc8349fee285ddb7e67e..7bfa3d339bf2b0d13df6506eaca7a9e4125ea944 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -599,8 +599,13 @@ bool WebAppShortcutCreator::CreateShortcuts(
} else {
paths.push_back(app_data_dir_);
}
- paths.push_back(applications_dir);
+ bool shortcut_visible =
+ creation_locations.applications_menu_location != APP_MENU_LOCATION_HIDDEN;
+ if (shortcut_visible)
+ paths.push_back(applications_dir);
+
+ DCHECK(!paths.empty());
size_t success_count = CreateShortcutsIn(paths);
if (success_count == 0)
return false;
@@ -611,7 +616,8 @@ bool WebAppShortcutCreator::CreateShortcuts(
if (success_count != paths.size())
return false;
- if (creation_locations.in_quick_launch_bar && path_to_add_to_dock) {
+ if (creation_locations.in_quick_launch_bar && path_to_add_to_dock &&
+ shortcut_visible) {
switch (dock::AddIcon(path_to_add_to_dock, nil)) {
case dock::IconAddFailure:
// If adding the icon failed, instead reveal the Finder window.
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698