OLD | NEW |
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/widget/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 gfx::Size NativeWidgetAura::GetMinimumSize() const { | 706 gfx::Size NativeWidgetAura::GetMinimumSize() const { |
707 return delegate_->GetMinimumSize(); | 707 return delegate_->GetMinimumSize(); |
708 } | 708 } |
709 | 709 |
710 gfx::Size NativeWidgetAura::GetMaximumSize() const { | 710 gfx::Size NativeWidgetAura::GetMaximumSize() const { |
711 return delegate_->GetMaximumSize(); | 711 return delegate_->GetMaximumSize(); |
712 } | 712 } |
713 | 713 |
714 void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds, | 714 void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds, |
715 const gfx::Rect& new_bounds) { | 715 const gfx::Rect& new_bounds) { |
716 if (old_bounds.origin() != new_bounds.origin()) | 716 // Assume that if the old bounds was completely empty a move happened. This |
| 717 // handles the case of a maximize animation acquiring the layer (acquiring a |
| 718 // layer results in clearing the bounds). |
| 719 if (old_bounds.origin() != new_bounds.origin() || |
| 720 (old_bounds == gfx::Rect(0, 0, 0, 0) && !new_bounds.IsEmpty())) { |
717 delegate_->OnNativeWidgetMove(); | 721 delegate_->OnNativeWidgetMove(); |
| 722 } |
718 if (old_bounds.size() != new_bounds.size()) | 723 if (old_bounds.size() != new_bounds.size()) |
719 delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); | 724 delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); |
720 } | 725 } |
721 | 726 |
722 gfx::NativeCursor NativeWidgetAura::GetCursor(const gfx::Point& point) { | 727 gfx::NativeCursor NativeWidgetAura::GetCursor(const gfx::Point& point) { |
723 return cursor_; | 728 return cursor_; |
724 } | 729 } |
725 | 730 |
726 int NativeWidgetAura::GetNonClientComponent(const gfx::Point& point) const { | 731 int NativeWidgetAura::GetNonClientComponent(const gfx::Point& point) const { |
727 return delegate_->GetNonClientComponent(point); | 732 return delegate_->GetNonClientComponent(point); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 return aura::Env::GetInstance()->IsMouseButtonDown(); | 1143 return aura::Env::GetInstance()->IsMouseButtonDown(); |
1139 } | 1144 } |
1140 | 1145 |
1141 // static | 1146 // static |
1142 bool NativeWidgetPrivate::IsTouchDown() { | 1147 bool NativeWidgetPrivate::IsTouchDown() { |
1143 return aura::Env::GetInstance()->is_touch_down(); | 1148 return aura::Env::GetInstance()->is_touch_down(); |
1144 } | 1149 } |
1145 | 1150 |
1146 } // namespace internal | 1151 } // namespace internal |
1147 } // namespace views | 1152 } // namespace views |
OLD | NEW |