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

Issue 23364004: Implementation of device metrics emulation in render view. (Closed)

Created:
7 years, 4 months ago by dgozman
Modified:
7 years, 2 months ago
CC:
chromium-reviews, jbauman+watch_chromium.org, yusukes+watch_chromium.org, jam, penghuang+watch_chromium.org, apatrick_chromium, sievers+watch_chromium.org, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, danakj+watch_chromium.org, James Su, miu+watch_chromium.org
Visibility:
Public.

Description

Implementation of device metrics emulation in render view. This is used by DevTools to emulate various devices on desktop browser. Emulation includes changing view size, view/window screen positions and device scale factor. Also, the whole view is scaled down if required to fit the browser window. To achieve this, render widget creates an emulator, which handles metrics override by intercepting size/position-related messages. Scaling down is done by setting transform on the root composited layer on the blink side. This emulation is transparent to browser side. Depends on Blink-side patch: https://codereview.chromium.org/23187005/ BUG=288959 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226663

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 9

Patch Set 6 : #

Patch Set 7 : Style #

Total comments: 16

Patch Set 8 : Fixed review comments #

Patch Set 9 : Moved helper class to cc #

Patch Set 10 : Moved helper class to cc #

Total comments: 36

Patch Set 11 : Fixed reviewers comments #

Patch Set 12 : Fixed reviewers comments #

Total comments: 8

Patch Set 13 : Producing image of view size #

Total comments: 10

Patch Set 14 : Fixed review comments #

Patch Set 15 : #

Patch Set 16 : Rebase #

