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

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: Addressed review comment 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/apps/shortcut_manager.cc
diff --git a/chrome/browser/apps/shortcut_manager.cc b/chrome/browser/apps/shortcut_manager.cc
index 0da0a8d740b8b12fe5445003be986a5119c9dae1..94cc91729068097e55c99fc4814ca96ee8022a7e 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,20 @@ 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.hidden = true;
benwells 2014/06/05 09:27:43 I think this will have some effect on Linux; it mi
tmdiep 2014/06/06 02:49:55 I thought the purpose of adding NoDisplay=true in
Matt Giuca 2014/06/06 05:50:17 Yeah, NoDisplay=true is what you want if you want
+ } 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 +127,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') | chrome/browser/extensions/extension_ui_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698