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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 const gfx::Rect& window_screen_rect) { | 1524 const gfx::Rect& window_screen_rect) { |
1525 if (screen_metrics_emulator_) { | 1525 if (screen_metrics_emulator_) { |
1526 screen_metrics_emulator_->OnUpdateScreenRects(view_screen_rect, | 1526 screen_metrics_emulator_->OnUpdateScreenRects(view_screen_rect, |
1527 window_screen_rect); | 1527 window_screen_rect); |
1528 } else { | 1528 } else { |
1529 SetScreenRects(view_screen_rect, window_screen_rect); | 1529 SetScreenRects(view_screen_rect, window_screen_rect); |
1530 } | 1530 } |
1531 Send(new ViewHostMsg_UpdateScreenRects_ACK(routing_id())); | 1531 Send(new ViewHostMsg_UpdateScreenRects_ACK(routing_id())); |
1532 } | 1532 } |
1533 | 1533 |
| 1534 void RenderWidget::OnUpdateWindowScreenRect( |
| 1535 const gfx::Rect& window_screen_rect) { |
| 1536 if (screen_metrics_emulator_) { |
| 1537 screen_metrics_emulator_->OnUpdateWindowScreenRect(window_screen_rect); |
| 1538 } else { |
| 1539 window_screen_rect_ = window_screen_rect; |
| 1540 } |
| 1541 } |
| 1542 |
1534 void RenderWidget::OnSetSurfaceIdNamespace(uint32_t surface_id_namespace) { | 1543 void RenderWidget::OnSetSurfaceIdNamespace(uint32_t surface_id_namespace) { |
1535 if (compositor_) | 1544 if (compositor_) |
1536 compositor_->SetSurfaceIdNamespace(surface_id_namespace); | 1545 compositor_->SetSurfaceIdNamespace(surface_id_namespace); |
1537 } | 1546 } |
1538 | 1547 |
1539 void RenderWidget::OnHandleCompositorProto(const std::vector<uint8_t>& proto) { | 1548 void RenderWidget::OnHandleCompositorProto(const std::vector<uint8_t>& proto) { |
1540 if (compositor_) | 1549 if (compositor_) |
1541 compositor_->OnHandleCompositorProto(proto); | 1550 compositor_->OnHandleCompositorProto(proto); |
1542 } | 1551 } |
1543 | 1552 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2135 } | 2144 } |
2136 | 2145 |
2137 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2146 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2138 return | 2147 return |
2139 screen_metrics_emulator_ ? | 2148 screen_metrics_emulator_ ? |
2140 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2149 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2141 device_scale_factor_; | 2150 device_scale_factor_; |
2142 } | 2151 } |
2143 | 2152 |
2144 } // namespace content | 2153 } // namespace content |
OLD | NEW |