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 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 std::vector<base::FilePath> GetShortcutPaths( | 222 std::vector<base::FilePath> GetShortcutPaths( |
223 const ShortcutLocations& creation_locations); | 223 const ShortcutLocations& creation_locations); |
224 #endif | 224 #endif |
225 | 225 |
226 // Implemented for each platform, does the platform specific parts of creating | 226 // Implemented for each platform, does the platform specific parts of creating |
227 // shortcuts. Used internally by CreateShortcuts methods. | 227 // shortcuts. Used internally by CreateShortcuts methods. |
228 // |shortcut_data_path| is where to store any resources created for the | 228 // |shortcut_data_path| is where to store any resources created for the |
229 // shortcut, and is also used as the UserDataDir for platform app shortcuts. | 229 // shortcut, and is also used as the UserDataDir for platform app shortcuts. |
230 // |shortcut_info| contains info about the shortcut to create, and | 230 // |shortcut_info| contains info about the shortcut to create, and |
231 // |creation_locations| contains information about where to create them. | 231 // |creation_locations| contains information about where to create them. |
232 bool CreatePlatformShortcuts( | 232 bool CreatePlatformShortcuts(const base::FilePath& shortcut_data_path, |
233 const base::FilePath& shortcut_data_path, | 233 ShortcutInfo* shortcut_info, |
234 std::unique_ptr<ShortcutInfo> shortcut_info, | 234 const ShortcutLocations& creation_locations, |
235 const ShortcutLocations& creation_locations, | 235 ShortcutCreationReason creation_reason); |
236 ShortcutCreationReason creation_reason); | |
237 | 236 |
238 // Delete all the shortcuts we have added for this extension. This is the | 237 // Delete all the shortcuts we have added for this extension. This is the |
239 // platform specific implementation of the DeleteAllShortcuts function, and | 238 // platform specific implementation of the DeleteAllShortcuts function, and |
240 // is executed on the FILE thread. | 239 // is executed on the FILE thread. |
241 void DeletePlatformShortcuts(const base::FilePath& shortcut_data_path, | 240 void DeletePlatformShortcuts(const base::FilePath& shortcut_data_path, |
242 std::unique_ptr<ShortcutInfo> shortcut_info); | 241 ShortcutInfo* shortcut_info); |
243 | 242 |
244 // Updates all the shortcuts we have added for this extension. This is the | 243 // Updates all the shortcuts we have added for this extension. This is the |
245 // platform specific implementation of the UpdateAllShortcuts function, and | 244 // platform specific implementation of the UpdateAllShortcuts function, and |
246 // is executed on the FILE thread. | 245 // is executed on the FILE thread. |
247 void UpdatePlatformShortcuts(const base::FilePath& shortcut_data_path, | 246 void UpdatePlatformShortcuts(const base::FilePath& shortcut_data_path, |
248 const base::string16& old_app_title, | 247 const base::string16& old_app_title, |
249 std::unique_ptr<ShortcutInfo> shortcut_info); | 248 ShortcutInfo* shortcut_info); |
250 | 249 |
251 // Delete all the shortcuts for an entire profile. | 250 // Delete all the shortcuts for an entire profile. |
252 // This is executed on the FILE thread. | 251 // This is executed on the FILE thread. |
253 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path); | 252 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path); |
254 | 253 |
255 // Sanitizes |name| and returns a version of it that is safe to use as an | 254 // Sanitizes |name| and returns a version of it that is safe to use as an |
256 // on-disk file name . | 255 // on-disk file name . |
257 base::FilePath GetSanitizedFileName(const base::string16& name); | 256 base::FilePath GetSanitizedFileName(const base::string16& name); |
258 | 257 |
| 258 // Clears |shortcut_info| and invokes |callback| unless it's null. |
| 259 void DeleteShortcutInfoOnUIThread(std::unique_ptr<ShortcutInfo> shortcut_info, |
| 260 const base::Closure& callback); |
| 261 |
259 } // namespace internals | 262 } // namespace internals |
260 | 263 |
261 } // namespace web_app | 264 } // namespace web_app |
262 | 265 |
263 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 266 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |