| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 WebViewPlugin::WebViewHelper::WebViewHelper( | 248 WebViewPlugin::WebViewHelper::WebViewHelper( |
| 249 WebViewPlugin* plugin, | 249 WebViewPlugin* plugin, |
| 250 const WebPreferences& preferences) : plugin_(plugin) { | 250 const WebPreferences& preferences) : plugin_(plugin) { |
| 251 web_view_ = | 251 web_view_ = |
| 252 WebView::create(this, blink::WebPageVisibilityStateVisible); | 252 WebView::create(this, blink::WebPageVisibilityStateVisible); |
| 253 // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a | 253 // ApplyWebPreferences before making a WebLocalFrame so that the frame sees a |
| 254 // consistent view of our preferences. | 254 // consistent view of our preferences. |
| 255 content::RenderView::ApplyWebPreferences(preferences, web_view_); | 255 content::RenderView::ApplyWebPreferences(preferences, web_view_); |
| 256 WebLocalFrame* web_frame = WebLocalFrame::create( | 256 WebLocalFrame* web_frame = WebLocalFrame::create( |
| 257 blink::WebTreeScopeType::Document, this); | 257 blink::WebTreeScopeType::Document, this, nullptr, nullptr); |
| 258 web_view_->setMainFrame(web_frame); | 258 web_view_->setMainFrame(web_frame); |
| 259 // TODO(dcheng): The main frame widget currently has a special case. | 259 // TODO(dcheng): The main frame widget currently has a special case. |
| 260 // Eliminate this once WebView is no longer a WebWidget. | 260 // Eliminate this once WebView is no longer a WebWidget. |
| 261 WebFrameWidget::create(this, web_view_, web_frame); | 261 WebFrameWidget::create(this, web_view_, web_frame); |
| 262 } | 262 } |
| 263 | 263 |
| 264 WebViewPlugin::WebViewHelper::~WebViewHelper() { | 264 WebViewPlugin::WebViewHelper::~WebViewHelper() { |
| 265 web_view_->close(); | 265 web_view_->close(); |
| 266 } | 266 } |
| 267 | 267 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 if (!delegate_) | 346 if (!delegate_) |
| 347 return; | 347 return; |
| 348 | 348 |
| 349 // The delegate may instantiate a new plugin. | 349 // The delegate may instantiate a new plugin. |
| 350 delegate_->OnUnobscuredRectUpdate(gfx::Rect(unobscured_rect)); | 350 delegate_->OnUnobscuredRectUpdate(gfx::Rect(unobscured_rect)); |
| 351 // The delegate may have dirtied style and layout of the WebView. | 351 // The delegate may have dirtied style and layout of the WebView. |
| 352 // See for example the resizePoster function in plugin_poster.html. | 352 // See for example the resizePoster function in plugin_poster.html. |
| 353 // Run the lifecycle now so that it is clean. | 353 // Run the lifecycle now so that it is clean. |
| 354 web_view()->updateAllLifecyclePhases(); | 354 web_view()->updateAllLifecyclePhases(); |
| 355 } | 355 } |
| OLD | NEW |