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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 using blink::WebURLError; | 38 using blink::WebURLError; |
39 using blink::WebURLRequest; | 39 using blink::WebURLRequest; |
40 using blink::WebURLResponse; | 40 using blink::WebURLResponse; |
41 using blink::WebVector; | 41 using blink::WebVector; |
42 using blink::WebView; | 42 using blink::WebView; |
43 | 43 |
44 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) | 44 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate) |
45 : delegate_(delegate), | 45 : delegate_(delegate), |
46 container_(NULL), | 46 container_(NULL), |
47 web_view_(WebView::create(this)), | 47 web_view_(WebView::create(this)), |
48 web_frame_(WebFrame::create(this, 0)), | 48 web_frame_(WebFrame::create(this)), |
49 finished_loading_(false), | 49 finished_loading_(false), |
50 focused_(false) { | 50 focused_(false) { |
51 web_view_->setMainFrame(web_frame_); | 51 web_view_->setMainFrame(web_frame_); |
52 } | 52 } |
53 | 53 |
54 // static | 54 // static |
55 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, | 55 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, |
56 const WebPreferences& preferences, | 56 const WebPreferences& preferences, |
57 const std::string& html_data, | 57 const std::string& html_data, |
58 const GURL& url) { | 58 const GURL& url) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 void WebViewPlugin::didClearWindowObject(WebFrame* frame, int world_id) { | 231 void WebViewPlugin::didClearWindowObject(WebFrame* frame, int world_id) { |
232 if (delegate_) | 232 if (delegate_) |
233 delegate_->BindWebFrame(frame); | 233 delegate_->BindWebFrame(frame); |
234 } | 234 } |
235 | 235 |
236 void WebViewPlugin::didReceiveResponse(WebFrame* frame, | 236 void WebViewPlugin::didReceiveResponse(WebFrame* frame, |
237 unsigned identifier, | 237 unsigned identifier, |
238 const WebURLResponse& response) { | 238 const WebURLResponse& response) { |
239 WebFrameClient::didReceiveResponse(frame, identifier, response); | 239 WebFrameClient::didReceiveResponse(frame, identifier, response); |
240 } | 240 } |
OLD | NEW |