| 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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 } else { | 1308 } else { |
| 1309 SetWindowRectSynchronously(window_rect); | 1309 SetWindowRectSynchronously(window_rect); |
| 1310 } | 1310 } |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 void RenderWidget::SetPendingWindowRect(const WebRect& rect) { | 1313 void RenderWidget::SetPendingWindowRect(const WebRect& rect) { |
| 1314 pending_window_rect_ = rect; | 1314 pending_window_rect_ = rect; |
| 1315 pending_window_rect_count_++; | 1315 pending_window_rect_count_++; |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 WebRect RenderWidget::rootWindowRect() { | 1318 gfx::Rect RenderWidget::RootWindowRect() { |
| 1319 if (pending_window_rect_count_) { | 1319 if (pending_window_rect_count_) { |
| 1320 // NOTE(mbelshe): If there is a pending_window_rect_, then getting | 1320 // NOTE(mbelshe): If there is a pending_window_rect_, then getting |
| 1321 // the RootWindowRect is probably going to return wrong results since the | 1321 // the RootWindowRect is probably going to return wrong results since the |
| 1322 // browser may not have processed the Move yet. There isn't really anything | 1322 // browser may not have processed the Move yet. There isn't really anything |
| 1323 // good to do in this case, and it shouldn't happen - since this size is | 1323 // good to do in this case, and it shouldn't happen - since this size is |
| 1324 // only really needed for windowToScreen, which is only used for Popups. | 1324 // only really needed for windowToScreen, which is only used for Popups. |
| 1325 return pending_window_rect_; | 1325 return pending_window_rect_; |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 return window_screen_rect_; | 1328 return window_screen_rect_; |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 } | 1710 } |
| 1711 | 1711 |
| 1712 void RenderWidget::DidAutoResize(const gfx::Size& new_size) { | 1712 void RenderWidget::DidAutoResize(const gfx::Size& new_size) { |
| 1713 WebRect new_size_in_window(0, 0, new_size.width(), new_size.height()); | 1713 WebRect new_size_in_window(0, 0, new_size.width(), new_size.height()); |
| 1714 convertViewportToWindow(&new_size_in_window); | 1714 convertViewportToWindow(&new_size_in_window); |
| 1715 if (size_.width() != new_size_in_window.width || | 1715 if (size_.width() != new_size_in_window.width || |
| 1716 size_.height() != new_size_in_window.height) { | 1716 size_.height() != new_size_in_window.height) { |
| 1717 size_ = gfx::Size(new_size_in_window.width, new_size_in_window.height); | 1717 size_ = gfx::Size(new_size_in_window.width, new_size_in_window.height); |
| 1718 | 1718 |
| 1719 if (resizing_mode_selector_->is_synchronous_mode()) { | 1719 if (resizing_mode_selector_->is_synchronous_mode()) { |
| 1720 gfx::Rect new_pos(rootWindowRect().x, rootWindowRect().y, size_.width(), | 1720 gfx::Rect new_pos(RootWindowRect().x(), RootWindowRect().y(), |
| 1721 size_.height()); | 1721 size_.width(), size_.height()); |
| 1722 view_screen_rect_ = new_pos; | 1722 view_screen_rect_ = new_pos; |
| 1723 window_screen_rect_ = new_pos; | 1723 window_screen_rect_ = new_pos; |
| 1724 } | 1724 } |
| 1725 | 1725 |
| 1726 AutoResizeCompositor(); | 1726 AutoResizeCompositor(); |
| 1727 | 1727 |
| 1728 if (!resizing_mode_selector_->is_synchronous_mode()) | 1728 if (!resizing_mode_selector_->is_synchronous_mode()) |
| 1729 need_update_rect_for_auto_resize_ = true; | 1729 need_update_rect_for_auto_resize_ = true; |
| 1730 } | 1730 } |
| 1731 } | 1731 } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1977 void RenderWidget::requestPointerUnlock() { | 1977 void RenderWidget::requestPointerUnlock() { |
| 1978 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 1978 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
| 1979 } | 1979 } |
| 1980 | 1980 |
| 1981 bool RenderWidget::isPointerLocked() { | 1981 bool RenderWidget::isPointerLocked() { |
| 1982 return mouse_lock_dispatcher_->IsMouseLockedTo( | 1982 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 1983 webwidget_mouse_lock_target_.get()); | 1983 webwidget_mouse_lock_target_.get()); |
| 1984 } | 1984 } |
| 1985 | 1985 |
| 1986 } // namespace content | 1986 } // namespace content |
| OLD | NEW |