Chromium Code Reviews| 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..37cc9b07c25b121a5d465384d96db8b2b9c4de0d 100644 |
| --- a/chrome/browser/shell_integration_linux.h |
| +++ b/chrome/browser/shell_integration_linux.h |
| @@ -21,6 +21,16 @@ namespace ShellIntegrationLinux { |
| // Returns filename of the desktop shortcut used to launch the browser. |
| std::string GetDesktopName(base::Environment* env); |
| +// 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 GetExistingDesktopShortcutContents(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 +44,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 +53,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 |
| @@ -60,6 +72,22 @@ bool CreateDesktopShortcut( |
| void DeleteDesktopShortcuts(const base::FilePath& profile_path, |
| const std::string& extension_id); |
| +// 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 does not count as being in the applications |
| +// menu (as it is invisible to the user). |
| +ShellIntegration::ShortcutLocations DesktopShortcutLocations( |
| + base::Environment* env, const base::FilePath& profile_path, |
|
benwells
2013/03/05 04:32:38
Nit: One parameter per line.
Matt Giuca
2013/03/06 06:29:51
Done.
|
| + const std::string& extension_id); |
| + |
| +// Version of DesktopShortcutLocations 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 DesktopShortcutLocations( |
| + base::Environment* env, const base::FilePath& profile_path, |
| + const std::string& extension_id, const base::FilePath& desktop_path); |
|
benwells
2013/03/05 04:32:38
Nit: One parameter per line.
Matt Giuca
2013/03/06 06:29:51
Done.
|
| + |
| } // namespace ShellIntegrationLinux |
| #endif // CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_ |