diff options
author | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-06 04:55:49 +0000 |
---|---|---|
committer | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-06 04:55:49 +0000 |
commit | 52c7097f92b8448985872eaf7d52c480bb62a1bf (patch) | |
tree | 88da206d4638db8d0ce51d55490ab0dbaab91629 | |
parent | b14bd53b56ed2de26144a98e6f12616ca1e035d7 (diff) | |
download | chromium_src-52c7097f92b8448985872eaf7d52c480bb62a1bf.zip chromium_src-52c7097f92b8448985872eaf7d52c480bb62a1bf.tar.gz chromium_src-52c7097f92b8448985872eaf7d52c480bb62a1bf.tar.bz2 |
Merge 232553 "Create shortcuts when app launcher is enabled."
Second attempt. The first time missed one of the files for some reason:
https://codereview.chromium.org/60363004
> Create shortcuts when app launcher is enabled.
>
> This change mostly affects Mac. At the moment, if app shims are not
> enabled, syncing of v2 apps does not create shims for those apps.
> If app shims are then enabled by enabling the app launcher, these shims
> will not be created until the next restart of Chrome. This CL runs a
> OnceOffCreateShortcuts (the same method run on startup) when the app
> launcher is enabled.
>
> BUG=313106
> TEST=Start with a fresh install of Chrome.
> Sign in with an account that has v2 apps.
> Wait for the apps to sync.
> Enable the app launcher.
> App shims should be installed for synced apps.
> Launch an app, it should have an icon in the dock.
>
> Review URL: https://codereview.chromium.org/54383005
TBR=jackhou@chromium.org
Review URL: https://codereview.chromium.org/59113009
git-svn-id: svn://svn.chromium.org/chrome/branches/1650/src@233206 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/apps/shortcut_manager.h | 8 | ||||
-rw-r--r-- | chrome/browser/ui/app_list/app_list_service_impl.cc | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/apps/shortcut_manager.h b/chrome/browser/apps/shortcut_manager.h index 2b3d383..a820b21 100644 --- a/chrome/browser/apps/shortcut_manager.h +++ b/chrome/browser/apps/shortcut_manager.h @@ -24,6 +24,10 @@ class AppShortcutManager : public BrowserContextKeyedService, virtual ~AppShortcutManager(); + // Checks if kShortcutsEnabled is set in prefs. If not, this sets it and + // creates shortcuts for all apps. + void OnceOffCreateShortcuts(); + // content::NotificationObserver virtual void Observe(int type, const content::NotificationSource& source, @@ -34,10 +38,6 @@ class AppShortcutManager : public BrowserContextKeyedService, const base::FilePath& profile_path) OVERRIDE; private: - // Checks if kShortcutsEnabled is set in prefs. If not, this sets it and - // creates shortcuts for all apps. - void OnceOffCreateShortcuts(); - void DeleteApplicationShortcuts(const extensions::Extension* extension); content::NotificationRegistrar registrar_; diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc index 8fcd398..b157626 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl.cc +++ b/chrome/browser/ui/app_list/app_list_service_impl.cc @@ -9,6 +9,8 @@ #include "base/metrics/histogram.h" #include "base/prefs/pref_service.h" #include "base/time/time.h" +#include "chrome/browser/apps/shortcut_manager.h" +#include "chrome/browser/apps/shortcut_manager_factory.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/chrome_constants.h" @@ -183,6 +185,8 @@ void AppListServiceImpl::EnableAppList(Profile* initial_profile) { SetAppListEnabledPreference(true); CreateShortcut(); + AppShortcutManagerFactory::GetForProfile(initial_profile)-> + OnceOffCreateShortcuts(); } Profile* AppListServiceImpl::GetCurrentAppListProfile() { |