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

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: 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
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..f5ed921b1866697a942e00d2044d97d03bb07204 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -599,8 +599,11 @@ bool WebAppShortcutCreator::CreateShortcuts(
} else {
paths.push_back(app_data_dir_);
}
- paths.push_back(applications_dir);
+ if (!creation_locations.hidden)
+ paths.push_back(applications_dir);
+
+ DCHECK(!paths.empty());
size_t success_count = CreateShortcutsIn(paths);
if (success_count == 0)
return false;
@@ -611,7 +614,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 &&
+ !creation_locations.hidden) {
switch (dock::AddIcon(path_to_add_to_dock, nil)) {
case dock::IconAddFailure:
// If adding the icon failed, instead reveal the Finder window.
« chrome/browser/extensions/extension_ui_util.h ('K') | « chrome/browser/web_applications/web_app.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698