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

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

Issue 12208085: On Linux, automatically create app shortcuts on install or update. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Work around obscure crash due to bug in glib <= 2.32. Created 7 years, 9 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/shell_integration_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_applications/web_app_linux.cc
diff --git a/chrome/browser/web_applications/web_app_linux.cc b/chrome/browser/web_applications/web_app_linux.cc
index 0378b2acfb480b363b32f19409064ce482960023..7685c386336038c671d6097f2766ace002b67d10 100644
--- a/chrome/browser/web_applications/web_app_linux.cc
+++ b/chrome/browser/web_applications/web_app_linux.cc
@@ -40,7 +40,20 @@ void DeletePlatformShortcuts(
void UpdatePlatformShortcuts(
const base::FilePath& web_app_path,
const ShellIntegration::ShortcutInfo& shortcut_info) {
- // TODO(benwells): Implement this.
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
+
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+
+ // Find out whether shortcuts are already installed.
+ ShellIntegration::ShortcutLocations creation_locations =
+ ShellIntegrationLinux::GetExistingShortcutLocations(
+ env.get(), shortcut_info.profile_path, shortcut_info.extension_id);
+ // Always create a hidden shortcut in applications if a visible one is not
+ // being created. This allows the operating system to identify the app, but
+ // not show it in the menu.
+ creation_locations.hidden = true;
+
+ CreatePlatformShortcuts(web_app_path, shortcut_info, creation_locations);
}
} // namespace internals
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698