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

Unified Diff: chrome/browser/web_applications/web_app.cc

Issue 263403002: Replace OnceOffCreateShortcuts with UpdateShortcutsForAllAppsIfNeeded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments 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/web_applications/web_app.h ('k') | chrome/browser/web_applications/web_app_android.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.cc
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index 7f9964552949d1b2321b08cfaafdcf63be7b996f..5397c1dc0be51039032afca514a3ee3908276404 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -12,6 +12,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread.h"
+#include "chrome/browser/extensions/extension_ui_util.h"
#include "chrome/browser/extensions/image_loader.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
@@ -21,8 +22,10 @@
#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
+#include "extensions/browser/extension_registry.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
+#include "extensions/common/extension_set.h"
#include "extensions/common/manifest_handlers/icons_handler.h"
#include "grit/theme_resources.h"
#include "skia/ext/image_operations.h"
@@ -292,6 +295,13 @@ void UpdateShortcutInfoAndIconForApp(const extensions::Extension* extension,
base::Bind(&IgnoreFileHandlersInfo, callback));
}
+bool ShouldCreateShortcutFor(Profile* profile,
+ const extensions::Extension* extension) {
+ return extension->is_platform_app() &&
+ extension->location() != extensions::Manifest::COMPONENT &&
+ extensions::ui_util::ShouldDisplayInAppLauncher(extension, profile);
+}
+
base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path,
const std::string& extension_id,
const GURL& url) {
@@ -374,6 +384,9 @@ void CreateShortcuts(ShortcutCreationReason reason,
const extensions::Extension* app) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (!ShouldCreateShortcutFor(profile, app))
+ return;
+
GetInfoForApp(app,
profile,
base::Bind(&CreateShortcutsWithInfo, reason, locations));
« no previous file with comments | « chrome/browser/web_applications/web_app.h ('k') | chrome/browser/web_applications/web_app_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698