Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index cb0944417a612a42d4176a4e3642d324ebeeec02..512f3ff9df85e43256829cf5b1d2b8676143a963 100644 |
| --- a/content/renderer/render_widget.cc |
| +++ b/content/renderer/render_widget.cc |
| @@ -1425,15 +1425,17 @@ void RenderWidget::FlushPendingInputEventAck() { |
| // WebWidgetClient |
| void RenderWidget::didAutoResize(const WebSize& new_size) { |
| - // TODO(oshima): support UseZoomForDSFEnabled() |
| - if (size_.width() != new_size.width || size_.height() != new_size.height) { |
| - size_ = new_size; |
| + WebRect new_size_in_window(0, 0, new_size.width, new_size.height); |
| + convertViewportToWindow(&new_size_in_window); |
| + if (size_.width() != new_size_in_window.width || |
| + size_.height() != new_size_in_window.height) { |
| + size_ = gfx::Size(new_size_in_window.width, new_size_in_window.height); |
| if (resizing_mode_selector_->is_synchronous_mode()) { |
| - WebRect new_pos(rootWindowRect().x, |
| - rootWindowRect().y, |
| - new_size.width, |
| - new_size.height); |
| + gfx::Rect new_pos(rootWindowRect().x, |
| + rootWindowRect().y, |
| + size_.width(), |
| + size_.height()); |
| view_screen_rect_ = new_pos; |
| window_screen_rect_ = new_pos; |
| } |
| @@ -1713,7 +1715,6 @@ void RenderWidget::setToolTipText(const blink::WebString& text, |
| } |
| void RenderWidget::setWindowRect(const WebRect& rect) { |
| - // TODO(oshima): Scale back to DIP coordinates. |
| WebRect window_rect = rect; |
|
bokan
2015/12/09 22:06:32
So is window_rect in DIPs? i.e. window coordinates
oshima
2015/12/09 22:20:15
|rect| is screen coordinates and my comment was wr
|
| if (popup_origin_scale_for_emulation_) { |
| float scale = popup_origin_scale_for_emulation_; |
| @@ -2103,16 +2104,10 @@ void RenderWidget::GetSelectionBounds(gfx::Rect* focus, gfx::Rect* anchor) { |
| WebRect focus_webrect; |
| WebRect anchor_webrect; |
| webwidget_->selectionBounds(focus_webrect, anchor_webrect); |
| - if (IsUseZoomForDSFEnabled()) { |
| - float inverse_scale = 1.f / device_scale_factor_; |
| - gfx::RectF focus_rect(focus_webrect); |
| - *focus = gfx::ToEnclosingRect(gfx::ScaleRect(focus_rect, inverse_scale)); |
| - gfx::RectF anchor_rect(anchor_webrect); |
| - *anchor = gfx::ToEnclosingRect(gfx::ScaleRect(anchor_rect, inverse_scale)); |
| - } else { |
| - *focus = focus_webrect; |
| - *anchor = anchor_webrect; |
| - } |
| + convertViewportToWindow(&focus_webrect); |
| + convertViewportToWindow(&anchor_webrect); |
| + *focus = focus_webrect; |
| + *anchor = anchor_webrect; |
| } |
| void RenderWidget::UpdateSelectionBounds() { |