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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |