diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-12 21:34:49 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-12 21:34:49 +0000 |
commit | b96aa938b7f86b67f7d4c167e713f5c23fae01d6 (patch) | |
tree | 92c58342b82e416a5ffd29a7c283fdcfe9c0c82b /chrome/browser/shell_integration.h | |
parent | 4778bf3be094a4faac5e622a5f18be308908e53c (diff) | |
download | chromium_src-b96aa938b7f86b67f7d4c167e713f5c23fae01d6.zip chromium_src-b96aa938b7f86b67f7d4c167e713f5c23fae01d6.tar.gz chromium_src-b96aa938b7f86b67f7d4c167e713f5c23fae01d6.tar.bz2 |
First step to create application shortcuts on Linux.
Create a working desktop shortcut. For now it displays no UI, but the backend works.
TEST=none
http://crbug.com/17251
Review URL: http://codereview.chromium.org/164280
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration.h')
-rw-r--r-- | chrome/browser/shell_integration.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h index 4059266..9abfadd 100644 --- a/chrome/browser/shell_integration.h +++ b/chrome/browser/shell_integration.h @@ -7,8 +7,12 @@ #include <string> +#include "base/basictypes.h" #include "base/ref_counted.h" +#include "base/string16.h" +class FilePath; +class GURL; class MessageLoop; class ShellIntegration { @@ -27,6 +31,22 @@ class ShellIntegration { // user. This method is very fast so it can be invoked in the UI thread. static bool IsFirefoxDefaultBrowser(); +#if defined(OS_LINUX) + // Returns filename for .desktop file based on |url|, sanitized for security. + static FilePath GetDesktopShortcutFilename(const GURL& url); + + // Returns contents for .desktop file based on |template_contents|, |url| + // and |title|. The |template_contents| should be contents of .desktop file + // used to launch Chrome. + static std::string GetDesktopFileContents( + const std::string& template_contents, const GURL& url, + const string16& title); + + // Creates a desktop shortcut for |url| with |title|. It is not guaranteed + // to exist immediately after returning from this function, because actual + // file operation is done on the file thread. + static void CreateDesktopShortcut(const GURL& url, const string16& title); +#endif // defined(OS_LINUX) // The current default browser UI state enum DefaultBrowserUIState { |