| 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 CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const content::FrameNavigateParams& params) override; | 123 const content::FrameNavigateParams& params) override; |
| 124 | 124 |
| 125 // ExtensionRegistryObserver: | 125 // ExtensionRegistryObserver: |
| 126 void OnExtensionUnloaded(content::BrowserContext* browser_context, | 126 void OnExtensionUnloaded(content::BrowserContext* browser_context, |
| 127 const Extension* extension, | 127 const Extension* extension, |
| 128 UnloadedExtensionInfo::Reason reason) override; | 128 UnloadedExtensionInfo::Reason reason) override; |
| 129 | 129 |
| 130 // The associated browser context. | 130 // The associated browser context. |
| 131 content::BrowserContext* browser_context_; | 131 content::BrowserContext* browser_context_; |
| 132 | 132 |
| 133 // Whether or not the ActiveScriptController is enabled (corresponding to the | |
| 134 // kActiveScriptEnforcement switch). If it is not, it acts as an empty shell, | |
| 135 // always allowing scripts to run and never displaying actions. | |
| 136 bool enabled_; | |
| 137 | |
| 138 // The map of extension_id:pending_request of all pending requests. | 133 // The map of extension_id:pending_request of all pending requests. |
| 139 PendingRequestMap pending_requests_; | 134 PendingRequestMap pending_requests_; |
| 140 | 135 |
| 141 // The extensions which have been granted permission to run on the given page. | 136 // The extensions which have been granted permission to run on the given page. |
| 142 // TODO(rdevlin.cronin): Right now, this just keeps track of extensions that | 137 // TODO(rdevlin.cronin): Right now, this just keeps track of extensions that |
| 143 // have been permitted to run on the page via this interface. Instead, it | 138 // have been permitted to run on the page via this interface. Instead, it |
| 144 // should incorporate more fully with ActiveTab. | 139 // should incorporate more fully with ActiveTab. |
| 145 std::set<std::string> permitted_extensions_; | 140 std::set<std::string> permitted_extensions_; |
| 146 | 141 |
| 147 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 142 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 148 extension_registry_observer_; | 143 extension_registry_observer_; |
| 149 | 144 |
| 150 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); | 145 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); |
| 151 }; | 146 }; |
| 152 | 147 |
| 153 } // namespace extensions | 148 } // namespace extensions |
| 154 | 149 |
| 155 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 150 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
| OLD | NEW |