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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // extension. | 165 // extension. |
166 void DeleteAllShortcuts(Profile* profile, const extensions::Extension* app); | 166 void DeleteAllShortcuts(Profile* profile, const extensions::Extension* app); |
167 | 167 |
168 // Updates shortcuts for web application based on given shortcut data. This | 168 // Updates shortcuts for web application based on given shortcut data. This |
169 // refreshes existing shortcuts and their icons, but does not create new ones. | 169 // refreshes existing shortcuts and their icons, but does not create new ones. |
170 // |old_app_title| contains the title of the app prior to this update. | 170 // |old_app_title| contains the title of the app prior to this update. |
171 void UpdateAllShortcuts(const base::string16& old_app_title, | 171 void UpdateAllShortcuts(const base::string16& old_app_title, |
172 Profile* profile, | 172 Profile* profile, |
173 const extensions::Extension* app); | 173 const extensions::Extension* app); |
174 | 174 |
| 175 // Updates shortcuts for all apps in this profile. |
| 176 void UpdateShortcutsForAllApps(Profile* profile); |
| 177 |
175 // Returns true if given url is a valid web app url. | 178 // Returns true if given url is a valid web app url. |
176 bool IsValidUrl(const GURL& url); | 179 bool IsValidUrl(const GURL& url); |
177 | 180 |
178 #if defined(TOOLKIT_VIEWS) | 181 #if defined(TOOLKIT_VIEWS) |
179 // Extracts icons info from web app data. Take only square shaped icons and | 182 // Extracts icons info from web app data. Take only square shaped icons and |
180 // sort them from smallest to largest. | 183 // sort them from smallest to largest. |
181 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; | 184 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; |
182 void GetIconsInfo(const WebApplicationInfo& app_info, IconInfoList* icons); | 185 void GetIconsInfo(const WebApplicationInfo& app_info, IconInfoList* icons); |
183 #endif | 186 #endif |
184 | 187 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 void UpdatePlatformShortcuts( | 234 void UpdatePlatformShortcuts( |
232 const base::FilePath& shortcut_data_path, | 235 const base::FilePath& shortcut_data_path, |
233 const base::string16& old_app_title, | 236 const base::string16& old_app_title, |
234 const ShortcutInfo& shortcut_info, | 237 const ShortcutInfo& shortcut_info, |
235 const extensions::FileHandlersInfo& file_handlers_info); | 238 const extensions::FileHandlersInfo& file_handlers_info); |
236 | 239 |
237 // Delete all the shortcuts for an entire profile. | 240 // Delete all the shortcuts for an entire profile. |
238 // This is executed on the FILE thread. | 241 // This is executed on the FILE thread. |
239 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path); | 242 void DeleteAllShortcutsForProfile(const base::FilePath& profile_path); |
240 | 243 |
| 244 // Checks all shortcuts for a profile and deletes/updates them as necessary. |
| 245 void UpdateShortcutsForAllAppsForProfile(const base::FilePath& profile_path, |
| 246 const std::set<std::string>& app_ids); |
| 247 |
241 // Sanitizes |name| and returns a version of it that is safe to use as an | 248 // Sanitizes |name| and returns a version of it that is safe to use as an |
242 // on-disk file name . | 249 // on-disk file name . |
243 base::FilePath GetSanitizedFileName(const base::string16& name); | 250 base::FilePath GetSanitizedFileName(const base::string16& name); |
244 | 251 |
245 } // namespace internals | 252 } // namespace internals |
246 | 253 |
247 } // namespace web_app | 254 } // namespace web_app |
248 | 255 |
249 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ | 256 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ |
OLD | NEW |