diff options
author | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 06:10:07 +0000 |
---|---|---|
committer | benwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 06:10:07 +0000 |
commit | 914636612ba4bf032b809e1dcf09a11f87384515 (patch) | |
tree | 93fbe4da0ae3e9ac17064e64430a707621722450 /chrome/browser/shell_integration_linux.h | |
parent | c15faf37bc7ae6421489be2f69403e95df9ca237 (diff) | |
download | chromium_src-914636612ba4bf032b809e1dcf09a11f87384515.zip chromium_src-914636612ba4bf032b809e1dcf09a11f87384515.tar.gz chromium_src-914636612ba4bf032b809e1dcf09a11f87384515.tar.bz2 |
Remove app shortcuts when app is uninstalled on Linux.
To support this, shortcut creation on Linux for extensions has been modified so that the filename encodes the extension ID and the profile. Also, when creating shortcuts any existing shortcuts are removed first.
Web page shortcuts are not affected.
BUG=130456
TEST=Test uninstalling apps removes their shortcuts; test uninstalling
apps is not broken in any way; test shortcuts for web apps
are not broken in any way.
Review URL: https://chromiumcodereview.appspot.com/10698114
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_linux.h')
-rw-r--r-- | chrome/browser/shell_integration_linux.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome/browser/shell_integration_linux.h b/chrome/browser/shell_integration_linux.h index 5886250..643068a 100644 --- a/chrome/browser/shell_integration_linux.h +++ b/chrome/browser/shell_integration_linux.h @@ -26,7 +26,12 @@ bool GetDesktopShortcutTemplate(base::Environment* env, std::string* output); // Returns filename for .desktop file based on |url|, sanitized for security. -FilePath GetDesktopShortcutFilename(const GURL& url); +FilePath GetWebShortcutFilename(const GURL& url); + +// Returns filename for .desktop file based on |profile_path| and +// |extension_id|, sanitized for security. +FilePath GetExtensionShortcutFilename(const FilePath& profile_path, + const std::string& extension_id); // Returns contents for .desktop file based on |template_contents|, |url| // and |title|. The |template_contents| should be contents of .desktop file @@ -41,9 +46,20 @@ std::string GetDesktopFileContents(const std::string& template_contents, const std::string& icon_name, const FilePath& profile_path); + +// Create shortcuts on the desktop or in the application menu (as specified by +// |shortcut_info|), for the web page or extension in |shortcut_info|. Use the +// shortcut template contained in |shortcut_template|. +// For extensions, duplicate shortcuts are avoided, so if a requested shortcut +// already exists it is deleted first. bool CreateDesktopShortcut(const ShellIntegration::ShortcutInfo& shortcut_info, const std::string& shortcut_template); +// Delete any desktop shortcuts on desktop or in the application menu that have +// been added for the extension with |extension_id| in |profile_path|. +void DeleteDesktopShortcuts(const FilePath& profile_path, + const std::string& extension_id); + } // namespace ShellIntegrationLinux #endif // CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_ |