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 EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ | 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ |
6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ | 6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // Invokes the observer method OnExtensionLoaded(). The extension must be | 68 // Invokes the observer method OnExtensionLoaded(). The extension must be |
69 // enabled at the time of the call. | 69 // enabled at the time of the call. |
70 void TriggerOnLoaded(const Extension* extension); | 70 void TriggerOnLoaded(const Extension* extension); |
71 | 71 |
72 // Invokes the observer method OnExtensionUnloaded(). The extension must not | 72 // Invokes the observer method OnExtensionUnloaded(). The extension must not |
73 // be enabled at the time of the call. | 73 // be enabled at the time of the call. |
74 void TriggerOnUnloaded(const Extension* extension, | 74 void TriggerOnUnloaded(const Extension* extension, |
75 UnloadedExtensionInfo::Reason reason); | 75 UnloadedExtensionInfo::Reason reason); |
76 | 76 |
| 77 // If this is a fresh install then |is_update| is false and there must not be |
| 78 // any installed extension with |extension|'s ID. If this is an update then |
| 79 // |is_update| is true and must be an installed extension with |extension|'s |
| 80 // ID, and |old_name| must be non-empty. |
| 81 void TriggerOnWillBeInstalled(const Extension* extension, |
| 82 bool is_update, |
| 83 const std::string& old_name); |
| 84 |
77 // Find an extension by ID using |include_mask| to pick the sets to search: | 85 // Find an extension by ID using |include_mask| to pick the sets to search: |
78 // * enabled_extensions() --> ExtensionRegistry::ENABLED | 86 // * enabled_extensions() --> ExtensionRegistry::ENABLED |
79 // * disabled_extensions() --> ExtensionRegistry::DISABLED | 87 // * disabled_extensions() --> ExtensionRegistry::DISABLED |
80 // * terminated_extensions() --> ExtensionRegistry::TERMINATED | 88 // * terminated_extensions() --> ExtensionRegistry::TERMINATED |
81 // * blacklisted_extensions() --> ExtensionRegistry::BLACKLISTED | 89 // * blacklisted_extensions() --> ExtensionRegistry::BLACKLISTED |
82 // Returns NULL if the extension is not found in the selected sets. | 90 // Returns NULL if the extension is not found in the selected sets. |
83 const Extension* GetExtensionById(const std::string& id, | 91 const Extension* GetExtensionById(const std::string& id, |
84 int include_mask) const; | 92 int include_mask) const; |
85 | 93 |
86 // Adds the specified extension to the enabled set. The registry becomes an | 94 // Adds the specified extension to the enabled set. The registry becomes an |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 ObserverList<ExtensionRegistryObserver> observers_; | 147 ObserverList<ExtensionRegistryObserver> observers_; |
140 | 148 |
141 content::BrowserContext* const browser_context_; | 149 content::BrowserContext* const browser_context_; |
142 | 150 |
143 DISALLOW_COPY_AND_ASSIGN(ExtensionRegistry); | 151 DISALLOW_COPY_AND_ASSIGN(ExtensionRegistry); |
144 }; | 152 }; |
145 | 153 |
146 } // namespace extensions | 154 } // namespace extensions |
147 | 155 |
148 #endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ | 156 #endif // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_H_ |
OLD | NEW |