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 EXTENSIONS_RENDERER_DISPATCHER_H_ | 5 #ifndef EXTENSIONS_RENDERER_DISPATCHER_H_ |
6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ | 6 #define EXTENSIONS_RENDERER_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void OnUsingWebRequestAPI(bool webrequest_used); | 185 void OnUsingWebRequestAPI(bool webrequest_used); |
186 | 186 |
187 // UserScriptSet::Observer implementation. | 187 // UserScriptSet::Observer implementation. |
188 virtual void OnUserScriptsUpdated( | 188 virtual void OnUserScriptsUpdated( |
189 const std::set<std::string>& changed_extensions, | 189 const std::set<std::string>& changed_extensions, |
190 const std::vector<UserScript*>& scripts) OVERRIDE; | 190 const std::vector<UserScript*>& scripts) OVERRIDE; |
191 | 191 |
192 void UpdateActiveExtensions(); | 192 void UpdateActiveExtensions(); |
193 | 193 |
194 // Sets up the host permissions for |extension|. | 194 // Sets up the host permissions for |extension|. |
195 void UpdateOriginPermissions(const Extension* extension); | 195 void InitOriginPermissions(const Extension* extension); |
| 196 |
| 197 // Updates the host permissions for extension to include only those in |
| 198 // |new_patterns|, and remove from |old_patterns| that are no longer allowed. |
| 199 void UpdateOriginPermissions(const Extension* extension, |
| 200 const URLPatternSet& old_patterns, |
| 201 const URLPatternSet& new_patterns); |
196 | 202 |
197 // Enable custom element whitelist in Apps. | 203 // Enable custom element whitelist in Apps. |
198 void EnableCustomElementWhiteList(); | 204 void EnableCustomElementWhiteList(); |
199 | 205 |
200 // Adds or removes bindings for every context belonging to |extension_id|, or | 206 // Adds or removes bindings for every context belonging to |extension_id|, or |
201 // or all contexts if |extension_id| is empty. | 207 // or all contexts if |extension_id| is empty. |
202 void UpdateBindings(const std::string& extension_id); | 208 void UpdateBindings(const std::string& extension_id); |
203 | 209 |
204 void UpdateBindingsForContext(ScriptContext* context); | 210 void UpdateBindingsForContext(ScriptContext* context); |
205 | 211 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 // the observer is destroyed before the UserScriptSet. | 298 // the observer is destroyed before the UserScriptSet. |
293 ScopedObserver<UserScriptSet, UserScriptSet::Observer> | 299 ScopedObserver<UserScriptSet, UserScriptSet::Observer> |
294 user_script_set_observer_; | 300 user_script_set_observer_; |
295 | 301 |
296 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 302 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
297 }; | 303 }; |
298 | 304 |
299 } // namespace extensions | 305 } // namespace extensions |
300 | 306 |
301 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ | 307 #endif // EXTENSIONS_RENDERER_DISPATCHER_H_ |
OLD | NEW |