Chromium Code Reviews| 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 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1120 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { | 1120 void Widget::OnNativeWidgetSizeChanged(const gfx::Size& new_size) { |
| 1121 View* root = GetRootView(); | 1121 View* root = GetRootView(); |
| 1122 if (root) { | 1122 if (root) { |
| 1123 root->SetSize(new_size); | 1123 root->SetSize(new_size); |
| 1124 if (root->GetFocusManager()) { | 1124 if (root->GetFocusManager()) { |
| 1125 View* focused_view = GetRootView()->GetFocusManager()->GetFocusedView(); | 1125 View* focused_view = GetRootView()->GetFocusManager()->GetFocusedView(); |
| 1126 if (focused_view && focused_view->GetInputMethod()) | 1126 if (focused_view && focused_view->GetInputMethod()) |
| 1127 focused_view->GetInputMethod()->OnCaretBoundsChanged(focused_view); | 1127 focused_view->GetInputMethod()->OnCaretBoundsChanged(focused_view); |
| 1128 } | 1128 } |
| 1129 } | 1129 } |
| 1130 // Size changed notifications can fire prior to full initialization | 1130 // Size changed notifications can fire prior to full initialization |
|
sky
2014/08/11 16:09:19
Make your new code and this call into a SaveWindow
jackhou1
2014/08/12 05:23:44
Done.
| |
| 1131 // i.e. during session restore. Avoid saving session state during these | 1131 // i.e. during session restore. Avoid saving session state during these |
| 1132 // startup procedures. | 1132 // startup procedures. |
| 1133 if (native_widget_initialized_) | 1133 if (native_widget_initialized_) |
| 1134 SaveWindowPlacement(); | 1134 SaveWindowPlacement(); |
| 1135 | 1135 |
| 1136 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( | 1136 FOR_EACH_OBSERVER(WidgetObserver, observers_, OnWidgetBoundsChanged( |
| 1137 this, | 1137 this, |
| 1138 GetWindowBoundsInScreen())); | 1138 GetWindowBoundsInScreen())); |
| 1139 } | 1139 } |
| 1140 | 1140 |
| 1141 void Widget::OnNativeWidgetWindowShowStateChanged() { | |
| 1142 // Size changed notifications can fire prior to full initialization | |
| 1143 // i.e. during session restore. Avoid saving session state during these | |
| 1144 // startup procedures. | |
| 1145 if (native_widget_initialized_) | |
| 1146 SaveWindowPlacement(); | |
| 1147 } | |
| 1148 | |
| 1141 void Widget::OnNativeWidgetBeginUserBoundsChange() { | 1149 void Widget::OnNativeWidgetBeginUserBoundsChange() { |
| 1142 widget_delegate_->OnWindowBeginUserBoundsChange(); | 1150 widget_delegate_->OnWindowBeginUserBoundsChange(); |
| 1143 } | 1151 } |
| 1144 | 1152 |
| 1145 void Widget::OnNativeWidgetEndUserBoundsChange() { | 1153 void Widget::OnNativeWidgetEndUserBoundsChange() { |
| 1146 widget_delegate_->OnWindowEndUserBoundsChange(); | 1154 widget_delegate_->OnWindowEndUserBoundsChange(); |
| 1147 } | 1155 } |
| 1148 | 1156 |
| 1149 bool Widget::HasFocusManager() const { | 1157 bool Widget::HasFocusManager() const { |
| 1150 return !!focus_manager_.get(); | 1158 return !!focus_manager_.get(); |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1511 | 1519 |
| 1512 //////////////////////////////////////////////////////////////////////////////// | 1520 //////////////////////////////////////////////////////////////////////////////// |
| 1513 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1521 // internal::NativeWidgetPrivate, NativeWidget implementation: |
| 1514 | 1522 |
| 1515 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1523 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
| 1516 return this; | 1524 return this; |
| 1517 } | 1525 } |
| 1518 | 1526 |
| 1519 } // namespace internal | 1527 } // namespace internal |
| 1520 } // namespace views | 1528 } // namespace views |
| OLD | NEW |