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/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/string_util.h" | 8 #include "base/string_util.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/drag_drop_client.h" | 10 #include "ui/aura/client/drag_drop_client.h" |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 void NativeWidgetAura::DispatchKeyEventPostIME(const KeyEvent& key) { | 531 void NativeWidgetAura::DispatchKeyEventPostIME(const KeyEvent& key) { |
532 if (delegate_->OnKeyEvent(key)) | 532 if (delegate_->OnKeyEvent(key)) |
533 return; | 533 return; |
534 if (key.type() == ui::ET_KEY_PRESSED && GetWidget()->GetFocusManager()) | 534 if (key.type() == ui::ET_KEY_PRESSED && GetWidget()->GetFocusManager()) |
535 GetWidget()->GetFocusManager()->OnKeyEvent(key); | 535 GetWidget()->GetFocusManager()->OnKeyEvent(key); |
536 } | 536 } |
537 | 537 |
538 //////////////////////////////////////////////////////////////////////////////// | 538 //////////////////////////////////////////////////////////////////////////////// |
539 // NativeWidgetAura, aura::WindowDelegate implementation: | 539 // NativeWidgetAura, aura::WindowDelegate implementation: |
540 | 540 |
541 void NativeWidgetAura::OnBoundsChanging(gfx::Rect* new_bounds) { | 541 gfx::Size NativeWidgetAura::GetMinimumSize() const { |
542 // Enforces a minimum size. | 542 return delegate_->GetMinimumSize(); |
543 const gfx::Size& min_size = delegate_->GetMinimumSize(); | |
544 new_bounds->set_width(std::max(min_size.width(), new_bounds->width())); | |
545 new_bounds->set_height(std::max(min_size.height(), new_bounds->height())); | |
546 } | 543 } |
547 | 544 |
548 void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds, | 545 void NativeWidgetAura::OnBoundsChanged(const gfx::Rect& old_bounds, |
549 const gfx::Rect& new_bounds) { | 546 const gfx::Rect& new_bounds) { |
550 if (old_bounds.origin() != new_bounds.origin()) | 547 if (old_bounds.origin() != new_bounds.origin()) |
551 GetWidget()->widget_delegate()->OnWidgetMove(); | 548 GetWidget()->widget_delegate()->OnWidgetMove(); |
552 if (old_bounds.size() != new_bounds.size()) | 549 if (old_bounds.size() != new_bounds.size()) |
553 delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); | 550 delegate_->OnNativeWidgetSizeChanged(new_bounds.size()); |
554 } | 551 } |
555 | 552 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 NOTIMPLEMENTED(); | 776 NOTIMPLEMENTED(); |
780 } | 777 } |
781 | 778 |
782 // static | 779 // static |
783 bool NativeWidgetPrivate::IsMouseButtonDown() { | 780 bool NativeWidgetPrivate::IsMouseButtonDown() { |
784 return aura::Desktop::GetInstance()->IsMouseButtonDown(); | 781 return aura::Desktop::GetInstance()->IsMouseButtonDown(); |
785 } | 782 } |
786 | 783 |
787 } // namespace internal | 784 } // namespace internal |
788 } // namespace views | 785 } // namespace views |
OLD | NEW |