Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: chrome/browser/web_applications/web_app.h

Issue 263403002: Replace OnceOffCreateShortcuts with UpdateShortcutsForAllAppsIfNeeded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 ShortcutInfo ShortcutInfoForExtensionAndProfile( 115 ShortcutInfo ShortcutInfoForExtensionAndProfile(
116 const extensions::Extension* app, 116 const extensions::Extension* app,
117 Profile* profile); 117 Profile* profile);
118 118
119 // Fetches the icon for |extension| and calls |callback| with shortcut info 119 // Fetches the icon for |extension| and calls |callback| with shortcut info
120 // filled out as by UpdateShortcutInfoForApp. 120 // filled out as by UpdateShortcutInfoForApp.
121 void UpdateShortcutInfoAndIconForApp(const extensions::Extension* extension, 121 void UpdateShortcutInfoAndIconForApp(const extensions::Extension* extension,
122 Profile* profile, 122 Profile* profile,
123 const ShortcutInfoCallback& callback); 123 const ShortcutInfoCallback& callback);
124 124
125 // Whether to create a shortcut for this type of extension.
126 bool ShouldCreateShortcutFor(Profile* profile,
127 const extensions::Extension* extension);
128
125 // Gets the user data directory for given web app. The path for the directory is 129 // Gets the user data directory for given web app. The path for the directory is
126 // based on |extension_id|. If |extension_id| is empty then |url| is used 130 // based on |extension_id|. If |extension_id| is empty then |url| is used
127 // to construct a unique ID. 131 // to construct a unique ID.
128 base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path, 132 base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path,
129 const std::string& extension_id, 133 const std::string& extension_id,
130 const GURL& url); 134 const GURL& url);
131 135
132 // Gets the user data directory to use for |extension| located inside 136 // Gets the user data directory to use for |extension| located inside
133 // |profile_path|. 137 // |profile_path|.
134 base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path, 138 base::FilePath GetWebAppDataDirectory(const base::FilePath& profile_path,
(...skipping 30 matching lines...) Expand all
165 // extension. 169 // extension.
166 void DeleteAllShortcuts(Profile* profile, const extensions::Extension* app); 170 void DeleteAllShortcuts(Profile* profile, const extensions::Extension* app);
167 171
168 // Updates shortcuts for web application based on given shortcut data. This 172 // Updates shortcuts for web application based on given shortcut data. This
169 // refreshes existing shortcuts and their icons, but does not create new ones. 173 // 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. 174 // |old_app_title| contains the title of the app prior to this update.
171 void UpdateAllShortcuts(const base::string16& old_app_title, 175 void UpdateAllShortcuts(const base::string16& old_app_title,
172 Profile* profile, 176 Profile* profile,
173 const extensions::Extension* app); 177 const extensions::Extension* app);
174 178
179 // Updates shortcuts for all apps in this profile. This is expected to be called
180 // on the UI thread.
181 void UpdateShortcutsForAllApps(Profile* profile,
182 const base::Closure& callback);
183
175 // Returns true if given url is a valid web app url. 184 // Returns true if given url is a valid web app url.
176 bool IsValidUrl(const GURL& url); 185 bool IsValidUrl(const GURL& url);
177 186
178 #if defined(TOOLKIT_VIEWS) 187 #if defined(TOOLKIT_VIEWS)
179 // Extracts icons info from web app data. Take only square shaped icons and 188 // Extracts icons info from web app data. Take only square shaped icons and
180 // sort them from smallest to largest. 189 // sort them from smallest to largest.
181 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList; 190 typedef std::vector<WebApplicationInfo::IconInfo> IconInfoList;
182 void GetIconsInfo(const WebApplicationInfo& app_info, IconInfoList* icons); 191 void GetIconsInfo(const WebApplicationInfo& app_info, IconInfoList* icons);
183 #endif 192 #endif
184 193
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 249
241 // Sanitizes |name| and returns a version of it that is safe to use as an 250 // Sanitizes |name| and returns a version of it that is safe to use as an
242 // on-disk file name . 251 // on-disk file name .
243 base::FilePath GetSanitizedFileName(const base::string16& name); 252 base::FilePath GetSanitizedFileName(const base::string16& name);
244 253
245 } // namespace internals 254 } // namespace internals
246 255
247 } // namespace web_app 256 } // namespace web_app
248 257
249 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ 258 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_service_impl.cc ('k') | chrome/browser/web_applications/web_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698