OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_APPS_SHORTCUT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_APPS_SHORTCUT_MANAGER_H_ |
6 #define CHROME_BROWSER_APPS_SHORTCUT_MANAGER_H_ | 6 #define CHROME_BROWSER_APPS_SHORTCUT_MANAGER_H_ |
7 | 7 |
8 #include "chrome/browser/profiles/profile_info_cache_observer.h" | 8 #include "chrome/browser/profiles/profile_info_cache_observer.h" |
9 #include "components/keyed_service/core/keyed_service.h" | 9 #include "components/keyed_service/core/keyed_service.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 11 matching lines...) Expand all Loading... | |
22 class AppShortcutManager : public KeyedService, | 22 class AppShortcutManager : public KeyedService, |
23 public content::NotificationObserver, | 23 public content::NotificationObserver, |
24 public ProfileInfoCacheObserver { | 24 public ProfileInfoCacheObserver { |
25 public: | 25 public: |
26 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 26 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
27 | 27 |
28 explicit AppShortcutManager(Profile* profile); | 28 explicit AppShortcutManager(Profile* profile); |
29 | 29 |
30 virtual ~AppShortcutManager(); | 30 virtual ~AppShortcutManager(); |
31 | 31 |
32 // Checks if kShortcutsEnabled is set in prefs. If not, this sets it and | 32 // Updates all shortcuts if if kAppShortcutsVersion in prefs is less than |
Matt Giuca
2014/05/23 07:01:57
if if
jackhou1
2014/05/26 07:57:37
Done.
| |
33 // creates shortcuts for all apps. | 33 // kCurrentAppShortcutsVersion. |
34 void OnceOffCreateShortcuts(); | 34 void UpdateShortcutsForAllAppsIfNeeded(); |
35 | 35 |
36 // content::NotificationObserver | 36 // content::NotificationObserver |
37 virtual void Observe(int type, | 37 virtual void Observe(int type, |
38 const content::NotificationSource& source, | 38 const content::NotificationSource& source, |
39 const content::NotificationDetails& details) OVERRIDE; | 39 const content::NotificationDetails& details) OVERRIDE; |
40 | 40 |
41 // ProfileInfoCacheObserver | 41 // ProfileInfoCacheObserver |
42 virtual void OnProfileWillBeRemoved( | 42 virtual void OnProfileWillBeRemoved( |
43 const base::FilePath& profile_path) OVERRIDE; | 43 const base::FilePath& profile_path) OVERRIDE; |
44 | 44 |
45 private: | 45 private: |
46 void DeleteApplicationShortcuts(const extensions::Extension* extension); | 46 void DeleteApplicationShortcuts(const extensions::Extension* extension); |
47 | 47 |
48 content::NotificationRegistrar registrar_; | 48 content::NotificationRegistrar registrar_; |
49 Profile* profile_; | 49 Profile* profile_; |
50 bool is_profile_info_cache_observer_; | 50 bool is_profile_info_cache_observer_; |
51 PrefService* prefs_; | 51 PrefService* prefs_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(AppShortcutManager); | 53 DISALLOW_COPY_AND_ASSIGN(AppShortcutManager); |
54 }; | 54 }; |
55 | 55 |
56 #endif // CHROME_BROWSER_APPS_SHORTCUT_MANAGER_H_ | 56 #endif // CHROME_BROWSER_APPS_SHORTCUT_MANAGER_H_ |
OLD | NEW |