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

Issue 2750063002: views: implement dialog width snapping (Closed)

Created:
3 years, 9 months ago by Elly Fong-Jones
Modified:
3 years, 8 months ago
Reviewers:
tapted, Peter Kasting
CC:
chromium-reviews, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

views: implement dialog width snapping Harmony calls for dialogs to grow in units of 16 points. This change: 1) Adds a DIALOG_WIDTH_SNAPPING_UNIT distance metric to ViewsDelegate; 2) Implements width snapping in DialogClientView 3) Plumbs DIALOG_WIDTH_SNAPPING_UNIT down from LayoutDelegate in ChromeViewsDelegate. BUG=635173

Patch Set 1 #

Total comments: 7

Patch Set 2 : move logic to BubbleFrameView #

Patch Set 3 : only snap to harmony units #

Patch Set 4 : remove stray logging #

Total comments: 29

Patch Set 5 : width -> min_width and improve tests #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -51 lines) Patch
M chrome/browser/ui/views/chrome_views_delegate.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/chrome_views_delegate.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/collected_cookies_views.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/views/collected_cookies_views.cc View 1 2 1 chunk +0 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/content_setting_bubble_contents.cc View 1 2 1 chunk +5 lines, -10 lines 0 comments Download
M chrome/browser/ui/views/device_chooser_content_view.cc View 1 2 1 chunk +1 line, -7 lines 0 comments Download
M chrome/browser/ui/views/extensions/chooser_dialog_view.cc View 1 2 1 chunk +1 line, -7 lines 0 comments Download
M chrome/browser/ui/views/harmony/harmony_layout_delegate.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/harmony/harmony_layout_delegate.cc View 1 2 3 4 1 chunk +6 lines, -10 lines 0 comments Download
M chrome/browser/ui/views/harmony/layout_delegate.h View 1 2 3 4 1 chunk +3 lines, -3 lines 2 comments Download
M chrome/browser/ui/views/harmony/layout_delegate.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.cc View 1 2 3 4 2 chunks +11 lines, -0 lines 2 comments Download
M ui/views/bubble/bubble_frame_view_unittest.cc View 1 2 3 4 6 chunks +103 lines, -3 lines 6 comments Download
M ui/views/views_delegate.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/views_delegate.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/window/dialog_delegate.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M ui/views/window/dialog_delegate.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 1 comment Download

Messages

