| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 bool RequiresUserConsentForScriptInjection(const Extension* extension); | 50 bool RequiresUserConsentForScriptInjection(const Extension* extension); |
| 51 | 51 |
| 52 // Register a request for a script injection, to be executed by running | 52 // Register a request for a script injection, to be executed by running |
| 53 // |callback|. The only assumption that can be made about when (or if) | 53 // |callback|. The only assumption that can be made about when (or if) |
| 54 // |callback| is run is that, if it is run, it will run on the current page. | 54 // |callback| is run is that, if it is run, it will run on the current page. |
| 55 void RequestScriptInjection(const Extension* extension, | 55 void RequestScriptInjection(const Extension* extension, |
| 56 int page_id, | 56 int page_id, |
| 57 const base::Closure& callback); | 57 const base::Closure& callback); |
| 58 | 58 |
| 59 // Notifies the ActiveScriptController of detected ad injection. | 59 // Notifies the ActiveScriptController of detected ad injection. |
| 60 void OnAdInjectionDetected(const std::vector<std::string> ad_injectors); | 60 void OnAdInjectionDetected(const std::set<std::string> ad_injectors); |
| 61 | 61 |
| 62 // LocationBarControllerProvider implementation. | 62 // LocationBarControllerProvider implementation. |
| 63 virtual ExtensionAction* GetActionForExtension( | 63 virtual ExtensionAction* GetActionForExtension( |
| 64 const Extension* extension) OVERRIDE; | 64 const Extension* extension) OVERRIDE; |
| 65 virtual LocationBarController::Action OnClicked( | 65 virtual LocationBarController::Action OnClicked( |
| 66 const Extension* extension) OVERRIDE; | 66 const Extension* extension) OVERRIDE; |
| 67 virtual void OnNavigated() OVERRIDE; | 67 virtual void OnNavigated() OVERRIDE; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // A single pending request. This could be a pair, but we'd have way too many | 70 // A single pending request. This could be a pair, but we'd have way too many |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // that get generated for extensions that haven't declared anything. | 109 // that get generated for extensions that haven't declared anything. |
| 110 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; | 110 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; |
| 111 ActiveScriptMap active_script_actions_; | 111 ActiveScriptMap active_script_actions_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); | 113 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace extensions | 116 } // namespace extensions |
| 117 | 117 |
| 118 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 118 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
| OLD | NEW |