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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 263403002: Replace OnceOffCreateShortcuts with UpdateShortcutsForAllAppsIfNeeded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove once-off creation logic. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 563b33f76c3e506877c147d9b9cb4ca15cc43c53..7a161f9e344b87ce55db02c22e63740918fded89 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -958,6 +958,29 @@ void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) {
}
}
+void UpdateShortcutsForAllAppsForProfile(const base::FilePath& profile_path,
+ const std::set<std::string>& app_ids) {
+ DCHECK_CURRENTLY_ON(BrowserThread::FILE);
+ web_app::ShortcutLocations creation_locations;
+ // Create the shortcut in the Chrome Apps subdir.
+ creation_locations.applications_menu_location =
+ web_app::APP_MENU_LOCATION_SUBDIR_CHROMEAPPS;
+
+ for (std::set<std::string>::const_iterator it = app_ids.begin();
+ it != app_ids.end();
+ ++it) {
+ BrowserThread::PostTask(
+ BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&web_app::internals::CallForProfileAndAppId,
+ profile_path,
+ *it,
+ base::Bind(&web_app::CreateShortcuts,
+ web_app::SHORTCUT_CREATION_AUTOMATED,
+ creation_locations)));
+ }
+}
+
} // namespace internals
} // namespace web_app

Powered by Google App Engine
This is Rietveld 408576698