| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 content::WebContents* web_contents); | 47 content::WebContents* web_contents); |
| 48 | 48 |
| 49 // Notifies the ActiveScriptController that an extension has been granted | 49 // Notifies the ActiveScriptController that an extension has been granted |
| 50 // active tab permissions. This will run any pending injections for that | 50 // active tab permissions. This will run any pending injections for that |
| 51 // extension. | 51 // extension. |
| 52 void OnActiveTabPermissionGranted(const Extension* extension); | 52 void OnActiveTabPermissionGranted(const Extension* extension); |
| 53 | 53 |
| 54 // Notifies the ActiveScriptController of detected ad injection. | 54 // Notifies the ActiveScriptController of detected ad injection. |
| 55 void OnAdInjectionDetected(const std::set<std::string>& ad_injectors); | 55 void OnAdInjectionDetected(const std::set<std::string>& ad_injectors); |
| 56 | 56 |
| 57 // Adds the visible URL to |extension|'s persisted permissions for script |
| 58 // injection requests. |
| 59 void AddPersistedPermission(const Extension* extension); |
| 60 |
| 61 // Returns whether there is an active script injection action for |
| 62 // |extension|. |
| 63 bool HasActiveScriptAction(const Extension* extension); |
| 64 |
| 57 // LocationBarControllerProvider implementation. | 65 // LocationBarControllerProvider implementation. |
| 58 virtual ExtensionAction* GetActionForExtension( | 66 virtual ExtensionAction* GetActionForExtension( |
| 59 const Extension* extension) OVERRIDE; | 67 const Extension* extension) OVERRIDE; |
| 60 virtual LocationBarController::Action OnClicked( | 68 virtual LocationBarController::Action OnClicked( |
| 61 const Extension* extension) OVERRIDE; | 69 const Extension* extension) OVERRIDE; |
| 62 virtual void OnNavigated() OVERRIDE; | 70 virtual void OnNavigated() OVERRIDE; |
| 63 virtual void OnExtensionUnloaded(const Extension* extension) OVERRIDE; | 71 virtual void OnExtensionUnloaded(const Extension* extension) OVERRIDE; |
| 64 | 72 |
| 65 #if defined(UNIT_TEST) | 73 #if defined(UNIT_TEST) |
| 66 // Only used in tests. | 74 // Only used in tests. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // that get generated for extensions that haven't declared anything. | 137 // that get generated for extensions that haven't declared anything. |
| 130 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; | 138 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; |
| 131 ActiveScriptMap active_script_actions_; | 139 ActiveScriptMap active_script_actions_; |
| 132 | 140 |
| 133 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); | 141 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); |
| 134 }; | 142 }; |
| 135 | 143 |
| 136 } // namespace extensions | 144 } // namespace extensions |
| 137 | 145 |
| 138 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
| OLD | NEW |