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

Side by Side Diff: ui/aura/window.cc

Issue 8340014: Minimize resize calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resolve review issue 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/tab_contents/tab_contents_container.cc ('k') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 void* Window::GetProperty(const char* name) const { 435 void* Window::GetProperty(const char* name) const {
436 return ui::ViewProp::GetValue(const_cast<gfx::NativeView>(this), name); 436 return ui::ViewProp::GetValue(const_cast<gfx::NativeView>(this), name);
437 } 437 }
438 438
439 Desktop* Window::GetDesktop() { 439 Desktop* Window::GetDesktop() {
440 return parent_ ? parent_->GetDesktop() : NULL; 440 return parent_ ? parent_->GetDesktop() : NULL;
441 } 441 }
442 442
443 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { 443 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) {
444 const gfx::Rect old_bounds = bounds(); 444 const gfx::Rect old_bounds = bounds();
445 if (old_bounds == new_bounds)
446 return;
447
445 bool was_move = old_bounds.size() == new_bounds.size(); 448 bool was_move = old_bounds.size() == new_bounds.size();
446 layer_->SetBounds(new_bounds); 449 layer_->SetBounds(new_bounds);
447 450
448 if (layout_manager_.get()) 451 if (layout_manager_.get())
449 layout_manager_->OnWindowResized(); 452 layout_manager_->OnWindowResized();
450 if (delegate_) 453 if (delegate_)
451 delegate_->OnBoundsChanged(old_bounds, new_bounds); 454 delegate_->OnBoundsChanged(old_bounds, new_bounds);
452 if (IsVisible()) { 455 if (IsVisible()) {
453 if (was_move) 456 if (was_move)
454 layer()->ScheduleDraw(); 457 layer()->ScheduleDraw();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 532
530 void Window::OnPaintLayer(gfx::Canvas* canvas) { 533 void Window::OnPaintLayer(gfx::Canvas* canvas) {
531 delegate_->OnPaint(canvas); 534 delegate_->OnPaint(canvas);
532 } 535 }
533 536
534 void Window::OnLayerAnimationEnded( 537 void Window::OnLayerAnimationEnded(
535 const ui::LayerAnimationSequence* animation) { 538 const ui::LayerAnimationSequence* animation) {
536 } 539 }
537 540
538 } // namespace aura 541 } // namespace aura
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_contents/tab_contents_container.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698