OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_ |
7 | 7 |
8 #include "extensions/common/extension.h" | 8 #include "extensions/common/extension.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 // Called after an extension is unloaded. The extension no longer exists in | 31 // Called after an extension is unloaded. The extension no longer exists in |
32 // any of the ExtensionRegistry sets (enabled, disabled, etc.). | 32 // any of the ExtensionRegistry sets (enabled, disabled, etc.). |
33 virtual void OnExtensionUnloaded(content::BrowserContext* browser_context, | 33 virtual void OnExtensionUnloaded(content::BrowserContext* browser_context, |
34 const Extension* extension, | 34 const Extension* extension, |
35 UnloadedExtensionInfo::Reason reason) {} | 35 UnloadedExtensionInfo::Reason reason) {} |
36 | 36 |
37 // Called when |extension| is about to be installed. |is_update| is true if | 37 // Called when |extension| is about to be installed. |is_update| is true if |
38 // the installation is the result of it updating, in which case |old_name| is | 38 // the installation is the result of it updating, in which case |old_name| is |
39 // the name of the extension's previous version. | 39 // the name of the extension's previous version. |
40 // If true, |from_ephemeral| indicates that the extension was previously | |
41 // installed ephemerally and has been promoted to a regular installed | |
42 // extension. |is_update| will be true, although the version has not | |
43 // necessarily changed. | |
40 // The ExtensionRegistry will not be tracking |extension| at the time this | 44 // The ExtensionRegistry will not be tracking |extension| at the time this |
41 // event is fired, but will be immediately afterwards (note: not necessarily | 45 // event is fired, but will be immediately afterwards (note: not necessarily |
42 // enabled; it might be installed in the disabled or even blacklisted sets, | 46 // enabled; it might be installed in the disabled or even blacklisted sets, |
43 // for example). | 47 // for example). |
44 // Note that it's much more common to care about extensions being loaded | 48 // Note that it's much more common to care about extensions being loaded |
45 // (OnExtensionLoaded). | 49 // (OnExtensionLoaded). |
50 // | |
51 // TODO(tmdiep): We should stash the state of the previous extension version | |
52 // somewhere and have observers retrieve it. |is_update|, |from_ephemeral| | |
53 // and |old_name| will be removed in a future patch. | |
benwells
2014/05/27 22:18:28
Nit: rephrase slightly to not say 'in a future pat
| |
46 virtual void OnExtensionWillBeInstalled( | 54 virtual void OnExtensionWillBeInstalled( |
47 content::BrowserContext* browser_context, | 55 content::BrowserContext* browser_context, |
48 const Extension* extension, | 56 const Extension* extension, |
49 bool is_update, | 57 bool is_update, |
58 bool from_ephemeral, | |
50 const std::string& old_name) {} | 59 const std::string& old_name) {} |
51 | 60 |
52 // Called after an extension is uninstalled. The extension no longer exsit in | 61 // Called after an extension is uninstalled. The extension no longer exsit in |
53 // any of the ExtensionRegistry sets (enabled, disabled, etc.). | 62 // any of the ExtensionRegistry sets (enabled, disabled, etc.). |
54 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, | 63 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, |
55 const Extension* extension) {} | 64 const Extension* extension) {} |
56 }; | 65 }; |
57 | 66 |
58 } // namespace extensions | 67 } // namespace extensions |
59 | 68 |
60 #endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_ | 69 #endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_ |
OLD | NEW |