| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_ | |
| 6 #define CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/files/file_path.h" | |
| 12 #include "chrome/browser/shell_integration.h" | |
| 13 #include "googleurl/src/gurl.h" | |
| 14 | |
| 15 namespace base { | |
| 16 class Environment; | |
| 17 } | |
| 18 | |
| 19 namespace ShellIntegrationLinux { | |
| 20 | |
| 21 // Returns filename of the desktop shortcut used to launch the browser. | |
| 22 std::string GetDesktopName(base::Environment* env); | |
| 23 | |
| 24 bool GetDesktopShortcutTemplate(base::Environment* env, | |
| 25 std::string* output); | |
| 26 | |
| 27 // Returns filename for .desktop file based on |url|, sanitized for security. | |
| 28 base::FilePath GetWebShortcutFilename(const GURL& url); | |
| 29 | |
| 30 // Returns filename for .desktop file based on |profile_path| and | |
| 31 // |extension_id|, sanitized for security. | |
| 32 base::FilePath GetExtensionShortcutFilename(const base::FilePath& profile_path, | |
| 33 const std::string& extension_id); | |
| 34 | |
| 35 // Returns contents for .desktop file based on |template_contents|, |url| | |
| 36 // and |title|. The |template_contents| should be contents of .desktop file | |
| 37 // used to launch Chrome. | |
| 38 std::string GetDesktopFileContents(const std::string& template_contents, | |
| 39 const std::string& app_name, | |
| 40 const GURL& url, | |
| 41 const std::string& extension_id, | |
| 42 const base::FilePath& extension_path, | |
| 43 const string16& title, | |
| 44 const std::string& icon_name, | |
| 45 const base::FilePath& profile_path); | |
| 46 | |
| 47 | |
| 48 // Create shortcuts on the desktop or in the application menu (as specified by | |
| 49 // |shortcut_info|), for the web page or extension in |shortcut_info|. Use the | |
| 50 // shortcut template contained in |shortcut_template|. | |
| 51 // For extensions, duplicate shortcuts are avoided, so if a requested shortcut | |
| 52 // already exists it is deleted first. | |
| 53 bool CreateDesktopShortcut(const ShellIntegration::ShortcutInfo& shortcut_info, | |
| 54 const std::string& shortcut_template); | |
| 55 | |
| 56 // Delete any desktop shortcuts on desktop or in the application menu that have | |
| 57 // been added for the extension with |extension_id| in |profile_path|. | |
| 58 void DeleteDesktopShortcuts(const base::FilePath& profile_path, | |
| 59 const std::string& extension_id); | |
| 60 | |
| 61 } // namespace ShellIntegrationLinux | |
| 62 | |
| 63 #endif // CHROME_BROWSER_SHELL_INTEGRATION_LINUX_H_ | |
| OLD | NEW |