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

Issue 2375843003: views: add Harmony dialog width support (Closed)

Created:
4 years, 2 months ago by Elly Fong-Jones
Modified:
4 years ago
Reviewers:
sky, Evan Stade
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

views: add Harmony dialog width support This change: 1) Adds DialogDelegate::{set_,}dialog_width() to get/set the Harmony width for a dialog; 2) Adds an override of DialogDelegateView::GetPreferredSize() to honor the Harmony width in secondary-ui-md mode; 3) Changes the collected cookies dialog to use the Harmony medium width. BUG=635173

Patch Set 1 #

Total comments: 9

Patch Set 2 : round 1 #

Total comments: 8

Patch Set 3 : remove GetDialogWidth #

Total comments: 12

Patch Set 4 : move DialogWidth and such #

Patch Set 5 : GetPreferredSize -> DialogClientView #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -0 lines) Patch
M chrome/browser/ui/views/collected_cookies_views.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/window/dialog_client_view.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 1 comment Download
M ui/views/window/dialog_delegate.h View 1 2 3 4 1 chunk +16 lines, -0 lines 2 comments Download
M ui/views/window/dialog_delegate.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
Elly Fong-Jones
estade, sky: ptal? :)
4 years, 2 months ago (2016-09-28 12:44:51 UTC) #3
Evan Stade
https://codereview.chromium.org/2375843003/diff/1/ui/views/window/dialog_delegate.cc File ui/views/window/dialog_delegate.cc (right): https://codereview.chromium.org/2375843003/diff/1/ui/views/window/dialog_delegate.cc#newcode277 ui/views/window/dialog_delegate.cc:277: int height = View::GetPreferredSize().height(); you should get the width ...
4 years, 2 months ago (2016-09-28 16:14:37 UTC) #4
Elly Fong-Jones
estade: ptal? :) https://codereview.chromium.org/2375843003/diff/1/ui/views/window/dialog_delegate.cc File ui/views/window/dialog_delegate.cc (right): https://codereview.chromium.org/2375843003/diff/1/ui/views/window/dialog_delegate.cc#newcode277 ui/views/window/dialog_delegate.cc:277: int height = View::GetPreferredSize().height(); On 2016/09/28 ...
4 years, 2 months ago (2016-09-28 18:44:09 UTC) #5
Evan Stade
https://codereview.chromium.org/2375843003/diff/1/ui/views/window/dialog_delegate.cc File ui/views/window/dialog_delegate.cc (right): https://codereview.chromium.org/2375843003/diff/1/ui/views/window/dialog_delegate.cc#newcode285 ui/views/window/dialog_delegate.cc:285: default: return View::GetPreferredSize(); On 2016/09/28 18:44:09, Elly Fong-Jones wrote: ...
4 years, 2 months ago (2016-09-28 21:12:39 UTC) #6
Elly Fong-Jones
estade: ptal? :) https://codereview.chromium.org/2375843003/diff/20001/ui/views/window/dialog_delegate.cc File ui/views/window/dialog_delegate.cc (right): https://codereview.chromium.org/2375843003/diff/20001/ui/views/window/dialog_delegate.cc#newcode277 ui/views/window/dialog_delegate.cc:277: DialogDelegate::DialogWidth width = DialogDelegate::DIALOG_WIDTH_DEFAULT; On 2016/09/28 ...
4 years, 2 months ago (2016-10-03 13:34:45 UTC) #8
Evan Stade
lgtm https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.cc File ui/views/window/dialog_delegate.cc (right): https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.cc#newcode274 ui/views/window/dialog_delegate.cc:274: int width_px = dialog_width() * 32; actually dp, ...
4 years, 2 months ago (2016-10-03 19:04:19 UTC) #9
sky
https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.h File ui/views/window/dialog_delegate.h (right): https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.h#newcode36 ui/views/window/dialog_delegate.h:36: enum DialogWidth { enum class and remove DIALOG_WIDTH from ...
4 years, 2 months ago (2016-10-03 21:24:02 UTC) #10
Evan Stade
https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.h File ui/views/window/dialog_delegate.h (right): https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.h#newcode36 ui/views/window/dialog_delegate.h:36: enum DialogWidth { On 2016/10/03 21:24:02, sky wrote: > ...
4 years, 2 months ago (2016-10-04 00:13:46 UTC) #11
Elly Fong-Jones
ok, I moved the sizing logic to DialogClientView and the width factor to DialogDelegate. estade, ...
4 years, 2 months ago (2016-10-05 13:20:31 UTC) #12
Evan Stade
https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.h File ui/views/window/dialog_delegate.h (right): https://codereview.chromium.org/2375843003/diff/40001/ui/views/window/dialog_delegate.h#newcode36 ui/views/window/dialog_delegate.h:36: enum DialogWidth { On 2016/10/05 13:20:31, Elly Fong-Jones wrote: ...
4 years, 2 months ago (2016-10-05 19:52:29 UTC) #13
sky
How common is it going to be to set a width based on the harmony ...
4 years, 2 months ago (2016-10-06 16:13:54 UTC) #14
Elly Fong-Jones
On 2016/10/06 16:13:54, sky wrote: > How common is it going to be to set ...
4 years, 2 months ago (2016-10-06 16:16:36 UTC) #15
sky
Could this knowledge move to chrome? As mentioned a SetMinimizeSize(gfx::Size) on DialogClientView seems reasonable, but ...
4 years, 2 months ago (2016-10-06 21:15:51 UTC) #16
Evan Stade
On 2016/10/06 21:15:51, sky wrote: > Could this knowledge move to chrome? As mentioned a ...
4 years, 2 months ago (2016-10-06 21:26:00 UTC) #17
sky
Aren't most delegates a DialogDelegateView, so that they could do this->SetMinimumSize? I agree the distinction ...
4 years, 2 months ago (2016-10-06 22:32:17 UTC) #18
Elly Fong-Jones
FYI I'm holding off on updating this CL until we resolve the mailing list thread ...
4 years, 2 months ago (2016-10-10 11:34:55 UTC) #19
Evan Stade
On 2016/10/06 22:32:17, sky wrote: > Aren't most delegates a DialogDelegateView, so that they could ...
4 years, 2 months ago (2016-10-10 17:24:21 UTC) #20
sky
4 years, 2 months ago (2016-10-10 19:56:43 UTC) #21
Can we put the SetMinimumSize on DialogClientView?

