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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 base::Bind(&CallJsFunctionSync), | 329 base::Bind(&CallJsFunctionSync), |
329 base::Bind(&GetAPISchema), | 330 base::Bind(&GetAPISchema), |
330 base::Bind(&NativeExtensionBindingsSystem::SendRequest, | 331 base::Bind(&NativeExtensionBindingsSystem::SendRequest, |
331 base::Unretained(this)), | 332 base::Unretained(this)), |
332 base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged, | 333 base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged, |
333 base::Unretained(this)), | 334 base::Unretained(this)), |
334 APILastError(base::Bind(&GetRuntime))), | 335 APILastError(base::Bind(&GetRuntime))), |
335 weak_factory_(this) { | 336 weak_factory_(this) { |
336 api_system_.RegisterCustomType("storage.StorageArea", | 337 api_system_.RegisterCustomType("storage.StorageArea", |
337 base::Bind(&StorageArea::CreateStorageArea)); | 338 base::Bind(&StorageArea::CreateStorageArea)); |
| 339 api_system_.RegisterCustomType("types.ChromeSetting", |
| 340 base::Bind(&ChromeSetting::Create)); |
338 } | 341 } |
339 | 342 |
340 NativeExtensionBindingsSystem::~NativeExtensionBindingsSystem() {} | 343 NativeExtensionBindingsSystem::~NativeExtensionBindingsSystem() {} |
341 | 344 |
342 void NativeExtensionBindingsSystem::DidCreateScriptContext( | 345 void NativeExtensionBindingsSystem::DidCreateScriptContext( |
343 ScriptContext* context) {} | 346 ScriptContext* context) {} |
344 | 347 |
345 void NativeExtensionBindingsSystem::WillReleaseScriptContext( | 348 void NativeExtensionBindingsSystem::WillReleaseScriptContext( |
346 ScriptContext* context) {} | 349 ScriptContext* context) {} |
347 | 350 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 | 632 |
630 void NativeExtensionBindingsSystem::OnEventListenerChanged( | 633 void NativeExtensionBindingsSystem::OnEventListenerChanged( |
631 const std::string& event_name, | 634 const std::string& event_name, |
632 binding::EventListenersChanged change, | 635 binding::EventListenersChanged change, |
633 v8::Local<v8::Context> context) { | 636 v8::Local<v8::Context> context) { |
634 send_event_listener_ipc_.Run( | 637 send_event_listener_ipc_.Run( |
635 change, ScriptContextSet::GetContextByV8Context(context), event_name); | 638 change, ScriptContextSet::GetContextByV8Context(context), event_name); |
636 } | 639 } |
637 | 640 |
638 } // namespace extensions | 641 } // namespace extensions |
OLD | NEW |