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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 using blink::WebVector; | 49 using blink::WebVector; |
50 using blink::WebView; | 50 using blink::WebView; |
51 using content::WebPreferences; | 51 using content::WebPreferences; |
52 | 52 |
53 WebViewPlugin::WebViewPlugin(content::RenderView* render_view, | 53 WebViewPlugin::WebViewPlugin(content::RenderView* render_view, |
54 WebViewPlugin::Delegate* delegate, | 54 WebViewPlugin::Delegate* delegate, |
55 const WebPreferences& preferences) | 55 const WebPreferences& preferences) |
56 : content::RenderViewObserver(render_view), | 56 : content::RenderViewObserver(render_view), |
57 delegate_(delegate), | 57 delegate_(delegate), |
58 container_(nullptr), | 58 container_(nullptr), |
59 web_view_(WebView::create(this)), | 59 web_view_(WebView::create(this, blink::WebPageVisibilityStateVisible)), |
60 finished_loading_(false), | 60 finished_loading_(false), |
61 focused_(false), | 61 focused_(false), |
62 is_painting_(false), | 62 is_painting_(false), |
63 is_resizing_(false) { | 63 is_resizing_(false) { |
64 // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a | 64 // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a |
65 // consistent view of our preferences. | 65 // consistent view of our preferences. |
66 content::RenderView::ApplyWebPreferences(preferences, web_view_); | 66 content::RenderView::ApplyWebPreferences(preferences, web_view_); |
67 WebLocalFrame* web_local_frame = | 67 WebLocalFrame* web_local_frame = |
68 WebLocalFrame::create(blink::WebTreeScopeType::Document, this); | 68 WebLocalFrame::create(blink::WebTreeScopeType::Document, this); |
69 web_frame_ = web_local_frame; | 69 web_frame_ = web_local_frame; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 | 340 |
341 void WebViewPlugin::OnDestruct() {} | 341 void WebViewPlugin::OnDestruct() {} |
342 | 342 |
343 void WebViewPlugin::OnZoomLevelChanged() { | 343 void WebViewPlugin::OnZoomLevelChanged() { |
344 if (container_) { | 344 if (container_) { |
345 web_view_->setZoomLevel( | 345 web_view_->setZoomLevel( |
346 blink::WebView::zoomFactorToZoomLevel(container_->pageZoomFactor())); | 346 blink::WebView::zoomFactorToZoomLevel(container_->pageZoomFactor())); |
347 } | 347 } |
348 } | 348 } |
OLD | NEW |