OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/dom_distiller/content/renderer/distiller_native_javascript.
h" | 5 #include "components/dom_distiller/content/renderer/distiller_native_javascript.
h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" | 11 #include "components/dom_distiller/content/common/distiller_javascript_service.m
ojom.h" |
12 #include "content/public/renderer/render_frame.h" | 12 #include "content/public/renderer/render_frame.h" |
13 #include "gin/arguments.h" | 13 #include "gin/arguments.h" |
14 #include "gin/function_template.h" | 14 #include "gin/function_template.h" |
15 #include "services/shell/public/cpp/interface_provider.h" | 15 #include "services/service_manager/public/cpp/interface_provider.h" |
16 #include "third_party/WebKit/public/web/WebKit.h" | 16 #include "third_party/WebKit/public/web/WebKit.h" |
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 17 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
18 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
19 | 19 |
20 using blink::WebLocalFrame; | 20 using blink::WebLocalFrame; |
21 | 21 |
22 namespace dom_distiller { | 22 namespace dom_distiller { |
23 | 23 |
24 DistillerNativeJavaScript::DistillerNativeJavaScript( | 24 DistillerNativeJavaScript::DistillerNativeJavaScript( |
25 content::RenderFrame* render_frame) | 25 content::RenderFrame* render_frame) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 if (distiller_value.IsEmpty() || !distiller_value->IsObject()) { | 90 if (distiller_value.IsEmpty() || !distiller_value->IsObject()) { |
91 distiller_obj = v8::Object::New(isolate); | 91 distiller_obj = v8::Object::New(isolate); |
92 global->Set(gin::StringToSymbol(isolate, "distiller"), distiller_obj); | 92 global->Set(gin::StringToSymbol(isolate, "distiller"), distiller_obj); |
93 } else { | 93 } else { |
94 distiller_obj = v8::Local<v8::Object>::Cast(distiller_value); | 94 distiller_obj = v8::Local<v8::Object>::Cast(distiller_value); |
95 } | 95 } |
96 return distiller_obj; | 96 return distiller_obj; |
97 } | 97 } |
98 | 98 |
99 } // namespace dom_distiller | 99 } // namespace dom_distiller |
OLD | NEW |