New issue
Advanced search Search tips

Issue 714147 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 1
Type: Bug-Regression



Sign in to add a comment

USB device selector dialog is unnecessarily tall

Project Member Reported by emaxx@chromium.org, Apr 21 2017

Issue description

Chrome Version: ToT
OS: Chrome OS

What steps will reproduce the problem?
(1) Build a dcheck_always_on=true build for link and deploy it to a link Chromebook.
(2) Run an app that uses chrome.usb API (say "USB Device Info" [1]) and trigger the USB selection dialog.

What is the expected result?
The dialog opens.

What happens instead?
The dialog appears, but is very tall - not even fitting the screen when the app's window is centered. See the attached screenshot.

[1] https://chrome.google.com/webstore/detail/usb-device-info/igkmggljimacfdfalpeelenjeicmfnll


reillyg@: Reilly, assigning to you for triaging. Thanks.
 
Screenshot 2017-04-21 at 4.09.49 PM.png
1.4 MB View Download
Labels: M-59
Reproduced on Chrome 59.0.3065.0.
Labels: OS-Linux OS-Windows
Applies to Chrome on Windows and Linux as well, where the dialog is actually clipped by the window that launched it.
In the old version of this dialog we explicitly set it to 500x250 but that was lost in r435075. Putting back the override of GetPreferredSize() doesn't fix this issue so it seems something more complicated changed inside the Views framework.
Cc: kylixrd@chromium.org
It looks like GetPreferredSize() was moved to DeviceChooserContentView by r453657 however in r464448 the GridLayout on the ChooserDialogView was changed to set the minimum size to the full 402x320 which meant that it would size both the DeviceChooserContentView and the button row to that size. Added all together the result was the super-long window.

Removing the set_minimum_size call in ChooserDialogView::CreateClientView seems to fix the problem.
Labels: -Type-Bug Type-Bug-Regression
Status: Started (was: Assigned)
Patch out for review: https://codereview.chromium.org/2836733003/
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b06115fcd1a2aee65694061710aa1342528f8afe

commit b06115fcd1a2aee65694061710aa1342528f8afe
Author: reillyg <reillyg@chromium.org>
Date: Mon Apr 24 08:42:10 2017

Fix extra-long USB chooser dialog

It appears that setting a minimum size on the DialogViewClient in
CreateClientView causes the GridLayout to use that size for all cells.
This means that both the DeviceChooserContentView and the button row
below it are set to the same height, effectively doubling the size of
the window.

Removing the call to set_minimum_size seems to restore the window to its
proper size.

BUG= 714147 

Review-Url: https://codereview.chromium.org/2836733003
Cr-Commit-Position: refs/heads/master@{#466597}

[modify] https://crrev.com/b06115fcd1a2aee65694061710aa1342528f8afe/chrome/browser/ui/views/extensions/chooser_dialog_view.cc

Status: Fixed (was: Started)

Sign in to add a comment