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 3a7b237f1f4e34fa21c738e9af121cd5470ece5f..9199441a640622964c01bc8349fee285ddb7e67e 100644 |
--- a/chrome/browser/web_applications/web_app_mac.mm |
+++ b/chrome/browser/web_applications/web_app_mac.mm |
@@ -24,7 +24,9 @@ |
#include "base/strings/sys_string_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#import "chrome/browser/mac/dock.h" |
+#include "chrome/browser/browser_process.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/shell_integration.h" |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/chrome_paths.h" |
@@ -32,6 +34,7 @@ |
#include "chrome/common/chrome_version_info.h" |
#import "chrome/common/mac/app_mode_common.h" |
#include "content/public/browser/browser_thread.h" |
+#include "extensions/browser/extension_registry.h" |
#include "extensions/common/extension.h" |
#include "grit/chrome_unscaled_resources.h" |
#include "grit/chromium_strings.h" |
@@ -915,6 +918,27 @@ void CreateAppShortcutInfoLoaded( |
close_callback.Run(dialog_accepted); |
} |
+void UpdateShortcutsForAllApps(Profile* profile, |
+ const base::Closure& callback) { |
+ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
+ |
+ extensions::ExtensionRegistry* registry = |
+ extensions::ExtensionRegistry::Get(profile); |
+ if (!registry) |
+ return; |
+ |
+ // Update all apps. |
+ scoped_ptr<extensions::ExtensionSet> everything = |
+ registry->GenerateInstalledExtensionsSet(); |
+ for (extensions::ExtensionSet::const_iterator it = everything->begin(); |
+ it != everything->end(); ++it) { |
+ if (web_app::ShouldCreateShortcutFor(profile, it->get())) |
+ web_app::UpdateAllShortcuts(base::string16(), profile, it->get()); |
+ } |
+ |
+ callback.Run(); |
+} |
+ |
namespace internals { |
bool CreatePlatformShortcuts( |