OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |