OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "extensions/renderer/native_extension_bindings_system.h" | 5 #include "extensions/renderer/native_extension_bindings_system.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
11 #include "extensions/common/extension_api.h" | 11 #include "extensions/common/extension_api.h" |
12 #include "extensions/common/extension_messages.h" | 12 #include "extensions/common/extension_messages.h" |
13 #include "extensions/common/features/feature_provider.h" | 13 #include "extensions/common/features/feature_provider.h" |
14 #include "extensions/renderer/api_binding_bridge.h" | 14 #include "extensions/renderer/api_binding_bridge.h" |
15 #include "extensions/renderer/api_binding_hooks.h" | 15 #include "extensions/renderer/api_binding_hooks.h" |
| 16 #include "extensions/renderer/chrome_setting.h" |
16 #include "extensions/renderer/module_system.h" | 17 #include "extensions/renderer/module_system.h" |
17 #include "extensions/renderer/script_context.h" | 18 #include "extensions/renderer/script_context.h" |
18 #include "extensions/renderer/script_context_set.h" | 19 #include "extensions/renderer/script_context_set.h" |
19 #include "extensions/renderer/storage_area.h" | 20 #include "extensions/renderer/storage_area.h" |
20 #include "gin/converter.h" | 21 #include "gin/converter.h" |
21 #include "gin/handle.h" | 22 #include "gin/handle.h" |
22 #include "gin/per_context_data.h" | 23 #include "gin/per_context_data.h" |
23 #include "third_party/WebKit/public/web/WebDocument.h" | 24 #include "third_party/WebKit/public/web/WebDocument.h" |
24 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 25 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
25 | 26 |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 base::Bind(&CallJsFunctionSync), | 328 base::Bind(&CallJsFunctionSync), |
328 base::Bind(&GetAPISchema), | 329 base::Bind(&GetAPISchema), |
329 base::Bind(&NativeExtensionBindingsSystem::SendRequest, | 330 base::Bind(&NativeExtensionBindingsSystem::SendRequest, |
330 base::Unretained(this)), | 331 base::Unretained(this)), |
331 base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged, | 332 base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged, |
332 base::Unretained(this)), | 333 base::Unretained(this)), |
333 APILastError(base::Bind(&GetRuntime))), | 334 APILastError(base::Bind(&GetRuntime))), |
334 weak_factory_(this) { | 335 weak_factory_(this) { |
335 api_system_.RegisterCustomType("storage.StorageArea", | 336 api_system_.RegisterCustomType("storage.StorageArea", |
336 base::Bind(&StorageArea::CreateStorageArea)); | 337 base::Bind(&StorageArea::CreateStorageArea)); |
| 338 api_system_.RegisterCustomType( |
| 339 "types.ChromeSetting", base::Bind(&ChromeSetting::CreateChromeSetting)); |
337 } | 340 } |
338 | 341 |
339 NativeExtensionBindingsSystem::~NativeExtensionBindingsSystem() {} | 342 NativeExtensionBindingsSystem::~NativeExtensionBindingsSystem() {} |
340 | 343 |
341 void NativeExtensionBindingsSystem::DidCreateScriptContext( | 344 void NativeExtensionBindingsSystem::DidCreateScriptContext( |
342 ScriptContext* context) {} | 345 ScriptContext* context) {} |
343 | 346 |
344 void NativeExtensionBindingsSystem::WillReleaseScriptContext( | 347 void NativeExtensionBindingsSystem::WillReleaseScriptContext( |
345 ScriptContext* context) {} | 348 ScriptContext* context) {} |
346 | 349 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 631 |
629 void NativeExtensionBindingsSystem::OnEventListenerChanged( | 632 void NativeExtensionBindingsSystem::OnEventListenerChanged( |
630 const std::string& event_name, | 633 const std::string& event_name, |
631 binding::EventListenersChanged change, | 634 binding::EventListenersChanged change, |
632 v8::Local<v8::Context> context) { | 635 v8::Local<v8::Context> context) { |
633 send_event_listener_ipc_.Run( | 636 send_event_listener_ipc_.Run( |
634 change, ScriptContextSet::GetContextByV8Context(context), event_name); | 637 change, ScriptContextSet::GetContextByV8Context(context), event_name); |
635 } | 638 } |
636 | 639 |
637 } // namespace extensions | 640 } // namespace extensions |
OLD | NEW |