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 | |
62 // Creates a shortcut. Must be called on the file thread. This is used to | 57 // Creates a shortcut. Must be called on the file thread. This is used to |
63 // implement CreateShortcut() above, and can also be used directly from the | 58 // implement CreateShortcut() above, and can also be used directly from the |
64 // file thread. |profile_path| is the path of the creating profile. | 59 // file thread. |profile_path| is the path of the creating profile. |
65 // |shortcut_info| constains info about the shortcut to create. | 60 // |shortcut_info| constains info about the shortcut to create. |
66 bool CreateShortcutOnFileThread( | 61 bool CreateShortcutOnFileThread( |
67 const FilePath& profile_path, | 62 const FilePath& profile_path, |
68 const ShellIntegration::ShortcutInfo& shortcut_info); | 63 const ShellIntegration::ShortcutInfo& shortcut_info); |
69 | 64 |
70 // Returns true if given url is a valid web app url. | 65 // Returns true if given url is a valid web app url. |
71 bool IsValidUrl(const GURL& url); | 66 bool IsValidUrl(const GURL& url); |
(...skipping 23 matching lines...) Expand all Loading... |
95 // shortcuts. Used internally by CreateShortcutOnFileThread. | 90 // shortcuts. Used internally by CreateShortcutOnFileThread. |
96 // |shortcut_data_path| is where to store any resources created for the | 91 // |shortcut_data_path| is where to store any resources created for the |
97 // shortcut, and is also used as the UserDataDir for platform app shortcuts. | 92 // shortcut, and is also used as the UserDataDir for platform app shortcuts. |
98 // |profile_path| is the path of the creating profile. |shortcut_info| | 93 // |profile_path| is the path of the creating profile. |shortcut_info| |
99 // contains info about the shortcut to create. | 94 // contains info about the shortcut to create. |
100 bool CreatePlatformShortcut( | 95 bool CreatePlatformShortcut( |
101 const FilePath& shortcut_data_path, | 96 const FilePath& shortcut_data_path, |
102 const FilePath& profile_path, | 97 const FilePath& profile_path, |
103 const ShellIntegration::ShortcutInfo& shortcut_info); | 98 const ShellIntegration::ShortcutInfo& shortcut_info); |
104 | 99 |
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 | |
111 // Sanitizes |name| and returns a version of it that is safe to use as an | 100 // Sanitizes |name| and returns a version of it that is safe to use as an |
112 // on-disk file name . | 101 // on-disk file name . |
113 FilePath GetSanitizedFileName(const string16& name); | 102 FilePath GetSanitizedFileName(const string16& name); |
114 | 103 |
115 } // namespace internals | 104 } // namespace internals |
116 | 105 |
117 } // namespace web_app | 106 } // namespace web_app |
118 | 107 |
119 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 108 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |