| 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_EXTENSIONS_INSTALL_TRACKER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "base/prefs/pref_change_registrar.h" | 9 #include "base/prefs/pref_change_registrar.h" |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void OnBeginCrxInstall(const std::string& extension_id); | 46 void OnBeginCrxInstall(const std::string& extension_id); |
| 47 void OnFinishCrxInstall(const std::string& extension_id, bool success); | 47 void OnFinishCrxInstall(const std::string& extension_id, bool success); |
| 48 void OnInstallFailure(const std::string& extension_id); | 48 void OnInstallFailure(const std::string& extension_id); |
| 49 | 49 |
| 50 // Overriddes for KeyedService. | 50 // Overriddes for KeyedService. |
| 51 virtual void Shutdown() OVERRIDE; | 51 virtual void Shutdown() OVERRIDE; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 void OnAppsReordered(); | 54 void OnAppsReordered(); |
| 55 | 55 |
| 56 // content::NotificationObserver. | 56 // content::NotificationObserver implementation. |
| 57 virtual void Observe(int type, | 57 virtual void Observe(int type, |
| 58 const content::NotificationSource& source, | 58 const content::NotificationSource& source, |
| 59 const content::NotificationDetails& details) OVERRIDE; | 59 const content::NotificationDetails& details) OVERRIDE; |
| 60 | 60 |
| 61 // ExtensionRegistryObserver implementation. | 61 // ExtensionRegistryObserver implementation. |
| 62 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 62 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 63 const Extension* extension) OVERRIDE; | 63 const Extension* extension) OVERRIDE; |
| 64 virtual void OnExtensionUnloaded( | 64 virtual void OnExtensionUnloaded( |
| 65 content::BrowserContext* browser_context, | 65 content::BrowserContext* browser_context, |
| 66 const Extension* extension, | 66 const Extension* extension, |
| 67 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 67 UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| 68 virtual void OnExtensionWillBeInstalled( |
| 69 content::BrowserContext* browser_context, |
| 70 const Extension* extension, |
| 71 bool is_update, |
| 72 const std::string& old_name) OVERRIDE; |
| 68 | 73 |
| 69 ObserverList<InstallObserver> observers_; | 74 ObserverList<InstallObserver> observers_; |
| 70 content::NotificationRegistrar registrar_; | 75 content::NotificationRegistrar registrar_; |
| 71 PrefChangeRegistrar pref_change_registrar_; | 76 PrefChangeRegistrar pref_change_registrar_; |
| 72 | 77 |
| 73 // Listen to extension load, unloaded notifications. | |
| 74 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 78 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 75 extension_registry_observer_; | 79 extension_registry_observer_; |
| 76 | 80 |
| 77 DISALLOW_COPY_AND_ASSIGN(InstallTracker); | 81 DISALLOW_COPY_AND_ASSIGN(InstallTracker); |
| 78 }; | 82 }; |
| 79 | 83 |
| 80 } // namespace extensions | 84 } // namespace extensions |
| 81 | 85 |
| 82 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ | 86 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_H_ |
| OLD | NEW |