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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "chrome/common/extensions/extension.h" | 11 #include "chrome/common/extensions/extension.h" |
12 #include "chrome/common/url_constants.h" | 12 #include "chrome/common/url_constants.h" |
13 #include "chrome/renderer/extensions/dispatcher.h" | 13 #include "chrome/renderer/extensions/dispatcher.h" |
14 #include "chrome/renderer/extensions/extension_helper.h" | 14 #include "chrome/renderer/extensions/extension_helper.h" |
15 #include "content/public/renderer/render_view.h" | 15 #include "content/public/renderer/render_view.h" |
16 #include "content/public/renderer/v8_value_converter.h" | 16 #include "content/public/renderer/v8_value_converter.h" |
17 #include "extensions/common/view_type.h" | 17 #include "extensions/common/view_type.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 Dispatcher* dispatcher, | 31 ChromeV8Context* context) |
32 v8::Handle<v8::Context> context) | |
33 : ChromeV8Extension(dispatcher, context) { | 32 : ChromeV8Extension(dispatcher, context) { |
34 RouteFunction("GetExtensionViews", | 33 RouteFunction("GetExtensionViews", |
35 base::Bind(&ExtensionCustomBindings::GetExtensionViews, | 34 base::Bind(&ExtensionCustomBindings::GetExtensionViews, |
36 base::Unretained(this))); | 35 base::Unretained(this))); |
37 } | 36 } |
38 | 37 |
39 v8::Handle<v8::Value> ExtensionCustomBindings::GetExtensionViews( | 38 v8::Handle<v8::Value> ExtensionCustomBindings::GetExtensionViews( |
40 const v8::Arguments& args) { | 39 const v8::Arguments& args) { |
41 if (args.Length() != 2) | 40 if (args.Length() != 2) |
42 return v8::Undefined(); | 41 return v8::Undefined(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 v8::Local<v8::Value> window = context->Global(); | 87 v8::Local<v8::Value> window = context->Global(); |
89 DCHECK(!window.IsEmpty()); | 88 DCHECK(!window.IsEmpty()); |
90 v8_views->Set(v8::Integer::New(v8_index++), window); | 89 v8_views->Set(v8::Integer::New(v8_index++), window); |
91 } | 90 } |
92 } | 91 } |
93 | 92 |
94 return v8_views; | 93 return v8_views; |
95 } | 94 } |
96 | 95 |
97 } // namespace extensions | 96 } // namespace extensions |
OLD | NEW |