1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef APPS_SHORTCUT_MANAGER_H_
6 #define APPS_SHORTCUT_MANAGER_H_
8 #include "base/memory/weak_ptr.h"
9 #include "chrome/common/extensions/extension.h"
10 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
11 #include "content/public/browser/notification_observer.h"
12 #include "content/public/browser/notification_registrar.h"
18 // This class manages the installation of shortcuts for platform apps.
19 class ShortcutManager
: public BrowserContextKeyedService
,
20 public content::NotificationObserver
{
22 explicit ShortcutManager(Profile
* profile
);
24 virtual ~ShortcutManager();
26 // content::NotificationObserver
27 virtual void Observe(int type
,
28 const content::NotificationSource
& source
,
29 const content::NotificationDetails
& details
) OVERRIDE
;
32 void DeleteApplicationShortcuts(const extensions::Extension
* extension
);
34 content::NotificationRegistrar registrar_
;
37 // Fields used when installing application shortcuts.
38 base::WeakPtrFactory
<ShortcutManager
> weak_factory_
;
40 DISALLOW_COPY_AND_ASSIGN(ShortcutManager
);
45 #endif // APPS_SHORTCUT_MANAGER_H_