| 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_RUNTIME_DATA_H_ | 5 #ifndef EXTENSIONS_BROWSER_RUNTIME_DATA_H_ |
| 6 #define EXTENSIONS_BROWSER_RUNTIME_DATA_H_ | 6 #define EXTENSIONS_BROWSER_RUNTIME_DATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Returns true if the extension is being tracked. Used only for testing. | 44 // Returns true if the extension is being tracked. Used only for testing. |
| 45 bool HasExtensionForTesting(const std::string& extension_id) const; | 45 bool HasExtensionForTesting(const std::string& extension_id) const; |
| 46 | 46 |
| 47 // Erase runtime data for all extensions. Used only for testing. Cannot be | 47 // Erase runtime data for all extensions. Used only for testing. Cannot be |
| 48 // named ClearAllForTesting due to false-positive presubmit errors. | 48 // named ClearAllForTesting due to false-positive presubmit errors. |
| 49 void ClearAll(); | 49 void ClearAll(); |
| 50 | 50 |
| 51 // ExtensionRegistryObserver overrides. Public for testing. | 51 // ExtensionRegistryObserver overrides. Public for testing. |
| 52 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 52 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 53 const Extension* extension, | 53 const Extension* extension, |
| 54 UnloadedExtensionInfo::Reason reason) override; | 54 UnloadedExtensionReason reason) override; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // Bitmasks for runtime states. | 57 // Bitmasks for runtime states. |
| 58 enum RuntimeFlag { | 58 enum RuntimeFlag { |
| 59 // Set if the background page is ready. | 59 // Set if the background page is ready. |
| 60 BACKGROUND_PAGE_READY = 1 << 0, | 60 BACKGROUND_PAGE_READY = 1 << 0, |
| 61 // Set while the extension is being upgraded. | 61 // Set while the extension is being upgraded. |
| 62 BEING_UPGRADED = 1 << 1, | 62 BEING_UPGRADED = 1 << 1, |
| 63 }; | 63 }; |
| 64 | 64 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 76 // Map from extension ID to the RuntimeFlags bits. | 76 // Map from extension ID to the RuntimeFlags bits. |
| 77 typedef std::map<std::string, int> ExtensionFlagsMap; | 77 typedef std::map<std::string, int> ExtensionFlagsMap; |
| 78 ExtensionFlagsMap extension_flags_; | 78 ExtensionFlagsMap extension_flags_; |
| 79 | 79 |
| 80 ExtensionRegistry* registry_; // Not owned. | 80 ExtensionRegistry* registry_; // Not owned. |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace extensions | 83 } // namespace extensions |
| 84 | 84 |
| 85 #endif // EXTENSIONS_BROWSER_RUNTIME_DATA_H_ | 85 #endif // EXTENSIONS_BROWSER_RUNTIME_DATA_H_ |
| OLD | NEW |