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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 that an extension has been granted | 59 // Notifies the ActiveScriptController that an extension has been granted |
60 // active tab permissions. This will run any pending injections for that | 60 // active tab permissions. This will run any pending injections for that |
61 // extension. | 61 // extension. |
62 void OnActiveTabPermissionGranted(const Extension* extension); | 62 void OnActiveTabPermissionGranted(const Extension* extension); |
63 | 63 |
64 // Notifies the ActiveScriptController of detected ad injection. | 64 // Notifies the ActiveScriptController of detected ad injection. |
65 void OnAdInjectionDetected(const std::vector<std::string> ad_injectors); | 65 void OnAdInjectionDetected(const std::set<std::string> ad_injectors); |
66 | 66 |
67 // LocationBarControllerProvider implementation. | 67 // LocationBarControllerProvider implementation. |
68 virtual ExtensionAction* GetActionForExtension( | 68 virtual ExtensionAction* GetActionForExtension( |
69 const Extension* extension) OVERRIDE; | 69 const Extension* extension) OVERRIDE; |
70 virtual LocationBarController::Action OnClicked( | 70 virtual LocationBarController::Action OnClicked( |
71 const Extension* extension) OVERRIDE; | 71 const Extension* extension) OVERRIDE; |
72 virtual void OnNavigated() OVERRIDE; | 72 virtual void OnNavigated() OVERRIDE; |
73 | 73 |
74 private: | 74 private: |
75 // A single pending request. This could be a pair, but we'd have way too many | 75 // A single pending request. This could be a pair, but we'd have way too many |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // that get generated for extensions that haven't declared anything. | 117 // that get generated for extensions that haven't declared anything. |
118 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; | 118 typedef std::map<std::string, linked_ptr<ExtensionAction> > ActiveScriptMap; |
119 ActiveScriptMap active_script_actions_; | 119 ActiveScriptMap active_script_actions_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); | 121 DISALLOW_COPY_AND_ASSIGN(ActiveScriptController); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace extensions | 124 } // namespace extensions |
125 | 125 |
126 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ | 126 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVE_SCRIPT_CONTROLLER_H_ |
OLD | NEW |