OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/plugins/renderer/webview_plugin.h" | 5 #include "components/plugins/renderer/webview_plugin.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
10 #include "content/public/renderer/web_preferences.h" | 10 #include "content/public/renderer/web_preferences.h" |
11 #include "skia/ext/platform_canvas.h" | 11 #include "skia/ext/platform_canvas.h" |
12 #include "third_party/WebKit/public/platform/WebSize.h" | 12 #include "third_party/WebKit/public/platform/WebSize.h" |
13 #include "third_party/WebKit/public/platform/WebURL.h" | 13 #include "third_party/WebKit/public/platform/WebURL.h" |
14 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 14 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
15 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 15 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
16 #include "third_party/WebKit/public/web/WebDocument.h" | 16 #include "third_party/WebKit/public/web/WebDocument.h" |
17 #include "third_party/WebKit/public/web/WebElement.h" | 17 #include "third_party/WebKit/public/web/WebElement.h" |
18 #include "third_party/WebKit/public/web/WebFrame.h" | |
19 #include "third_party/WebKit/public/web/WebInputEvent.h" | 18 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 19 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
20 #include "third_party/WebKit/public/web/WebPluginContainer.h" | 20 #include "third_party/WebKit/public/web/WebPluginContainer.h" |
21 #include "third_party/WebKit/public/web/WebView.h" | 21 #include "third_party/WebKit/public/web/WebView.h" |
22 #include "webkit/common/webpreferences.h" | 22 #include "webkit/common/webpreferences.h" |
23 | 23 |
24 using blink::WebCanvas; | 24 using blink::WebCanvas; |
25 using blink::WebCursorInfo; | 25 using blink::WebCursorInfo; |
26 using blink::WebDragData; | 26 using blink::WebDragData; |
27 using blink::WebDragOperationsMask; | 27 using blink::WebDragOperationsMask; |
28 using blink::WebFrame; | |
29 using blink::WebImage; | 28 using blink::WebImage; |
30 using blink::WebInputEvent; | 29 using blink::WebInputEvent; |
31 using blink::WebLocalFrame; | 30 using blink::WebLocalFrame; |
32 using blink::WebMouseEvent; | 31 using blink::WebMouseEvent; |
33 using blink::WebPlugin; | 32 using blink::WebPlugin; |
34 using blink::WebPluginContainer; | 33 using blink::WebPluginContainer; |
35 using blink::WebPoint; | 34 using blink::WebPoint; |
36 using blink::WebRect; | 35 using blink::WebRect; |
37 using blink::WebSize; | 36 using blink::WebSize; |
38 using blink::WebString; | 37 using blink::WebString; |
39 using blink::WebURLError; | 38 using blink::WebURLError; |
40 using blink::WebURLRequest; | 39 using blink::WebURLRequest; |
41 using blink::WebURLResponse; | 40 using blink::WebURLResponse; |
42 using blink::WebVector; | 41 using blink::WebVector; |
43 using blink::WebView; | 42 using blink::WebView; |
44 | 43 |
45 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) | 44 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) |
46 : delegate_(delegate), | 45 : delegate_(delegate), |
47 container_(NULL), | 46 container_(NULL), |
48 web_view_(WebView::create(this)), | 47 web_view_(WebView::create(this)), |
49 web_frame_(WebFrame::create(this)), | 48 web_frame_(WebLocalFrame::create(this)), |
50 finished_loading_(false), | 49 finished_loading_(false), |
51 focused_(false) { | 50 focused_(false) { |
52 web_view_->setMainFrame(web_frame_); | 51 web_view_->setMainFrame(web_frame_); |
53 } | 52 } |
54 | 53 |
55 // static | 54 // static |
56 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, | 55 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, |
57 const WebPreferences& preferences, | 56 const WebPreferences& preferences, |
58 const std::string& html_data, | 57 const std::string& html_data, |
59 const GURL& url) { | 58 const GURL& url) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame, int world_id) { | 231 void WebViewPlugin::didClearWindowObject(WebLocalFrame* frame, int world_id) { |
233 if (delegate_) | 232 if (delegate_) |
234 delegate_->BindWebFrame(frame); | 233 delegate_->BindWebFrame(frame); |
235 } | 234 } |
236 | 235 |
237 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, | 236 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, |
238 unsigned identifier, | 237 unsigned identifier, |
239 const WebURLResponse& response) { | 238 const WebURLResponse& response) { |
240 WebFrameClient::didReceiveResponse(frame, identifier, response); | 239 WebFrameClient::didReceiveResponse(frame, identifier, response); |
241 } | 240 } |
OLD | NEW |