Patch Set 17 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -6 lines) Patch
M content/renderer/devtools/devtools_agent.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download
M content/renderer/devtools/devtools_agent.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +17 lines, -0 lines 0 comments Download
M content/renderer/external_popup_menu.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -0 lines 0 comments Download
M content/renderer/external_popup_menu.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +13 lines, -2 lines 0 comments Download
M content/renderer/render_view_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +17 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +31 lines, -0 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 9 chunks +234 lines, -4 lines 0 comments Download
M content/renderer/web_preferences.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
dgozman
Hello, Could you please look at this patch? This is to properly emulate device on ...
7 years, 3 months ago (2013-09-04 09:01:37 UTC) #1
Avi (use Gerrit)
Please put in a BUG= line. Only trivial changes can go without one, and this ...
7 years, 3 months ago (2013-09-04 14:51:33 UTC) #2
Avi (use Gerrit)
Adding John for thoughts. This is a bit out of my area of expertise, but ...
7 years, 3 months ago (2013-09-04 14:55:45 UTC) #3
aelias_OOO_until_Jul13
On 2013/09/04 14:55:45, Avi wrote: > Adding John for thoughts. > > This is a ...
7 years, 3 months ago (2013-09-05 08:26:41 UTC) #4
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_view_impl.cc File content/renderer/render_view_impl.cc (right): https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_view_impl.cc#newcode2459 content/renderer/render_view_impl.cc:2459: webview()->settings()->setForceCompositingMode(false); This one is usually true on desktop as ...
7 years, 3 months ago (2013-09-05 08:26:49 UTC) #5
dgozman
I'm not really sure this should be moved to the host side. See below. https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_view_impl.cc ...
7 years, 3 months ago (2013-09-10 19:54:02 UTC) #6
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_widget.cc#newcode2702 content/renderer/render_widget.cc:2702: WebKit::WebInputEvent* RenderWidget::DeviceEmulationHelper::ConvertInputEventToEmulated( On 2013/09/10 19:54:02, dgozman wrote: > On ...
7 years, 3 months ago (2013-09-10 20:33:33 UTC) #7
dgozman
jam, may you have a look please? https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_widget.cc#newcode2702 content/renderer/render_widget.cc:2702: WebKit::WebInputEvent* RenderWidget::DeviceEmulationHelper::ConvertInputEventToEmulated( ...
7 years, 3 months ago (2013-09-10 20:55:36 UTC) #8
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/23364004/diff/46001/content/renderer/render_widget.cc#newcode2702 content/renderer/render_widget.cc:2702: WebKit::WebInputEvent* RenderWidget::DeviceEmulationHelper::ConvertInputEventToEmulated( > However, when implementing render-side scale, this ...
7 years, 3 months ago (2013-09-10 21:00:02 UTC) #9
jam
I'm not familiar with devtools very much, or this feature, so I'll defer my lgtm ...
7 years, 3 months ago (2013-09-11 02:59:47 UTC) #10
dgozman
pfeldman: may you have a look please? aelias: scaling is now done via root layer ...
7 years, 3 months ago (2013-09-13 11:32:36 UTC) #11
aelias_OOO_until_Jul13
Could you explain what a "popup" is in this context and what UX you're trying ...
7 years, 3 months ago (2013-09-13 18:29:46 UTC) #12
dgozman
On 2013/09/13 18:29:46, aelias wrote: > Could you explain what a "popup" is in this ...
7 years, 3 months ago (2013-09-13 19:14:13 UTC) #13
aelias_OOO_until_Jul13
OK. Positioning browser objects like popups relative to content is a loose end in Chrome's ...
7 years, 3 months ago (2013-09-13 20:07:08 UTC) #14
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/78001/cc/layers/heads_up_display_layer.cc File cc/layers/heads_up_display_layer.cc (right): https://codereview.chromium.org/23364004/diff/78001/cc/layers/heads_up_display_layer.cc#newcode31 cc/layers/heads_up_display_layer.cc:31: // The root layer may have the transform set. ...
7 years, 3 months ago (2013-09-13 23:51:43 UTC) #15
dgozman
Thanks for comments. The ones not addressed will be fixed. https://codereview.chromium.org/23364004/diff/78001/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/23364004/diff/78001/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode811 ...
7 years, 3 months ago (2013-09-14 07:42:41 UTC) #16
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/78001/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/23364004/diff/78001/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode811 content/browser/renderer_host/render_widget_host_view_aura.cc:811: !device_emulation_enabled_ && On 2013/09/14 07:42:42, dgozman wrote: > To ...
7 years, 3 months ago (2013-09-14 07:50:52 UTC) #17
aelias_OOO_until_Jul13
7 years, 3 months ago (2013-09-14 07:50:53 UTC) #18
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/78001/content/renderer/gpu/render_widget_compositor.h File content/renderer/gpu/render_widget_compositor.h (right): https://codereview.chromium.org/23364004/diff/78001/content/renderer/gpu/render_widget_compositor.h#newcode57 content/renderer/gpu/render_widget_compositor.h:57: void OverrideDeviceScaleFactor(float device_scale); On 2013/09/14 07:42:42, dgozman wrote: > ...
7 years, 3 months ago (2013-09-14 07:53:10 UTC) #19
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/78001/content/browser/renderer_host/render_widget_host_view_aura.cc File content/browser/renderer_host/render_widget_host_view_aura.cc (right): https://codereview.chromium.org/23364004/diff/78001/content/browser/renderer_host/render_widget_host_view_aura.cc#newcode811 content/browser/renderer_host/render_widget_host_view_aura.cc:811: !device_emulation_enabled_ && On 2013/09/14 07:50:53, aelias wrote: > On ...
7 years, 3 months ago (2013-09-14 08:06:51 UTC) #20
dgozman
PTAL https://codereview.chromium.org/23364004/diff/78001/cc/layers/heads_up_display_layer.cc File cc/layers/heads_up_display_layer.cc (right): https://codereview.chromium.org/23364004/diff/78001/cc/layers/heads_up_display_layer.cc#newcode31 cc/layers/heads_up_display_layer.cc:31: // The root layer may have the transform ...
7 years, 3 months ago (2013-09-19 10:17:11 UTC) #21
dgozman
Chris, may you have a look at view_messages.h please?
7 years, 3 months ago (2013-09-19 17:01:00 UTC) #22
danakj
https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc File cc/layers/heads_up_display_layer.cc (right): https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc#newcode30 cc/layers/heads_up_display_layer.cc:30: if (parent()) { I don't know how you'd get ...
7 years, 3 months ago (2013-09-19 17:07:44 UTC) #23
pfeldman
devtools lgtm https://codereview.chromium.org/23364004/diff/111001/content/renderer/render_widget.cc File content/renderer/render_widget.cc (right): https://codereview.chromium.org/23364004/diff/111001/content/renderer/render_widget.cc#newcode195 content/renderer/render_widget.cc:195: const gfx::Rect& widget_rect, Poor indent. https://codereview.chromium.org/23364004/diff/111001/content/renderer/render_widget.cc#newcode252 content/renderer/render_widget.cc:252: ...
7 years, 3 months ago (2013-09-19 17:27:15 UTC) #24
dgozman
https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc File cc/layers/heads_up_display_layer.cc (right): https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc#newcode30 cc/layers/heads_up_display_layer.cc:30: if (parent()) { On 2013/09/19 17:07:45, danakj wrote: > ...
7 years, 3 months ago (2013-09-19 18:42:17 UTC) #25
aelias_OOO_until_Jul13
https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc File cc/layers/heads_up_display_layer.cc (right): https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc#newcode36 cc/layers/heads_up_display_layer.cc:36: device_viewport_in_layout_pixels = gfx::ToFlooredSize(rect.size()); On 2013/09/19 18:42:18, dgozman wrote: > ...
7 years, 3 months ago (2013-09-19 21:35:27 UTC) #26
aelias_OOO_until_Jul13
I took a closer look at the whole patch. (I don't care that much about ...
7 years, 3 months ago (2013-09-20 07:10:13 UTC) #27
palmer
I am no longer an OWNER for this _messages.h file. Adding kenrb instead.
7 years, 2 months ago (2013-09-27 18:09:04 UTC) #28
dgozman
See Blink-side implementation here: https://codereview.chromium.org/23187005/ PTAL https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc File cc/layers/heads_up_display_layer.cc (right): https://codereview.chromium.org/23364004/diff/111001/cc/layers/heads_up_display_layer.cc#newcode36 cc/layers/heads_up_display_layer.cc:36: device_viewport_in_layout_pixels = gfx::ToFlooredSize(rect.size()); ...
7 years, 2 months ago (2013-09-27 19:02:03 UTC) #29
aelias_OOO_until_Jul13
Thanks for all the changes, this is getting much better. https://codereview.chromium.org/23364004/diff/132001/content/common/view_messages.h File content/common/view_messages.h (right): https://codereview.chromium.org/23364004/diff/132001/content/common/view_messages.h#newcode1675 ...
7 years, 2 months ago (2013-09-27 22:51:13 UTC) #30
dgozman
> You can set the main-frame root layer to masksToBounds in > RenderLayerCompositor::ensureRootLayer() when your ...
7 years, 2 months ago (2013-09-30 21:35:45 UTC) #31
aelias_OOO_until_Jul13
Hmm, it's a bit weird how it sets "root_layer->draw_transform()" on the shared_quad_state then inverts "root_layer->screen_space_transform()". ...
7 years, 2 months ago (2013-09-30 22:14:44 UTC) #32
dgozman
PTAL https://codereview.chromium.org/23364004/diff/132001/content/common/view_messages.h File content/common/view_messages.h (right): https://codereview.chromium.org/23364004/diff/132001/content/common/view_messages.h#newcode1675 content/common/view_messages.h:1675: IPC_MESSAGE_ROUTED1(ViewHostMsg_SetExpectedSize, On 2013/09/27 22:51:14, aelias wrote: > Hmm, ...
7 years, 2 months ago (2013-10-01 06:22:15 UTC) #33
aelias_OOO_until_Jul13
lgtm modulo minor comments below. Thanks for all the work on this. Please note my ...
7 years, 2 months ago (2013-10-01 08:08:21 UTC) #34
dgozman
Thank you for review! https://codereview.chromium.org/23364004/diff/138001/content/renderer/devtools/devtools_agent.cc File content/renderer/devtools/devtools_agent.cc (right): https://codereview.chromium.org/23364004/diff/138001/content/renderer/devtools/devtools_agent.cc#newcode155 content/renderer/devtools/devtools_agent.cc:155: if (enabled && impl->webview()) On ...
7 years, 2 months ago (2013-10-01 15:26:10 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgozman@chromium.org/23364004/162001
7 years, 2 months ago (2013-10-02 13:11:41 UTC) #36
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) unit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=204576
7 years, 2 months ago (2013-10-02 14:41:38 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dgozman@chromium.org/23364004/162001
7 years, 2 months ago (2013-10-02 15:12:11 UTC) #38
commit-bot: I haz the power
7 years, 2 months ago (2013-10-03 02:07:54 UTC) #39
Message was sent while issue was closed.
Change committed as 226663

Powered by Google App Engine
This is Rietveld 408576698