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

Side by Side Diff: ui/views/controls/native/native_view_host_aura.cc

Issue 422683007: Fix jank on resize followed by tab switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/native/native_view_host_aura.h" 5 #include "ui/views/controls/native/native_view_host_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/client/focus_client.h" 9 #include "ui/aura/client/focus_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 // static 193 // static
194 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( 194 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper(
195 NativeViewHost* host) { 195 NativeViewHost* host) {
196 return new NativeViewHostAura(host); 196 return new NativeViewHostAura(host);
197 } 197 }
198 198
199 void NativeViewHostAura::AddClippingWindow() { 199 void NativeViewHostAura::AddClippingWindow() {
200 RemoveClippingWindow(); 200 RemoveClippingWindow();
201 201
202 gfx::Rect bounds = host_->native_view()->bounds(); 202 gfx::Rect bounds = host_->GetVisibleBounds();
203 host_->native_view()->SetProperty(aura::client::kHostWindowKey, 203 host_->native_view()->SetProperty(aura::client::kHostWindowKey,
204 host_->GetWidget()->GetNativeView()); 204 host_->GetWidget()->GetNativeView());
205 Widget::ReparentNativeView(host_->native_view(), 205 Widget::ReparentNativeView(host_->native_view(),
206 &clipping_window_); 206 &clipping_window_);
207 if (host_->GetWidget()->GetNativeView()) { 207 if (host_->GetWidget()->GetNativeView()) {
208 Widget::ReparentNativeView(&clipping_window_, 208 Widget::ReparentNativeView(&clipping_window_,
209 host_->GetWidget()->GetNativeView()); 209 host_->GetWidget()->GetNativeView());
210 } 210 }
211 clipping_window_.SetBounds(bounds); 211 clipping_window_.SetBounds(bounds);
sky 2014/08/05 16:42:51 Is there a reason we need to set the bounds here?
212 bounds.set_origin(gfx::Point(0, 0)); 212 bounds.set_origin(gfx::Point(0, 0));
213 host_->native_view()->SetBounds(bounds); 213 host_->native_view()->SetBounds(bounds);
214 clipping_window_.Show(); 214 clipping_window_.Show();
215 } 215 }
216 216
217 void NativeViewHostAura::RemoveClippingWindow() { 217 void NativeViewHostAura::RemoveClippingWindow() {
218 clipping_window_.Hide(); 218 clipping_window_.Hide();
219 if (host_->native_view()) 219 if (host_->native_view())
220 host_->native_view()->ClearProperty(aura::client::kHostWindowKey); 220 host_->native_view()->ClearProperty(aura::client::kHostWindowKey);
221 221
222 if (host_->native_view()->parent() == &clipping_window_) { 222 if (host_->native_view()->parent() == &clipping_window_) {
223 if (host_->GetWidget() && host_->GetWidget()->GetNativeView()) { 223 if (host_->GetWidget() && host_->GetWidget()->GetNativeView()) {
224 Widget::ReparentNativeView(host_->native_view(), 224 Widget::ReparentNativeView(host_->native_view(),
225 host_->GetWidget()->GetNativeView()); 225 host_->GetWidget()->GetNativeView());
226 } else { 226 } else {
227 clipping_window_.RemoveChild(host_->native_view()); 227 clipping_window_.RemoveChild(host_->native_view());
228 } 228 }
229 host_->native_view()->SetBounds(clipping_window_.bounds()); 229 host_->native_view()->SetBounds(clipping_window_.bounds());
230 } 230 }
231 if (clipping_window_.parent()) 231 if (clipping_window_.parent())
232 clipping_window_.parent()->RemoveChild(&clipping_window_); 232 clipping_window_.parent()->RemoveChild(&clipping_window_);
233 } 233 }
234 234
235 } // namespace views 235 } // namespace views
OLDNEW
« 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