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