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

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: Diff against Issue 12386077. Created 7 years, 10 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/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..27274ea782d111fa01fe5943e980b778e14bd7a9 100644
--- a/chrome/browser/web_applications/web_app_linux.cc
+++ b/chrome/browser/web_applications/web_app_linux.cc
@@ -40,7 +40,21 @@ 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::DesktopShortcutLocations(
+ env.get(), shortcut_info.profile_path, shortcut_info.extension_id);
+
+ // If there is are existing shortcuts, this will update them and the icon.
+ // If not, this will create an app shortcut with NoDisplay=true, which allows
+ // the operating system to identify the app, but not show it in the menu.
+ // Note that a shortcut with NoDisplay=true does not cause app_shortcut_info
+ // to be true, so the update will preserve the value of NoDisplay.
+ CreatePlatformShortcuts(web_app_path, shortcut_info, creation_locations);
}
} // namespace internals
« chrome/browser/shell_integration_linux.cc ('K') | « chrome/browser/shell_integration_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698