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 #include "chrome/renderer/extensions/extension_custom_bindings.h" | 5 #include "chrome/renderer/extensions/extension_custom_bindings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
11 #include "chrome/common/extensions/extension_action.h" | 11 #include "chrome/common/extensions/extension_action.h" |
12 #include "chrome/common/extensions/extension_messages.h" | 12 #include "chrome/common/extensions/extension_messages.h" |
13 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
14 #include "chrome/common/view_type.h" | 14 #include "chrome/common/view_type.h" |
15 #include "chrome/renderer/extensions/extension_dispatcher.h" | 15 #include "chrome/renderer/extensions/dispatcher.h" |
16 #include "chrome/renderer/extensions/extension_helper.h" | 16 #include "chrome/renderer/extensions/extension_helper.h" |
17 #include "content/public/renderer/render_view.h" | 17 #include "content/public/renderer/render_view.h" |
18 #include "grit/renderer_resources.h" | 18 #include "grit/renderer_resources.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
21 #include "webkit/glue/webkit_glue.h" | 21 #include "webkit/glue/webkit_glue.h" |
22 #include "v8/include/v8.h" | 22 #include "v8/include/v8.h" |
23 | 23 |
24 namespace extensions { | 24 namespace extensions { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 ExtensionCustomBindings::ExtensionCustomBindings( | 30 ExtensionCustomBindings::ExtensionCustomBindings(Dispatcher* dispatcher) |
31 ExtensionDispatcher* extension_dispatcher) | 31 : ChromeV8Extension(dispatcher) { |
32 : ChromeV8Extension(extension_dispatcher) { | |
33 RouteStaticFunction("GetExtensionViews", &GetExtensionViews); | 32 RouteStaticFunction("GetExtensionViews", &GetExtensionViews); |
34 RouteStaticFunction("OpenChannelToExtension", &OpenChannelToExtension); | 33 RouteStaticFunction("OpenChannelToExtension", &OpenChannelToExtension); |
35 } | 34 } |
36 | 35 |
37 // static | 36 // static |
38 v8::Handle<v8::Value> ExtensionCustomBindings::GetExtensionViews( | 37 v8::Handle<v8::Value> ExtensionCustomBindings::GetExtensionViews( |
39 const v8::Arguments& args) { | 38 const v8::Arguments& args) { |
40 if (args.Length() != 2) | 39 if (args.Length() != 2) |
41 return v8::Undefined(); | 40 return v8::Undefined(); |
42 | 41 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( | 117 renderview->Send(new ExtensionHostMsg_OpenChannelToExtension( |
119 renderview->GetRoutingID(), | 118 renderview->GetRoutingID(), |
120 source_id, | 119 source_id, |
121 target_id, | 120 target_id, |
122 channel_name, | 121 channel_name, |
123 &port_id)); | 122 &port_id)); |
124 return v8::Integer::New(port_id); | 123 return v8::Integer::New(port_id); |
125 } | 124 } |
126 | 125 |
127 } // namespace extensions | 126 } // namespace extensions |
OLD | NEW |