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

Issue 22903022: Limit constrained windows to the size of the parent view. (Closed)

Created:
7 years, 4 months ago by Rune Fevang
Modified:
7 years, 3 months ago
Reviewers:
Mike Wittman, msw, sky
CC:
chromium-reviews, tfarina, alicet1, msw+watch_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Limit constrained windows to the size of the parent view. Constrained windows would get drawn partially outside the browser window, obscuring some of the contents. This CL limits their size so everything is in view. This mimics the behavior of the old style dialogs. This CL also changes the size request to use the current preferred size of the view, instead of reusing the existing size. Some dialogs (like the print preview) changes their size preferences when the browser window size changes, so the old size might not be optimal any more. Additionally, added a GetMinimumSize to the bubble frame view, as previously GetPreferredSize would get used, effectively undoing the additional restrictions placed based on Window sizes. BUG=272760, 274236, 276150 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=221573

Patch Set 1 #

Patch Set 2 : Added GetMaximumDialogSize #

Total comments: 6

Patch Set 3 : Changed max size logic to take top bars into account #

Patch Set 4 : Addressed comments #

Total comments: 2

Patch Set 5 : Moved bubble method #

Patch Set 6 : #

Patch Set 7 : Added unit test + rebase #

Patch Set 8 : Missing OVERRIDE #

Total comments: 11

Patch Set 9 : Addressed comments #

Total comments: 2

