OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_RENDERER_EXTENSIONS_DISPATCHER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Update the list of active extensions that will be reported when we crash. | 193 // Update the list of active extensions that will be reported when we crash. |
194 void UpdateActiveExtensions(); | 194 void UpdateActiveExtensions(); |
195 | 195 |
196 // Sets up the host permissions for |extension|. | 196 // Sets up the host permissions for |extension|. |
197 void InitOriginPermissions(const Extension* extension); | 197 void InitOriginPermissions(const Extension* extension); |
198 void AddOrRemoveOriginPermissions( | 198 void AddOrRemoveOriginPermissions( |
199 UpdatedExtensionPermissionsInfo::Reason reason, | 199 UpdatedExtensionPermissionsInfo::Reason reason, |
200 const Extension* extension, | 200 const Extension* extension, |
201 const URLPatternSet& origins); | 201 const URLPatternSet& origins); |
202 | 202 |
| 203 // Enable custom element whitelist in Apps. |
| 204 void EnableCustomElementWhiteList(); |
| 205 |
203 // 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 |
204 // or all contexts if |extension_id| is empty. | 207 // or all contexts if |extension_id| is empty. |
205 void AddOrRemoveBindings(const std::string& extension_id); | 208 void AddOrRemoveBindings(const std::string& extension_id); |
206 | 209 |
207 void RegisterNativeHandlers(ModuleSystem* module_system, | 210 void RegisterNativeHandlers(ModuleSystem* module_system, |
208 ChromeV8Context* context); | 211 ChromeV8Context* context); |
209 void AddOrRemoveBindingsForContext(ChromeV8Context* context); | 212 void AddOrRemoveBindingsForContext(ChromeV8Context* context); |
210 void RegisterBinding(const std::string& api_name, | 213 void RegisterBinding(const std::string& api_name, |
211 ChromeV8Context* context); | 214 ChromeV8Context* context); |
212 void DeregisterBinding(const std::string& api_name, ChromeV8Context* context); | 215 void DeregisterBinding(const std::string& api_name, ChromeV8Context* context); |
213 v8::Handle<v8::Object> GetOrCreateBindObjectIfAvailable( | 216 v8::Handle<v8::Object> GetOrCreateBindObjectIfAvailable( |
214 const std::string& api_name, | 217 const std::string& api_name, |
215 std::string* bind_name, | 218 std::string* bind_name, |
216 ChromeV8Context* context); | 219 ChromeV8Context* context); |
217 | 220 |
218 // Inserts static source code into |source_map_|. | 221 // Inserts static source code into |source_map_|. |
219 void PopulateSourceMap(); | 222 void PopulateSourceMap(); |
220 | 223 |
221 // Inserts BindingInstallers into |lazy_bindings_map_|. | 224 // Inserts BindingInstallers into |lazy_bindings_map_|. |
222 void PopulateLazyBindingsMap(); | 225 void PopulateLazyBindingsMap(); |
223 | 226 |
224 // Sets up the bindings for the given api. | 227 // Sets up the bindings for the given api. |
225 void InstallBindings(ModuleSystem* module_system, | 228 void InstallBindings(ModuleSystem* module_system, |
226 v8::Handle<v8::Context> v8_context, | 229 v8::Handle<v8::Context> v8_context, |
227 const std::string& api); | 230 const std::string& api); |
228 | 231 |
229 // Determines whether |frame| is loading a platform app resource URL. (this | 232 // Returns whether the current renderer hosts a platform app. |
230 // evaluates to true for iframes in platform apps and sandboxed resources that | 233 bool IsWithinPlatformApp(); |
231 // are not in the same origin). | |
232 bool IsWithinPlatformApp(const WebKit::WebFrame* frame); | |
233 | 234 |
234 bool IsSandboxedPage(const GURL& url) const; | 235 bool IsSandboxedPage(const GURL& url) const; |
235 | 236 |
236 // Returns the Feature::Context type of context for a JavaScript context. | 237 // Returns the Feature::Context type of context for a JavaScript context. |
237 Feature::Context ClassifyJavaScriptContext( | 238 Feature::Context ClassifyJavaScriptContext( |
238 const std::string& extension_id, | 239 const std::string& extension_id, |
239 int extension_group, | 240 int extension_group, |
240 const GURL& url, | 241 const GURL& url, |
241 const WebKit::WebSecurityOrigin& origin); | 242 const WebKit::WebSecurityOrigin& origin); |
242 | 243 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 // The platforms system font family and size; | 300 // The platforms system font family and size; |
300 std::string system_font_family_; | 301 std::string system_font_family_; |
301 std::string system_font_size_; | 302 std::string system_font_size_; |
302 | 303 |
303 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 304 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
304 }; | 305 }; |
305 | 306 |
306 } // namespace extensions | 307 } // namespace extensions |
307 | 308 |
308 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 309 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
OLD | NEW |