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

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: Address comments 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
« no previous file with comments | « chrome/browser/web_applications/web_app_linux.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/browser/web_applications/web_app_linux.cc ('k') | chrome/browser/web_applications/web_app_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698