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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 gfx::Size Widget::GetMinimumSize() { | 1083 gfx::Size Widget::GetMinimumSize() { |
1084 return non_client_view_ ? non_client_view_->GetMinimumSize() : gfx::Size(); | 1084 return non_client_view_ ? non_client_view_->GetMinimumSize() : gfx::Size(); |
1085 } | 1085 } |
1086 | 1086 |
1087 gfx::Size Widget::GetMaximumSize() { | 1087 gfx::Size Widget::GetMaximumSize() { |
1088 return non_client_view_ ? non_client_view_->GetMaximumSize() : gfx::Size(); | 1088 return non_client_view_ ? non_client_view_->GetMaximumSize() : gfx::Size(); |
1089 } | 1089 } |
1090 | 1090 |
1091 void Widget::OnNativeWidgetMove() { | 1091 void Widget::OnNativeWidgetMove() { |
1092 widget_delegate_->OnWidgetMove(); | 1092 widget_delegate_->OnWidgetMove(); |
| 1093 if (GetRootView()->GetFocusManager()) { |
| 1094 View* focused_view = GetRootView()->GetFocusManager()->GetFocusedView(); |
| 1095 if (focused_view && focused_view->GetInputMethod()) |
| 1096 focused_view->GetInputMethod()->OnCaretBoundsChanged(focused_view); |
| 1097 } |
1093 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | 1098 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
1094 this, | 1099 this, |
1095 GetWindowBoundsInScreen())); | 1100 GetWindowBoundsInScreen())); |
1096 } | 1101 } |
1097 | 1102 |
1098 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { | 1103 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { |
1099 root_view_->SetSize(new_size); | 1104 root_view_->SetSize(new_size); |
1100 | 1105 |
| 1106 if (GetRootView()->GetFocusManager()) { |
| 1107 View* focused_view = GetRootView()->GetFocusManager()->GetFocusedView(); |
| 1108 if (focused_view && focused_view->GetInputMethod()) |
| 1109 focused_view->GetInputMethod()->OnCaretBoundsChanged(focused_view); |
| 1110 } |
| 1111 |
1101 // Size changed notifications can fire prior to full initialization | 1112 // Size changed notifications can fire prior to full initialization |
1102 // i.e. during session restore. Avoid saving session state during these | 1113 // i.e. during session restore. Avoid saving session state during these |
1103 // startup procedures. | 1114 // startup procedures. |
1104 if (native_widget_initialized_) | 1115 if (native_widget_initialized_) |
1105 SaveWindowPlacement(); | 1116 SaveWindowPlacement(); |
1106 | 1117 |
1107 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | 1118 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
1108 this, | 1119 this, |
1109 GetWindowBoundsInScreen())); | 1120 GetWindowBoundsInScreen())); |
1110 } | 1121 } |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 | 1484 |
1474 //////////////////////////////////////////////////////////////////////////////// | 1485 //////////////////////////////////////////////////////////////////////////////// |
1475 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1486 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1476 | 1487 |
1477 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1488 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1478 return this; | 1489 return this; |
1479 } | 1490 } |
1480 | 1491 |
1481 } // namespace internal | 1492 } // namespace internal |
1482 } // namespace views | 1493 } // namespace views |
OLD | NEW |