Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 | 178 |
| 179 // Sets up the host permissions for |extension|. | 179 // Sets up the host permissions for |extension|. |
| 180 void InitOriginPermissions(const Extension* extension); | 180 void InitOriginPermissions(const Extension* extension); |
| 181 void AddOrRemoveOriginPermissions( | 181 void AddOrRemoveOriginPermissions( |
| 182 UpdatedExtensionPermissionsInfo::Reason reason, | 182 UpdatedExtensionPermissionsInfo::Reason reason, |
| 183 const Extension* extension, | 183 const Extension* extension, |
| 184 const URLPatternSet& origins); | 184 const URLPatternSet& origins); |
| 185 | 185 |
| 186 void RegisterNativeHandlers(ModuleSystem* module_system, | 186 void RegisterNativeHandlers(ModuleSystem* module_system, |
| 187 ChromeV8Context* context); | 187 ChromeV8Context* context); |
| 188 void RegisterSchemaGeneratedBindings(ModuleSystem* module_system, | |
| 189 ChromeV8Context* context, | |
| 190 v8::Handle<v8::Context> v8_context); | |
| 188 | 191 |
| 189 // Inserts static source code into |source_map_|. | 192 // Inserts static source code into |source_map_|. |
| 190 void PopulateSourceMap(); | 193 void PopulateSourceMap(); |
| 191 | 194 |
| 192 // Inserts BindingInstallers into |lazy_bindings_map_|. | 195 // Inserts BindingInstallers into |lazy_bindings_map_|. |
| 193 void PopulateLazyBindingsMap(); | 196 void PopulateLazyBindingsMap(); |
| 194 | 197 |
| 195 // Sets up the bindings for the given api. | 198 // Sets up the bindings for the given api. |
| 196 void InstallBindings(ModuleSystem* module_system, | 199 void InstallBindings(ModuleSystem* module_system, |
| 197 v8::Handle<v8::Context> v8_context, | 200 v8::Handle<v8::Context> v8_context, |
| 198 const std::string& api); | 201 const std::string& api); |
| 199 | 202 |
| 200 // Determines whether |frame| is loading a platform app resource URL. (this | 203 // Determines whether |frame| is loading a platform app resource URL. (this |
| 201 // evaluates to true for iframes in platform apps and sandboxed resources that | 204 // evaluates to true for iframes in platform apps and sandboxed resources that |
| 202 // are not in the same origin). | 205 // are not in the same origin). |
| 203 bool IsWithinPlatformApp(const WebKit::WebFrame* frame); | 206 bool IsWithinPlatformApp(const WebKit::WebFrame* frame); |
| 204 | 207 |
| 205 // Returns the Feature::Context type of context for a JavaScript context. | 208 // Returns the Feature::Context type of context for a JavaScript context. |
| 206 Feature::Context ClassifyJavaScriptContext(const std::string& extension_id, | 209 Feature::Context ClassifyJavaScriptContext(const std::string& extension_id, |
| 207 int extension_group, | 210 int extension_group, |
| 208 const ExtensionURLInfo& url_info); | 211 const ExtensionURLInfo& url_info); |
| 209 | 212 |
| 213 typedef void (ModuleSystem::*LazyFieldSetter)(v8::Handle<v8::Object>, | |
| 214 const std::string&, | |
| 215 const std::string&, | |
| 216 const std::string&); | |
| 217 void SetUpChainedField(v8::Handle<v8::Object> object, | |
|
not at google - send to devlin
2013/01/24 21:10:12
comment
cduvall
2013/01/24 22:15:15
Done.
| |
| 218 const std::string& field, | |
| 219 const std::string& module_name, | |
| 220 const std::string& module_field, | |
| 221 ModuleSystem* module_system, | |
| 222 LazyFieldSetter setter); | |
| 223 | |
| 210 // True if this renderer is running extensions. | 224 // True if this renderer is running extensions. |
| 211 bool is_extension_process_; | 225 bool is_extension_process_; |
| 212 | 226 |
| 213 // Contains all loaded extensions. This is essentially the renderer | 227 // Contains all loaded extensions. This is essentially the renderer |
| 214 // counterpart to ExtensionService in the browser. It contains information | 228 // counterpart to ExtensionService in the browser. It contains information |
| 215 // about all extensions currently loaded by the browser. | 229 // about all extensions currently loaded by the browser. |
| 216 ExtensionSet extensions_; | 230 ExtensionSet extensions_; |
| 217 | 231 |
| 218 // All the bindings contexts that are currently loaded for this renderer. | 232 // All the bindings contexts that are currently loaded for this renderer. |
| 219 // There is zero or one for each v8 context. | 233 // There is zero or one for each v8 context. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 | 265 |
| 252 // Sends API requests to the extension host. | 266 // Sends API requests to the extension host. |
| 253 scoped_ptr<RequestSender> request_sender_; | 267 scoped_ptr<RequestSender> request_sender_; |
| 254 | 268 |
| 255 DISALLOW_COPY_AND_ASSIGN(Dispatcher); | 269 DISALLOW_COPY_AND_ASSIGN(Dispatcher); |
| 256 }; | 270 }; |
| 257 | 271 |
| 258 } // namespace extensions | 272 } // namespace extensions |
| 259 | 273 |
| 260 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ | 274 #endif // CHROME_RENDERER_EXTENSIONS_DISPATCHER_H_ |
| OLD | NEW |