Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: content/renderer/devtools/render_widget_screen_metrics_emulator.cc

Issue 1723663005: Revert of [DevTools] Move screen orientation override to RenderWidgetScreenMetricsEmulator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/view_messages.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/devtools/render_widget_screen_metrics_emulator.h" 5 #include "content/renderer/devtools/render_widget_screen_metrics_emulator.h"
6 6
7 #include "content/common/resize_params.h" 7 #include "content/common/resize_params.h"
8 #include "content/public/common/context_menu_params.h" 8 #include "content/public/common/context_menu_params.h"
9 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega te.h" 9 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega te.h"
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 modified_resize_params.screen_info.rect = screen_rect; 92 modified_resize_params.screen_info.rect = screen_rect;
93 modified_resize_params.screen_info.availableRect = screen_rect; 93 modified_resize_params.screen_info.availableRect = screen_rect;
94 window_screen_rect = applied_widget_rect_; 94 window_screen_rect = applied_widget_rect_;
95 } 95 }
96 96
97 modified_resize_params.screen_info.deviceScaleFactor = 97 modified_resize_params.screen_info.deviceScaleFactor =
98 emulation_params_.deviceScaleFactor 98 emulation_params_.deviceScaleFactor
99 ? emulation_params_.deviceScaleFactor 99 ? emulation_params_.deviceScaleFactor
100 : original_screen_info().deviceScaleFactor; 100 : original_screen_info().deviceScaleFactor;
101 101
102 if (emulation_params_.screenOrientationType !=
103 blink::WebScreenOrientationUndefined) {
104 modified_resize_params.screen_info.orientationType =
105 emulation_params_.screenOrientationType;
106 modified_resize_params.screen_info.orientationAngle =
107 emulation_params_.screenOrientationAngle;
108 }
109
110 // Pass three emulation parameters to the blink side: 102 // Pass three emulation parameters to the blink side:
111 // - we keep the real device scale factor in compositor to produce sharp image 103 // - we keep the real device scale factor in compositor to produce sharp image
112 // even when emulating different scale factor; 104 // even when emulating different scale factor;
113 // - in order to fit into view, WebView applies offset and scale to the 105 // - in order to fit into view, WebView applies offset and scale to the
114 // root layer. 106 // root layer.
115 blink::WebDeviceEmulationParams modified_emulation_params = emulation_params_; 107 blink::WebDeviceEmulationParams modified_emulation_params = emulation_params_;
116 modified_emulation_params.deviceScaleFactor = 108 modified_emulation_params.deviceScaleFactor =
117 original_screen_info().deviceScaleFactor; 109 original_screen_info().deviceScaleFactor;
118 modified_emulation_params.offset = 110 modified_emulation_params.offset =
119 blink::WebFloatPoint(offset_.x(), offset_.y()); 111 blink::WebFloatPoint(offset_.x(), offset_.y());
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 153
162 gfx::Rect RenderWidgetScreenMetricsEmulator::AdjustValidationMessageAnchor( 154 gfx::Rect RenderWidgetScreenMetricsEmulator::AdjustValidationMessageAnchor(
163 const gfx::Rect& anchor) { 155 const gfx::Rect& anchor) {
164 gfx::Rect scaled = gfx::ScaleToEnclosedRect(anchor, scale_); 156 gfx::Rect scaled = gfx::ScaleToEnclosedRect(anchor, scale_);
165 scaled.set_x(scaled.x() + offset_.x()); 157 scaled.set_x(scaled.x() + offset_.x());
166 scaled.set_y(scaled.y() + offset_.y()); 158 scaled.set_y(scaled.y() + offset_.y());
167 return scaled; 159 return scaled;
168 } 160 }
169 161
170 } // namespace content 162 } // namespace content
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698