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

Unified Diff: chrome/browser/shell_integration.h

Issue 164280: First step to create application shortcuts on Linux. (Closed)
Patch Set: now tested Created 11 years, 4 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/shell_integration.h
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 40592666fcddc717c973ecb13ae8fea9d50a79a4..9abfadde31737f4d861ff45d76941c2c21cf5699 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 {

Powered by Google App Engine
This is Rietveld 408576698