On Mon, Oct 10, 2016 at 10:24 AM,  <estade@chromium.org> wrote:
> On 2016/10/06 22:32:17, sky wrote:
>> Aren't most delegates a DialogDelegateView, so that they could do
>> this->SetMinimumSize?
>
> most, but far from all.
>
> The contents of a dialog are sized by DialogClientView. I don't think we can
> avoid modifying that code. I don't believe View::GetMinimumSize is used in
> this
> case, and it seems unlikely to be exactly what we want anyway, which is a
> hardcoded width and an expandable height.
>
>
>>
>> I agree the distinction as to what we end up putting in ui/views and
>> not is hazy. Given that ui/views doesn't really need the size in
>> anyway it seems best to separate the logic as much as possible.
>> Arguably we could have done that with other md effects (ink drop and
>> focus ring come to mind) and would result in making ui/views more
>> general and less tied to the current ui.
>>
>> -Scott
>>
>> On Thu, Oct 6, 2016 at 2:25 PM, <mailto:estade@chromium.org> wrote:
>> > On 2016/10/06 21:15:51, sky wrote:
>> >> Could this knowledge move to chrome? As mentioned a
>> >> SetMinimizeSize(gfx::Size) on DialogClientView seems reasonable, but I
>> >> would prefer if the harmony constant could live in chrome.
>> >>
>> >> -Scott
>> >>
>> >> On Thu, Oct 6, 2016 at 9:16 AM, <mailto:ellyjones@chromium.org> wrote:
>> >> > On 2016/10/06 16:13:54, sky wrote:
>> >> >> How common is it going to be to set a width based on the harmony
>> >> >> constants? I
>> >> >> would rather we add a SetMinimizeSize(gfx::size) to DialogClientView
>> >> >> and
>> >> >> not
>> >> >> bake these values into views.
>> >> >
>> >> > The plan is for every dialog to use them.
>> >> >
>> >> > https://codereview.chromium.org/2375843003/
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups
>> >> "Chromium-reviews" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send
>> >> an
>> > email
>> >> to mailto:chromium-reviews+unsubscribe@chromium.org.
>> >>
>> >
>> > I don't think it would be very easy to use
>> > DialogClientView::SetMinimumSize
>> > because you can only call GetDialogClientView after creating the widget.
>> > I
>> > guess
>> > I don't see that as conceptually different from the other parts of
>> > DialogDelegate which allow you to specify details about the appearance
>> > of a
>> > dialog, or the other parts of Harmony which live in ui/views (i.e.
>> > controls).
>> >
>> > https://codereview.chromium.org/2375843003/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Chromium-reviews" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
> email
>> to mailto:chromium-reviews+unsubscribe@chromium.org.
>>
>
>
>
> https://codereview.chromium.org/2375843003/

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698