| 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 | 994 |
| 995 return size_; | 995 return size_; |
| 996 } | 996 } |
| 997 | 997 |
| 998 void RenderWidget::Resize(const ResizeParams& params) { | 998 void RenderWidget::Resize(const ResizeParams& params) { |
| 999 bool orientation_changed = | 999 bool orientation_changed = |
| 1000 screen_info_.orientationAngle != params.screen_info.orientationAngle || | 1000 screen_info_.orientationAngle != params.screen_info.orientationAngle || |
| 1001 screen_info_.orientationType != params.screen_info.orientationType; | 1001 screen_info_.orientationType != params.screen_info.orientationType; |
| 1002 | 1002 |
| 1003 screen_info_ = params.screen_info; | 1003 screen_info_ = params.screen_info; |
| 1004 SetDeviceScaleFactor(screen_info_.deviceScaleFactor); | 1004 |
| 1005 if (device_scale_factor_ != screen_info_.deviceScaleFactor) { |
| 1006 device_scale_factor_ = screen_info_.deviceScaleFactor; |
| 1007 OnDeviceScaleFactorChanged(); |
| 1008 ScheduleComposite(); |
| 1009 } |
| 1005 | 1010 |
| 1006 if (resizing_mode_selector_->NeverUsesSynchronousResize()) { | 1011 if (resizing_mode_selector_->NeverUsesSynchronousResize()) { |
| 1007 // A resize ack shouldn't be requested if we have not ACK'd the previous | 1012 // A resize ack shouldn't be requested if we have not ACK'd the previous |
| 1008 // one. | 1013 // one. |
| 1009 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); | 1014 DCHECK(!params.needs_resize_ack || !next_paint_is_resize_ack()); |
| 1010 } | 1015 } |
| 1011 | 1016 |
| 1012 // Ignore this during shutdown. | 1017 // Ignore this during shutdown. |
| 1013 if (!webwidget_) | 1018 if (!webwidget_) |
| 1014 return; | 1019 return; |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 for (size_t i = 0u; i < text_input_info_history_.size() - 1u; ++i) { | 1571 for (size_t i = 0u; i < text_input_info_history_.size() - 1u; ++i) { |
| 1567 if (text_input_info_history_[i] != text_input_info_) | 1572 if (text_input_info_history_[i] != text_input_info_) |
| 1568 return false; | 1573 return false; |
| 1569 } | 1574 } |
| 1570 return true; | 1575 return true; |
| 1571 #else | 1576 #else |
| 1572 return !!webwidget_; | 1577 return !!webwidget_; |
| 1573 #endif | 1578 #endif |
| 1574 } | 1579 } |
| 1575 | 1580 |
| 1576 void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { | 1581 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { |
| 1577 if (device_scale_factor_ == device_scale_factor) | 1582 if (device_scale_factor_ == device_scale_factor) |
| 1578 return; | 1583 return; |
| 1579 | 1584 |
| 1580 device_scale_factor_ = device_scale_factor; | 1585 device_scale_factor_ = device_scale_factor; |
| 1581 | 1586 |
| 1582 OnDeviceScaleFactorChanged(); | 1587 OnDeviceScaleFactorChanged(); |
| 1588 ScheduleComposite(); |
| 1583 | 1589 |
| 1584 ScheduleComposite(); | 1590 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); |
| 1585 } | 1591 } |
| 1586 | 1592 |
| 1587 bool RenderWidget::SetDeviceColorProfile( | 1593 bool RenderWidget::SetDeviceColorProfile( |
| 1588 const std::vector<char>& color_profile) { | 1594 const std::vector<char>& color_profile) { |
| 1589 if (device_color_profile_ == color_profile) | 1595 if (device_color_profile_ == color_profile) |
| 1590 return false; | 1596 return false; |
| 1591 | 1597 |
| 1592 device_color_profile_ = color_profile; | 1598 device_color_profile_ = color_profile; |
| 1593 | 1599 |
| 1594 if (owner_delegate_) | 1600 if (owner_delegate_) |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2047 void RenderWidget::requestPointerUnlock() { | 2053 void RenderWidget::requestPointerUnlock() { |
| 2048 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); | 2054 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); |
| 2049 } | 2055 } |
| 2050 | 2056 |
| 2051 bool RenderWidget::isPointerLocked() { | 2057 bool RenderWidget::isPointerLocked() { |
| 2052 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2058 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 2053 webwidget_mouse_lock_target_.get()); | 2059 webwidget_mouse_lock_target_.get()); |
| 2054 } | 2060 } |
| 2055 | 2061 |
| 2056 } // namespace content | 2062 } // namespace content |
| OLD | NEW |