Patch Set 10 : No initializer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -16 lines) Patch
M chrome/browser/chromeos/login/webui_login_view.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/login/webui_login_view.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/printing/print_preview_test.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/apps/native_app_window_cocoa.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/apps/native_app_window_cocoa.mm View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/apps/native_app_window_gtk.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/gtk/apps/native_app_window_gtk.cc View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/apps/native_app_window_views.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/apps/native_app_window_views.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/constrained_window_views.cc View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -2 lines 0 comments Download
A chrome/browser/ui/views/constrained_window_views_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +134 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view_layout.cc View 1 2 3 4 5 6 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M components/web_modal/web_contents_modal_dialog_host.h View 1 2 chunks +8 lines, -2 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.cc View 1 2 3 4 2 chunks +20 lines, -12 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
Rune Fevang
7 years, 4 months ago (2013-08-21 23:26:21 UTC) #1
Rune Fevang
Made some changes to fix one more bug (crbug.com/276150).
7 years, 4 months ago (2013-08-22 01:55:37 UTC) #2
Mike Wittman
IIRC the print preview dialog insets itself from the edges of the WebContentsView; does that ...
7 years, 4 months ago (2013-08-22 17:46:10 UTC) #3
Rune Fevang
On 2013/08/22 17:46:10, Mike Wittman wrote: > IIRC the print preview dialog insets itself from ...
7 years, 4 months ago (2013-08-23 02:57:43 UTC) #4
Mike Wittman
lgtm
7 years, 4 months ago (2013-08-23 17:14:29 UTC) #5
Rune Fevang
ben: Could you do the OWNERS review please?
7 years, 4 months ago (2013-08-23 19:15:59 UTC) #6
Rune Fevang
wittman just told me ben is out of office, so trying sky instead :)
7 years, 4 months ago (2013-08-23 19:40:44 UTC) #7
msw
Just one driveby bubble nit. https://chromiumcodereview.appspot.com/22903022/diff/20001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://chromiumcodereview.appspot.com/22903022/diff/20001/ui/views/bubble/bubble_frame_view.cc#newcode178 ui/views/bubble/bubble_frame_view.cc:178: gfx::Size BubbleFrameView::GetSizeForClientSize(const gfx::Size& client_size) ...
7 years, 4 months ago (2013-08-23 19:57:25 UTC) #8
Rune Fevang
https://chromiumcodereview.appspot.com/22903022/diff/20001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://chromiumcodereview.appspot.com/22903022/diff/20001/ui/views/bubble/bubble_frame_view.cc#newcode178 ui/views/bubble/bubble_frame_view.cc:178: gfx::Size BubbleFrameView::GetSizeForClientSize(const gfx::Size& client_size) { On 2013/08/23 19:57:25, msw ...
7 years, 4 months ago (2013-08-23 20:17:44 UTC) #9
sky
How about some tests here?
7 years, 4 months ago (2013-08-23 20:30:34 UTC) #10
Rune Fevang
On 2013/08/23 20:30:34, sky wrote: > How about some tests here? Added a unit test.
7 years, 3 months ago (2013-08-30 01:31:11 UTC) #11
sky
https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views.cc File chrome/browser/ui/views/constrained_window_views.cc (right): https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views.cc#newcode573 chrome/browser/ui/views/constrained_window_views.cc:573: gfx::Size size = widget->non_client_view()->GetPreferredSize(); Can you use RootView instead ...
7 years, 3 months ago (2013-08-30 16:49:21 UTC) #12
Mike Wittman
https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views_unittest.cc File chrome/browser/ui/views/constrained_window_views_unittest.cc (right): https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views_unittest.cc#newcode92 chrome/browser/ui/views/constrained_window_views_unittest.cc:92: UpdateWebContentsModalDialogPosition(dialog, dialog_host.get()); add an expectation on the dialog size ...
7 years, 3 months ago (2013-08-30 17:53:35 UTC) #13
Rune Fevang
https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views.cc File chrome/browser/ui/views/constrained_window_views.cc (right): https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views.cc#newcode573 chrome/browser/ui/views/constrained_window_views.cc:573: gfx::Size size = widget->non_client_view()->GetPreferredSize(); On 2013/08/30 16:49:21, sky wrote: ...
7 years, 3 months ago (2013-08-30 21:08:52 UTC) #14
Mike Wittman
test lgtm https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views_unittest.cc File chrome/browser/ui/views/constrained_window_views_unittest.cc (right): https://codereview.chromium.org/22903022/diff/66001/chrome/browser/ui/views/constrained_window_views_unittest.cc#newcode92 chrome/browser/ui/views/constrained_window_views_unittest.cc:92: UpdateWebContentsModalDialogPosition(dialog, dialog_host.get()); On 2013/08/30 21:08:52, Rune Fevang ...
7 years, 3 months ago (2013-08-30 22:00:26 UTC) #15
Rune Fevang
Ping
7 years, 3 months ago (2013-09-05 22:05:40 UTC) #16
sky
LGTM https://codereview.chromium.org/22903022/diff/76001/chrome/browser/ui/views/constrained_window_views_unittest.cc File chrome/browser/ui/views/constrained_window_views_unittest.cc (right): https://codereview.chromium.org/22903022/diff/76001/chrome/browser/ui/views/constrained_window_views_unittest.cc#newcode24 chrome/browser/ui/views/constrained_window_views_unittest.cc:24: DialogContents() : preferred_size_() {} nit: no need to ...
7 years, 3 months ago (2013-09-05 23:39:14 UTC) #17
Rune Fevang
Thanks :) https://codereview.chromium.org/22903022/diff/76001/chrome/browser/ui/views/constrained_window_views_unittest.cc File chrome/browser/ui/views/constrained_window_views_unittest.cc (right): https://codereview.chromium.org/22903022/diff/76001/chrome/browser/ui/views/constrained_window_views_unittest.cc#newcode24 chrome/browser/ui/views/constrained_window_views_unittest.cc:24: DialogContents() : preferred_size_() {} On 2013/09/05 23:39:14, ...
7 years, 3 months ago (2013-09-06 00:04:25 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rfevang@chromium.org/22903022/89001
7 years, 3 months ago (2013-09-06 00:06:54 UTC) #19
commit-bot: I haz the power
7 years, 3 months ago (2013-09-06 05:08:45 UTC) #20
Message was sent while issue was closed.
Change committed as 221573

Powered by Google App Engine
This is Rietveld 408576698