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

Unified Diff: chrome/browser/shell_integration_linux.h

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.cc ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_linux.h
diff --git a/chrome/browser/shell_integration_linux.h b/chrome/browser/shell_integration_linux.h
index e3f36ef89ee6031f3418d434c25b0c13d9cfabdc..34bd263566ffa30de0297ff3c5516dcb000ce65b 100644
--- a/chrome/browser/shell_integration_linux.h
+++ b/chrome/browser/shell_integration_linux.h
@@ -21,6 +21,35 @@ namespace ShellIntegrationLinux {
// Returns filename of the desktop shortcut used to launch the browser.
std::string GetDesktopName(base::Environment* env);
+// Returns the set of locations in which shortcuts are installed for the
+// extension with |extension_id| in |profile_path|.
+// This searches the file system for .desktop files in appropriate locations. A
+// shortcut with NoDisplay=true causes hidden to become true, instead of
+// in_applications_menu.
+ShellIntegration::ShortcutLocations GetExistingShortcutLocations(
+ base::Environment* env,
+ const base::FilePath& profile_path,
+ const std::string& extension_id);
+
+// Version of GetExistingShortcutLocations which takes an explicit path
+// to the user's desktop directory. Useful for testing.
+// If |desktop_path| is empty, the desktop is not searched.
+ShellIntegration::ShortcutLocations GetExistingShortcutLocations(
+ base::Environment* env,
+ const base::FilePath& profile_path,
+ const std::string& extension_id,
+ const base::FilePath& desktop_path);
+
+// Returns the contents of an existing .desktop file installed in the system.
+// Searches the "applications" subdirectory of each XDG data directory for a
+// file named |desktop_filename|. If the file is found, populates |output| with
+// its contents and returns true. Else, returns false.
+bool GetExistingShortcutContents(base::Environment* env,
+ const base::FilePath& desktop_filename,
+ std::string* output);
+
+// Returns the contents of the .desktop file for Google Chrome or Chromium. If
+// such a file exists, populates |output| and returns true. Else, returns false.
bool GetDesktopShortcutTemplate(base::Environment* env,
std::string* output);
@@ -34,7 +63,8 @@ base::FilePath GetExtensionShortcutFilename(const base::FilePath& profile_path,
// 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.
+// used to launch Chrome. If |no_display| is true, the shortcut will not be
+// visible to the user in menus.
std::string GetDesktopFileContents(const std::string& template_contents,
const std::string& app_name,
const GURL& url,
@@ -42,7 +72,8 @@ std::string GetDesktopFileContents(const std::string& template_contents,
const base::FilePath& extension_path,
const string16& title,
const std::string& icon_name,
- const base::FilePath& profile_path);
+ const base::FilePath& profile_path,
+ bool no_display);
// Create shortcuts on the desktop or in the application menu (as specified by
« no previous file with comments | « chrome/browser/shell_integration.cc ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698