summaryrefslogtreecommitdiffstats
path: root/apps/shortcut_manager.h
diff options
context:
space:
mode:
authorjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 15:34:35 +0000
committerjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 15:34:35 +0000
commit819cd785f5beae52868aa6162457bba624ef6183 (patch)
tree301080d235b9879b71f2d7ac7d9311e816f9f5a5 /apps/shortcut_manager.h
parent36d7746e139a6ff96d33ac98a4258dc3d5652bd7 (diff)
downloadchromium_src-819cd785f5beae52868aa6162457bba624ef6183.zip
chromium_src-819cd785f5beae52868aa6162457bba624ef6183.tar.gz
chromium_src-819cd785f5beae52868aa6162457bba624ef6183.tar.bz2
When app shortcuts are enabled, do a once-off creation of all shortcuts.
This adds a boolean (kAppShortcutsEnabled) to user prefs. At startup, ShortcutManager checks the pref and sets the current value. On a transition from false to true, ShortcutManager iterates over all apps and creates shortcuts as if the app is being installed. BUG=249189 TEST=Delete app shortcuts from the OS applications folder. Start Chrome, the shortcuts should be created. Delete the shortcuts again. Restart Chrome, the shortcuts are not created a second time. Review URL: https://chromiumcodereview.appspot.com/17261016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/shortcut_manager.h')
-rw-r--r--apps/shortcut_manager.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/shortcut_manager.h b/apps/shortcut_manager.h
index a0efb82..b654053 100644
--- a/apps/shortcut_manager.h
+++ b/apps/shortcut_manager.h
@@ -11,6 +11,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+class PrefService;
class Profile;
namespace apps {
@@ -29,10 +30,15 @@ class ShortcutManager : public BrowserContextKeyedService,
const content::NotificationDetails& details) 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_;
Profile* profile_;
+ PrefService* prefs_;
// Fields used when installing application shortcuts.
base::WeakPtrFactory<ShortcutManager> weak_factory_;