Total messages: 29 (7 generated)
Elly Fong-Jones
tapted: ptal? I am not that pleased with this design because I can't figure out ...
3 years, 9 months ago (2017-03-15 15:37:38 UTC) #3
tapted
On 2017/03/15 15:37:38, Elly Fong-Jones wrote: > tapted: ptal? > > I am not that ...
3 years, 9 months ago (2017-03-15 22:26:11 UTC) #4
Peter Kasting
https://codereview.chromium.org/2750063002/diff/1/ui/views/window/dialog_client_view.cc File ui/views/window/dialog_client_view.cc (right): https://codereview.chromium.org/2750063002/diff/1/ui/views/window/dialog_client_view.cc#newcode46 ui/views/window/dialog_client_view.cc:46: size.Enlarge(unit - 1, 0); On 2017/03/15 22:26:11, tapted wrote: ...
3 years, 9 months ago (2017-03-21 19:17:03 UTC) #6
Elly Fong-Jones
On 2017/03/21 19:17:03, Peter Kasting wrote: > https://codereview.chromium.org/2750063002/diff/1/ui/views/window/dialog_client_view.cc > File ui/views/window/dialog_client_view.cc (right): > > https://codereview.chromium.org/2750063002/diff/1/ui/views/window/dialog_client_view.cc#newcode46 ...
3 years, 9 months ago (2017-03-24 17:47:26 UTC) #7
Elly Fong-Jones
On 2017/03/24 17:47:26, Elly Fong-Jones wrote: > On 2017/03/21 19:17:03, Peter Kasting wrote: > > ...
3 years, 9 months ago (2017-03-27 17:37:25 UTC) #8
Peter Kasting
On 2017/03/27 17:37:25, Elly Fong-Jones wrote: > I implemented this behavior in patchset 3. The ...
3 years, 9 months ago (2017-03-27 20:17:22 UTC) #9
Elly Fong-Jones
On 2017/03/27 20:17:22, Peter Kasting wrote: > On 2017/03/27 17:37:25, Elly Fong-Jones wrote: > > ...
3 years, 8 months ago (2017-03-28 15:43:52 UTC) #10
Peter Kasting
On 2017/03/28 15:43:52, Elly Fong-Jones wrote: > On 2017/03/27 20:17:22, Peter Kasting wrote: > > ...
3 years, 8 months ago (2017-03-28 21:56:05 UTC) #11
Peter Kasting
Is there a way to implement this without exposing it on ViewsDelegate? It's not that ...
3 years, 8 months ago (2017-03-29 03:51:16 UTC) #12
Elly Fong-Jones
On 2017/03/29 03:51:16, Peter Kasting wrote: > Is there a way to implement this without ...
3 years, 8 months ago (2017-03-29 18:15:26 UTC) #13
Peter Kasting
On 2017/03/29 18:15:26, Elly Fong-Jones wrote: > On 2017/03/29 03:51:16, Peter Kasting wrote: > > ...
3 years, 8 months ago (2017-03-29 18:36:20 UTC) #14
tapted
https://codereview.chromium.org/2750063002/diff/60001/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc File chrome/browser/ui/views/harmony/harmony_layout_delegate.cc (right): https://codereview.chromium.org/2750063002/diff/60001/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc#newcode85 chrome/browser/ui/views/harmony/harmony_layout_delegate.cc:85: for (size_t i = 0; i < arraysize(kDefaultWidths); ++i) ...
3 years, 8 months ago (2017-03-29 23:16:16 UTC) #15
Peter Kasting
Note that Elly uploaded a new patch at https://codereview.chromium.org/2785683003/ that I'm in the midst of ...
3 years, 8 months ago (2017-03-30 00:18:23 UTC) #16
tapted
https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc#newcode535 ui/views/bubble/bubble_frame_view.cc:535: ViewsDelegate::GetInstance()->GetSnappedDialogWidth(size.width())); On 2017/03/30 00:18:23, Peter Kasting wrote: > On ...
3 years, 8 months ago (2017-03-30 01:57:13 UTC) #17
Peter Kasting
https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc#newcode535 ui/views/bubble/bubble_frame_view.cc:535: ViewsDelegate::GetInstance()->GetSnappedDialogWidth(size.width())); On 2017/03/30 01:57:13, tapted wrote: > On 2017/03/30 ...
3 years, 8 months ago (2017-03-30 04:07:02 UTC) #18
tapted
https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc#newcode535 ui/views/bubble/bubble_frame_view.cc:535: ViewsDelegate::GetInstance()->GetSnappedDialogWidth(size.width())); On 2017/03/30 04:07:02, Peter Kasting wrote: > On ...
3 years, 8 months ago (2017-03-30 06:11:49 UTC) #19
Peter Kasting
https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc#newcode535 ui/views/bubble/bubble_frame_view.cc:535: ViewsDelegate::GetInstance()->GetSnappedDialogWidth(size.width())); On 2017/03/30 06:11:49, tapted wrote: > On 2017/03/30 ...
3 years, 8 months ago (2017-03-31 22:09:59 UTC) #20
tapted
https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view.cc#newcode535 ui/views/bubble/bubble_frame_view.cc:535: ViewsDelegate::GetInstance()->GetSnappedDialogWidth(size.width())); On 2017/03/31 22:09:58, Peter Kasting wrote: > On ...
3 years, 8 months ago (2017-04-03 09:53:48 UTC) #21
Elly Fong-Jones
tapted, pkasting: ptal? :) https://codereview.chromium.org/2750063002/diff/60001/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc File chrome/browser/ui/views/harmony/harmony_layout_delegate.cc (right): https://codereview.chromium.org/2750063002/diff/60001/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc#newcode85 chrome/browser/ui/views/harmony/harmony_layout_delegate.cc:85: for (size_t i = 0; ...
3 years, 8 months ago (2017-04-05 18:17:53 UTC) #23
tapted
make sure you update the CL description too https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view_unittest.cc File ui/views/bubble/bubble_frame_view_unittest.cc (right): https://codereview.chromium.org/2750063002/diff/60001/ui/views/bubble/bubble_frame_view_unittest.cc#newcode524 ui/views/bubble/bubble_frame_view_unittest.cc:524: TestBubbleFrameView ...
3 years, 8 months ago (2017-04-06 00:24:44 UTC) #27
Peter Kasting
https://codereview.chromium.org/2750063002/diff/80001/chrome/browser/ui/views/harmony/layout_delegate.h File chrome/browser/ui/views/harmony/layout_delegate.h (right): https://codereview.chromium.org/2750063002/diff/80001/chrome/browser/ui/views/harmony/layout_delegate.h#newcode111 chrome/browser/ui/views/harmony/layout_delegate.h:111: // |min_width|. May return 0 if the dialog has ...
3 years, 8 months ago (2017-04-06 06:32:16 UTC) #28
Peter Kasting
3 years, 8 months ago (2017-04-06 07:37:50 UTC) #29
https://codereview.chromium.org/2750063002/diff/80001/chrome/browser/ui/views...
File chrome/browser/ui/views/harmony/layout_delegate.h (right):

https://codereview.chromium.org/2750063002/diff/80001/chrome/browser/ui/views...
chrome/browser/ui/views/harmony/layout_delegate.h:69: enum class DialogWidth {
This enum should disappear.

Powered by Google App Engine
This is Rietveld 408576698