OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // Extracts the extension id from the app name. | 47 // Extracts the extension id from the app name. |
48 std::string GetExtensionIdFromApplicationName(const std::string& app_name); | 48 std::string GetExtensionIdFromApplicationName(const std::string& app_name); |
49 | 49 |
50 // Creates a shortcut for web application based on given shortcut data. | 50 // Creates a shortcut for web application based on given shortcut data. |
51 // |profile_path| is the path of the creating profile. |shortcut_info) | 51 // |profile_path| is the path of the creating profile. |shortcut_info) |
52 // contains information about the shortcut to create. | 52 // contains information about the shortcut to create. |
53 void CreateShortcut( | 53 void CreateShortcut( |
54 const FilePath& profile_path, | 54 const FilePath& profile_path, |
55 const ShellIntegration::ShortcutInfo& shortcut_info); | 55 const ShellIntegration::ShortcutInfo& shortcut_info); |
56 | 56 |
| 57 // Delete all the shortcuts that have been created for the extension with |
| 58 // |extension_id| in the profile with |profile_path|. |
| 59 void DeleteAllShortcuts(const FilePath& profile_path, |
| 60 const std::string& extension_id); |
| 61 |
57 // Creates a shortcut. Must be called on the file thread. This is used to | 62 // Creates a shortcut. Must be called on the file thread. This is used to |
58 // implement CreateShortcut() above, and can also be used directly from the | 63 // implement CreateShortcut() above, and can also be used directly from the |
59 // file thread. |profile_path| is the path of the creating profile. | 64 // file thread. |profile_path| is the path of the creating profile. |
60 // |shortcut_info| constains info about the shortcut to create. | 65 // |shortcut_info| constains info about the shortcut to create. |
61 bool CreateShortcutOnFileThread( | 66 bool CreateShortcutOnFileThread( |
62 const FilePath& profile_path, | 67 const FilePath& profile_path, |
63 const ShellIntegration::ShortcutInfo& shortcut_info); | 68 const ShellIntegration::ShortcutInfo& shortcut_info); |
64 | 69 |
65 // Returns true if given url is a valid web app url. | 70 // Returns true if given url is a valid web app url. |
66 bool IsValidUrl(const GURL& url); | 71 bool IsValidUrl(const GURL& url); |
(...skipping 23 matching lines...) Expand all Loading... |
90 // shortcuts. Used internally by CreateShortcutOnFileThread. | 95 // shortcuts. Used internally by CreateShortcutOnFileThread. |
91 // |shortcut_data_path| is where to store any resources created for the | 96 // |shortcut_data_path| is where to store any resources created for the |
92 // shortcut, and is also used as the UserDataDir for platform app shortcuts. | 97 // shortcut, and is also used as the UserDataDir for platform app shortcuts. |
93 // |profile_path| is the path of the creating profile. |shortcut_info| | 98 // |profile_path| is the path of the creating profile. |shortcut_info| |
94 // contains info about the shortcut to create. | 99 // contains info about the shortcut to create. |
95 bool CreatePlatformShortcut( | 100 bool CreatePlatformShortcut( |
96 const FilePath& shortcut_data_path, | 101 const FilePath& shortcut_data_path, |
97 const FilePath& profile_path, | 102 const FilePath& profile_path, |
98 const ShellIntegration::ShortcutInfo& shortcut_info); | 103 const ShellIntegration::ShortcutInfo& shortcut_info); |
99 | 104 |
| 105 // Delete all the shortcuts we have added for this extension. This is the |
| 106 // platform specific implementation of the DeleteAllShortcuts function, and |
| 107 // is executed on the FILE thread.. |
| 108 void DeletePlatformShortcuts(const FilePath& profile_path, |
| 109 const std::string& extension_id); |
| 110 |
100 // Sanitizes |name| and returns a version of it that is safe to use as an | 111 // Sanitizes |name| and returns a version of it that is safe to use as an |
101 // on-disk file name . | 112 // on-disk file name . |
102 FilePath GetSanitizedFileName(const string16& name); | 113 FilePath GetSanitizedFileName(const string16& name); |
103 | 114 |
104 } // namespace internals | 115 } // namespace internals |
105 | 116 |
106 } // namespace web_app | 117 } // namespace web_app |
107 | 118 |
108 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 119 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |