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

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: Cleanup 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
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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 multi_animation->set_continuous(false); 429 multi_animation->set_continuous(false);
430 return multi_animation; 430 return multi_animation;
431 } 431 }
432 432
433 Desktop* Window::GetDesktop() { 433 Desktop* Window::GetDesktop() {
434 return parent_ ? parent_->GetDesktop() : NULL; 434 return parent_ ? parent_->GetDesktop() : NULL;
435 } 435 }
436 436
437 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { 437 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) {
438 const gfx::Rect old_bounds = bounds(); 438 const gfx::Rect old_bounds = bounds();
439 if (old_bounds == new_bounds)
440 return;
441
439 bool was_move = old_bounds.size() == new_bounds.size(); 442 bool was_move = old_bounds.size() == new_bounds.size();
440 layer_->SetBounds(new_bounds); 443 layer_->SetBounds(new_bounds);
441 444
442 if (layout_manager_.get()) 445 if (layout_manager_.get())
443 layout_manager_->OnWindowResized(); 446 layout_manager_->OnWindowResized();
444 if (delegate_) 447 if (delegate_)
445 delegate_->OnBoundsChanged(old_bounds, new_bounds); 448 delegate_->OnBoundsChanged(old_bounds, new_bounds);
446 if (IsVisible()) { 449 if (IsVisible()) {
447 if (was_move) 450 if (was_move)
448 layer()->ScheduleDraw(); 451 layer()->ScheduleDraw();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 } 525 }
523 526
524 void Window::OnPaintLayer(gfx::Canvas* canvas) { 527 void Window::OnPaintLayer(gfx::Canvas* canvas) {
525 delegate_->OnPaint(canvas); 528 delegate_->OnPaint(canvas);
526 } 529 }
527 530
528 void Window::OnLayerAnimationEnded(const ui::Animation* animation) { 531 void Window::OnLayerAnimationEnded(const ui::Animation* animation) {
529 } 532 }
530 533
531 } // namespace aura 534 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698