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/desktop_aura/desktop_native_widget_aura.h" | 5 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 } | 143 } |
| 144 delete this; | 144 delete this; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void OnWindowBoundsChanged(aura::Window* window, | 147 void OnWindowBoundsChanged(aura::Window* window, |
| 148 const gfx::Rect& old_bounds, | 148 const gfx::Rect& old_bounds, |
| 149 const gfx::Rect& new_bounds) override { | 149 const gfx::Rect& new_bounds) override { |
| 150 // The position of the window may have changed. Hence we use SetBounds in | 150 // The position of the window may have changed. Hence we use SetBounds in |
| 151 // place of SetSize. We need to pass the bounds in screen coordinates to | 151 // place of SetSize. We need to pass the bounds in screen coordinates to |
| 152 // the Widget::SetBounds function. | 152 // the Widget::SetBounds function. |
| 153 if (top_level_widget_ && window == child_window_) | 153 if (top_level_widget_ && window == child_window_) { |
| 154 top_level_widget_->SetBounds(window->GetBoundsInScreen()); | 154 top_level_widget_->SetBounds(window->GetBoundsInScreen()); |
|
ananta
2016/08/09 21:24:07
The Widget::SetBounds should make it all the way t
bokan
2016/08/11 17:04:08
The aura::Window *is* resized, the problem is that
bokan
2016/08/11 18:14:24
Stepping through on Win, we do get through to HWND
| |
| 155 | |
| 156 // The window's position is relative to the widget. If the widget | |
| 157 // position changed from the call above then it'll be "double applied". | |
| 158 // We clear the origin here to allow the widget to position the window. | |
| 159 window->SetBounds(gfx::Rect(gfx::Point(), window->bounds().size())); | |
|
sky
2016/08/15 15:05:48
I'm nervous about changing the bounds of the same
bokan
2016/08/18 22:51:06
Thanks, I'll give that a try. Any advice on where
bokan
2016/08/19 17:57:46
I don't think this'll work since the flow through
| |
| 160 } | |
| 155 } | 161 } |
| 156 | 162 |
| 157 private: | 163 private: |
| 158 DesktopNativeWidgetTopLevelHandler() | 164 DesktopNativeWidgetTopLevelHandler() |
| 159 : top_level_widget_(NULL), | 165 : top_level_widget_(NULL), |
| 160 child_window_(NULL) {} | 166 child_window_(NULL) {} |
| 161 | 167 |
| 162 ~DesktopNativeWidgetTopLevelHandler() override {} | 168 ~DesktopNativeWidgetTopLevelHandler() override {} |
| 163 | 169 |
| 164 Widget* top_level_widget_; | 170 Widget* top_level_widget_; |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1196 if (cursor_reference_count_ == 0) { | 1202 if (cursor_reference_count_ == 0) { |
| 1197 // We are the last DesktopNativeWidgetAura instance, and we are responsible | 1203 // We are the last DesktopNativeWidgetAura instance, and we are responsible |
| 1198 // for cleaning up |cursor_manager_|. | 1204 // for cleaning up |cursor_manager_|. |
| 1199 delete cursor_manager_; | 1205 delete cursor_manager_; |
| 1200 native_cursor_manager_ = NULL; | 1206 native_cursor_manager_ = NULL; |
| 1201 cursor_manager_ = NULL; | 1207 cursor_manager_ = NULL; |
| 1202 } | 1208 } |
| 1203 } | 1209 } |
| 1204 | 1210 |
| 1205 } // namespace views | 1211 } // namespace views |
| OLD | NEW |