| Index: ui/views/controls/native/native_view_host.cc
|
| diff --git a/ui/views/controls/native/native_view_host.cc b/ui/views/controls/native/native_view_host.cc
|
| index 452e5966b48334f7843fb332dd765b0095aafec8..81cb94b480ca37abd57f70e97c60dfaf9ce2cc10 100644
|
| --- a/ui/views/controls/native/native_view_host.cc
|
| +++ b/ui/views/controls/native/native_view_host.cc
|
| @@ -51,6 +51,11 @@ void NativeViewHost::SetPreferredSize(const gfx::Size& size) {
|
| PreferredSizeChanged();
|
| }
|
|
|
| +void NativeViewHost::SetRenderingSize(const gfx::Size& size) {
|
| + rendering_size_ = size;
|
| + InvalidateLayout();
|
| +}
|
| +
|
| void NativeViewHost::NativeViewDestroyed() {
|
| // Detach so we can clear our state and notify the native_wrapper_ to release
|
| // ref on the native view.
|
| @@ -92,9 +97,11 @@ void NativeViewHost::Layout() {
|
| // view. Also, they should be positioned respecting the border insets
|
| // of the native view.
|
| gfx::Rect local_bounds = ConvertRectToWidget(GetContentsBounds());
|
| - native_wrapper_->ShowWidget(local_bounds.x(), local_bounds.y(),
|
| - local_bounds.width(),
|
| - local_bounds.height());
|
| + gfx::Size rendering_size =
|
| + rendering_size_.IsEmpty() ? local_bounds.size() : rendering_size_;
|
| + native_wrapper_->ShowWidget(
|
| + local_bounds.x(), local_bounds.y(), local_bounds.width(),
|
| + local_bounds.height(), rendering_size.width(), rendering_size.height());
|
| } else {
|
| native_wrapper_->HideWidget();
|
| }
|
|
|