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

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

Issue 282103003: Moved IS_EPHEMERAL flag to extension prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up file header Created 6 years, 7 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/apps/ephemeral_app_service.cc ('k') | chrome/browser/autocomplete/extension_app_provider.cc » ('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 326722cf0c64c6ade62503ad19d8e9b3c388b257..5e7ca06b42f024c27fa1566b3dadccabcc0a7aeb 100644
--- a/chrome/browser/apps/shortcut_manager.cc
+++ b/chrome/browser/apps/shortcut_manager.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_ui_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -47,10 +48,10 @@ void CreateShortcutsInApplicationsMenu(Profile* profile,
web_app::SHORTCUT_CREATION_AUTOMATED, creation_locations, profile, app);
}
-bool ShouldCreateShortcutFor(const Extension* extension) {
+bool ShouldCreateShortcutFor(Profile* profile, const Extension* extension) {
return extension->is_platform_app() &&
extension->location() != extensions::Manifest::COMPONENT &&
- extension->ShouldDisplayInAppLauncher();
+ extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile);
}
} // namespace
@@ -123,7 +124,7 @@ void AppShortcutManager::Observe(int type,
if (installed_info->is_update) {
web_app::UpdateAllShortcuts(
base::UTF8ToUTF16(installed_info->old_name), profile_, extension);
- } else if (ShouldCreateShortcutFor(extension)) {
+ } else if (ShouldCreateShortcutFor(profile_, extension)) {
CreateShortcutsInApplicationsMenu(profile_, extension);
}
break;
@@ -178,7 +179,7 @@ void AppShortcutManager::OnceOffCreateShortcuts() {
const extensions::ExtensionSet* apps = extension_service->extensions();
for (extensions::ExtensionSet::const_iterator it = apps->begin();
it != apps->end(); ++it) {
- if (ShouldCreateShortcutFor(it->get()))
+ if (ShouldCreateShortcutFor(profile_, it->get()))
CreateShortcutsInApplicationsMenu(profile_, it->get());
}
}
« no previous file with comments | « chrome/browser/apps/ephemeral_app_service.cc ('k') | chrome/browser/autocomplete/extension_app_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698