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 |
57 // LocationBarControllerProvider implementation. | 61 // LocationBarControllerProvider implementation. |
58 virtual ExtensionAction* GetActionForExtension( | 62 virtual ExtensionAction* GetActionForExtension( |
59 const Extension* extension) OVERRIDE; | 63 const Extension* extension) OVERRIDE; |
60 virtual LocationBarController::Action OnClicked( | 64 virtual LocationBarController::Action OnClicked( |
61 const Extension* extension) OVERRIDE; | 65 const Extension* extension) OVERRIDE; |
62 virtual void OnNavigated() OVERRIDE; | 66 virtual void OnNavigated() OVERRIDE; |
63 virtual void OnExtensionUnloaded(const Extension* extension) OVERRIDE; | 67 virtual void OnExtensionUnloaded(const Extension* extension) OVERRIDE; |
64 | 68 |
65 #if defined(UNIT_TEST) | 69 #if defined(UNIT_TEST) |
66 // Only used in tests. | 70 // 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. | 133 // that get generated for extensions that haven't declared anything. |
130 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; | 134 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; |
131 ActiveScriptMap active_script_actions_; | 135 ActiveScriptMap active_script_actions_; |
132 | 136 |
133 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); | 137 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); |
134 }; | 138 }; |
135 | 139 |
136 } // namespace extensions | 140 } // namespace extensions |
137 | 141 |
138 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 142 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
OLD | NEW |