| 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_INFO_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_INFO_MAP_H_ |
| 6 #define EXTENSIONS_BROWSER_INFO_MAP_H_ | 6 #define EXTENSIONS_BROWSER_INFO_MAP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 public: | 30 public: |
| 31 InfoMap(); | 31 InfoMap(); |
| 32 | 32 |
| 33 const ExtensionSet& extensions() const; | 33 const ExtensionSet& extensions() const; |
| 34 const ExtensionSet& disabled_extensions() const; | 34 const ExtensionSet& disabled_extensions() const; |
| 35 | 35 |
| 36 // Information about which extensions are assigned to which render processes. | 36 // Information about which extensions are assigned to which render processes. |
| 37 const ProcessMap& process_map() const { return process_map_; } | 37 const ProcessMap& process_map() const { return process_map_; } |
| 38 | 38 |
| 39 // Callback for when new extensions are loaded. | 39 // Callback for when new extensions are loaded. |
| 40 void AddExtension(const extensions::Extension* extension, | 40 void AddExtension(const Extension* extension, |
| 41 base::Time install_time, | 41 base::Time install_time, |
| 42 bool incognito_enabled, | 42 bool incognito_enabled, |
| 43 bool notifications_disabled); | 43 bool notifications_disabled); |
| 44 | 44 |
| 45 // Callback for when an extension is unloaded. | 45 // Callback for when an extension is unloaded. |
| 46 void RemoveExtension(const std::string& extension_id, | 46 void RemoveExtension(const std::string& extension_id, |
| 47 const extensions::UnloadedExtensionInfo::Reason reason); | 47 const UnloadedExtensionReason reason); |
| 48 | 48 |
| 49 // Returns the time the extension was installed, or base::Time() if not found. | 49 // Returns the time the extension was installed, or base::Time() if not found. |
| 50 base::Time GetInstallTime(const std::string& extension_id) const; | 50 base::Time GetInstallTime(const std::string& extension_id) const; |
| 51 | 51 |
| 52 // Returns true if the user has allowed this extension to run in incognito | 52 // Returns true if the user has allowed this extension to run in incognito |
| 53 // mode. | 53 // mode. |
| 54 bool IsIncognitoEnabled(const std::string& extension_id) const; | 54 bool IsIncognitoEnabled(const std::string& extension_id) const; |
| 55 | 55 |
| 56 // Returns true if the given extension can see events and data from another | 56 // Returns true if the given extension can see events and data from another |
| 57 // sub-profile (incognito to original profile, or vice versa). | 57 // sub-profile (incognito to original profile, or vice versa). |
| 58 bool CanCrossIncognito(const extensions::Extension* extension) const; | 58 bool CanCrossIncognito(const Extension* extension) const; |
| 59 | 59 |
| 60 // Adds an entry to process_map_. | 60 // Adds an entry to process_map_. |
| 61 void RegisterExtensionProcess(const std::string& extension_id, | 61 void RegisterExtensionProcess(const std::string& extension_id, |
| 62 int process_id, | 62 int process_id, |
| 63 int site_instance_id); | 63 int site_instance_id); |
| 64 | 64 |
| 65 // Removes an entry from process_map_. | 65 // Removes an entry from process_map_. |
| 66 void UnregisterExtensionProcess(const std::string& extension_id, | 66 void UnregisterExtensionProcess(const std::string& extension_id, |
| 67 int process_id, | 67 int process_id, |
| 68 int site_instance_id); | 68 int site_instance_id); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // Extra data associated with enabled extensions. | 102 // Extra data associated with enabled extensions. |
| 103 ExtraDataMap extra_data_; | 103 ExtraDataMap extra_data_; |
| 104 | 104 |
| 105 // Used by dispatchers to limit API quota for individual extensions. | 105 // Used by dispatchers to limit API quota for individual extensions. |
| 106 // The QuotaService is not thread safe. We need to create and destroy it on | 106 // The QuotaService is not thread safe. We need to create and destroy it on |
| 107 // the IO thread. | 107 // the IO thread. |
| 108 std::unique_ptr<QuotaService> quota_service_; | 108 std::unique_ptr<QuotaService> quota_service_; |
| 109 | 109 |
| 110 // Assignment of extensions to renderer processes. | 110 // Assignment of extensions to renderer processes. |
| 111 extensions::ProcessMap process_map_; | 111 ProcessMap process_map_; |
| 112 | 112 |
| 113 scoped_refptr<ContentVerifier> content_verifier_; | 113 scoped_refptr<ContentVerifier> content_verifier_; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace extensions | 116 } // namespace extensions |
| 117 | 117 |
| 118 #endif // EXTENSIONS_BROWSER_INFO_MAP_H_ | 118 #endif // EXTENSIONS_BROWSER_INFO_MAP_H_ |
| OLD | NEW |