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_, OnWidgetMoved(this)); | 1020 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
| 1021 this, |
| 1022 GetWindowBoundsInScreen())); |
1021 } | 1023 } |
1022 | 1024 |
1023 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { | 1025 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { |
1024 root_view_->SetSize(new_size); | 1026 root_view_->SetSize(new_size); |
1025 | 1027 |
1026 // Size changed notifications can fire prior to full initialization | 1028 // Size changed notifications can fire prior to full initialization |
1027 // i.e. during session restore. Avoid saving session state during these | 1029 // i.e. during session restore. Avoid saving session state during these |
1028 // startup procedures. | 1030 // startup procedures. |
1029 if (native_widget_initialized_) | 1031 if (native_widget_initialized_) |
1030 SaveWindowPlacement(); | 1032 SaveWindowPlacement(); |
| 1033 |
| 1034 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
| 1035 this, |
| 1036 GetWindowBoundsInScreen())); |
1031 } | 1037 } |
1032 | 1038 |
1033 void Widget::OnNativeWidgetBeginUserBoundsChange() { | 1039 void Widget::OnNativeWidgetBeginUserBoundsChange() { |
1034 widget_delegate_->OnWindowBeginUserBoundsChange(); | 1040 widget_delegate_->OnWindowBeginUserBoundsChange(); |
1035 } | 1041 } |
1036 | 1042 |
1037 void Widget::OnNativeWidgetEndUserBoundsChange() { | 1043 void Widget::OnNativeWidgetEndUserBoundsChange() { |
1038 widget_delegate_->OnWindowEndUserBoundsChange(); | 1044 widget_delegate_->OnWindowEndUserBoundsChange(); |
1039 } | 1045 } |
1040 | 1046 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 | 1372 |
1367 //////////////////////////////////////////////////////////////////////////////// | 1373 //////////////////////////////////////////////////////////////////////////////// |
1368 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1374 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1369 | 1375 |
1370 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1376 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1371 return this; | 1377 return this; |
1372 } | 1378 } |
1373 | 1379 |
1374 } // namespace internal | 1380 } // namespace internal |
1375 } // namespace views | 1381 } // namespace views |
OLD | NEW |