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

Unified Diff: views/widget/native_widget_views.cc

Issue 8524020: Fix sad tab in native_widget_views (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes as requested Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_views.cc
diff --git a/views/widget/native_widget_views.cc b/views/widget/native_widget_views.cc
index dfeda464575c8795bf2daca44153eed8941a6a9b..7fd2933826941b652eac131093ff2bf30f956ba6 100644
--- a/views/widget/native_widget_views.cc
+++ b/views/widget/native_widget_views.cc
@@ -153,8 +153,8 @@ void NativeWidgetViews::InitNativeWidget(const Widget::InitParams& params) {
parent_view = widget->GetChildViewParent();
}
- gfx::Rect bounds = AdjustRectOriginForParentWidget(params.bounds,
- parent_);
+ gfx::Rect bounds = GetWidget()->is_top_level() ?
+ AdjustRectOriginForParentWidget(params.bounds, parent_) : params.bounds;
view_ = new internal::NativeWidgetView(this);
view_->SetBoundsRect(bounds);
view_->SetVisible(params.type == Widget::InitParams::TYPE_CONTROL);
@@ -352,7 +352,10 @@ gfx::Rect NativeWidgetViews::GetRestoredBounds() const {
void NativeWidgetViews::SetBounds(const gfx::Rect& bounds) {
// |bounds| are supplied in the coordinates of the parent.
- view_->SetBoundsRect(AdjustRectOriginForParentWidget(bounds, parent_));
+ if (GetWidget()->is_top_level())
+ view_->SetBoundsRect(AdjustRectOriginForParentWidget(bounds, parent_));
+ else
+ view_->SetBoundsRect(bounds);
}
void NativeWidgetViews::SetSize(const gfx::Size& size) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698