| 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/widget.h" | 5 #include "ui/views/widget/widget.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "ui/base/events/event.h" | 10 #include "ui/base/events/event.h" |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 gfx::Size Widget::GetMinimumSize() { | 1010 gfx::Size Widget::GetMinimumSize() { |
| 1011 return non_client_view_ ? non_client_view_->GetMinimumSize() : gfx::Size(); | 1011 return non_client_view_ ? non_client_view_->GetMinimumSize() : gfx::Size(); |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 gfx::Size Widget::GetMaximumSize() { | 1014 gfx::Size Widget::GetMaximumSize() { |
| 1015 return non_client_view_ ? non_client_view_->GetMaximumSize() : gfx::Size(); | 1015 return non_client_view_ ? non_client_view_->GetMaximumSize() : gfx::Size(); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 void Widget::OnNativeWidgetMove() { | 1018 void Widget::OnNativeWidgetMove() { |
| 1019 widget_delegate_->OnWidgetMove(); | 1019 widget_delegate_->OnWidgetMove(); |
| 1020 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | 1020 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetMoved(this)); |
| 1021 this, | |
| 1022 GetWindowBoundsInScreen())); | |
| 1023 } | 1021 } |
| 1024 | 1022 |
| 1025 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { | 1023 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { |
| 1026 root_view_->SetSize(new_size); | 1024 root_view_->SetSize(new_size); |
| 1027 | 1025 |
| 1028 // Size changed notifications can fire prior to full initialization | 1026 // Size changed notifications can fire prior to full initialization |
| 1029 // i.e. during session restore. Avoid saving session state during these | 1027 // i.e. during session restore. Avoid saving session state during these |
| 1030 // startup procedures. | 1028 // startup procedures. |
| 1031 if (native_widget_initialized_) | 1029 if (native_widget_initialized_) |
| 1032 SaveWindowPlacement(); | 1030 SaveWindowPlacement(); |
| 1033 | |
| 1034 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | |
| 1035 this, | |
| 1036 GetWindowBoundsInScreen())); | |
| 1037 } | 1031 } |
| 1038 | 1032 |
| 1039 void Widget::OnNativeWidgetBeginUserBoundsChange() { | 1033 void Widget::OnNativeWidgetBeginUserBoundsChange() { |
| 1040 widget_delegate_->OnWindowBeginUserBoundsChange(); | 1034 widget_delegate_->OnWindowBeginUserBoundsChange(); |
| 1041 } | 1035 } |
| 1042 | 1036 |
| 1043 void Widget::OnNativeWidgetEndUserBoundsChange() { | 1037 void Widget::OnNativeWidgetEndUserBoundsChange() { |
| 1044 widget_delegate_->OnWindowEndUserBoundsChange(); | 1038 widget_delegate_->OnWindowEndUserBoundsChange(); |
| 1045 } | 1039 } |
| 1046 | 1040 |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1372 | 1366 |
| 1373 //////////////////////////////////////////////////////////////////////////////// | 1367 //////////////////////////////////////////////////////////////////////////////// |
| 1374 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1368 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1375 | 1369 |
| 1376 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1370 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1377 return this; | 1371 return this; |
| 1378 } | 1372 } |
| 1379 | 1373 |
| 1380 } // namespace internal | 1374 } // namespace internal |
| 1381 } // namespace views | 1375 } // namespace views |
| OLD | NEW |