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

Unified Diff: chrome/browser/apps/shortcut_manager.cc

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 | « no previous file | chrome/browser/extensions/extension_ui_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/shortcut_manager.cc
diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc
index 0da0a8d740b8b12fe5445003be986a5119c9dae1..9d47a5e9f1c71a9a3fbfc1de1c6afc25cbc0912c 100644
--- a/chrome/browser/apps/shortcut_manager.cc
+++ b/chrome/browser/apps/shortcut_manager.cc
@@ -24,6 +24,7 @@
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/extension_util.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/one_shot_event.h"
@@ -39,14 +40,21 @@ const int kCurrentAppShortcutsVersion = 0;
// Delay in seconds before running UpdateShortcutsForAllApps.
const int kUpdateShortcutsForAllAppsDelay = 10;
-// Creates a shortcut for an application in the applications menu, if there is
-// not already one present.
-void CreateShortcutsInApplicationsMenu(Profile* profile,
- const Extension* app) {
+void CreateShortcutsForApp(Profile* profile, const Extension* app) {
web_app::ShortcutLocations creation_locations;
- // Create the shortcut in the Chrome Apps subdir.
- creation_locations.applications_menu_location =
- web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS;
+
+ if (extensions::util::IsEphemeralApp(app->id(), profile)) {
+ // Ephemeral apps should not have visible shortcuts, but may still require
+ // platform-specific handling.
+ creation_locations.applications_menu_location =
+ web_app::APP_MENU_LOCATION_HIDDEN;
+ } else {
+ // Creates a shortcut for an app in the Chrome Apps subdir of the
+ // applications menu, if there is not already one present.
+ creation_locations.applications_menu_location =
+ web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS;
+ }
+
web_app::CreateShortcuts(
web_app::SHORTCUT_CREATION_AUTOMATED, creation_locations, profile, app);
}
@@ -120,7 +128,7 @@ void AppShortcutManager::OnExtensionWillBeInstalled(
web_app::UpdateAllShortcuts(
base::UTF8ToUTF16(old_name), profile_, extension);
} else {
- CreateShortcutsInApplicationsMenu(profile_, extension);
+ CreateShortcutsForApp(profile_, extension);
}
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_ui_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698