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_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
10 #include "content/public/common/web_preferences.h" | 10 #include "content/public/common/web_preferences.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 using blink::WebView; | 43 using blink::WebView; |
44 using content::WebPreferences; | 44 using content::WebPreferences; |
45 | 45 |
46 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate, | 46 WebViewPlugin::WebViewPlugin(WebViewPlugin::Delegate* delegate, |
47 const WebPreferences& preferences) | 47 const WebPreferences& preferences) |
48 : delegate_(delegate), | 48 : delegate_(delegate), |
49 container_(NULL), | 49 container_(NULL), |
50 web_view_(WebView::create(this)), | 50 web_view_(WebView::create(this)), |
51 finished_loading_(false), | 51 finished_loading_(false), |
52 focused_(false) { | 52 focused_(false) { |
53 // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a | 53 // ApplyWebPreferencesInternal before making a WebLocalFrame so that the frame |
54 // consistent view of our preferences. | 54 // sees a consistent view of our preferences. |
55 content::RenderView::ApplyWebPreferences(preferences, web_view_); | 55 content::RenderView::ApplyWebPreferencesInternal(preferences, web_view_, |
| 56 NULL); |
56 web_frame_ = WebLocalFrame::create(blink::WebTreeScopeType::Document, this); | 57 web_frame_ = WebLocalFrame::create(blink::WebTreeScopeType::Document, this); |
57 web_view_->setMainFrame(web_frame_); | 58 web_view_->setMainFrame(web_frame_); |
58 } | 59 } |
59 | 60 |
60 // static | 61 // static |
61 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, | 62 WebViewPlugin* WebViewPlugin::Create(WebViewPlugin::Delegate* delegate, |
62 const WebPreferences& preferences, | 63 const WebPreferences& preferences, |
63 const std::string& html_data, | 64 const std::string& html_data, |
64 const GURL& url) { | 65 const GURL& url) { |
65 DCHECK(url.is_valid()) << "Blink requires the WebView to have a valid URL."; | 66 DCHECK(url.is_valid()) << "Blink requires the WebView to have a valid URL."; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 280 |
280 global->Set(gin::StringToV8(isolate, "plugin"), | 281 global->Set(gin::StringToV8(isolate, "plugin"), |
281 delegate_->GetV8Handle(isolate)); | 282 delegate_->GetV8Handle(isolate)); |
282 } | 283 } |
283 | 284 |
284 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, | 285 void WebViewPlugin::didReceiveResponse(WebLocalFrame* frame, |
285 unsigned identifier, | 286 unsigned identifier, |
286 const WebURLResponse& response) { | 287 const WebURLResponse& response) { |
287 WebFrameClient::didReceiveResponse(frame, identifier, response); | 288 WebFrameClient::didReceiveResponse(frame, identifier, response); |
288 } | 289 } |
OLD | NEW |