Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: ui/views/controls/native/native_view_host.cc

Issue 2654413002: Stretching NativeViewHost, and misc tab capture fixes.
Patch Set: Gettin' it all working on ui/cocoa and MacViews too. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/native/native_view_host.h ('k') | ui/views/controls/native/native_view_host_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « ui/views/controls/native/native_view_host.h ('k') | ui/views/controls/native/native_view_host_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698