|
|
Chromium Code Reviews|
Created:
3 years, 7 months ago by Elly Fong-Jones Modified:
3 years, 7 months ago CC:
chromium-reviews, groby+bubble_chromium.org, hcarmona+bubble_chromium.org, rouslan+bubble_chromium.org, tfarina Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Descriptionviews: don't snap dialogs with no buttons
These are mostly bubbles/infobars/etc that do not need to be
snapped.
BUG=719274
Review-Url: https://codereview.chromium.org/2880433002
Cr-Commit-Position: refs/heads/master@{#471471}
Committed: https://chromium.googlesource.com/chromium/src/+/3dbe6a55d833fb5bc63fb36a4e055988fb1d1482
Patch Set 1 #
Total comments: 2
Patch Set 2 : move override up #Patch Set 3 : add unittest #
Total comments: 1
Messages
Total messages: 29 (12 generated)
Description was changed from ========== views: don't snap dialogs with no buttons These are mostly bubbles/infobars/etc that do not need to be snapped. BUG=719274 ========== to ========== views: don't snap dialogs with no buttons These are mostly bubbles/infobars/etc that do not need to be snapped. BUG=719274 ==========
ellyjones@chromium.org changed reviewers: + pkasting@chromium.org
pkasting: ptal? :)
Seems like this would let us remove the InternalPageInfoBubbleView::ShouldSnapFrameWidth() override. Seems like we should also have a test of this. https://codereview.chromium.org/2880433002/diff/1/ui/views/bubble/bubble_dial... File ui/views/bubble/bubble_dialog_delegate.cc (right): https://codereview.chromium.org/2880433002/diff/1/ui/views/bubble/bubble_dial... ui/views/bubble/bubble_dialog_delegate.cc:91: return GetDialogButtons() != ui::DIALOG_BUTTON_NONE; Why do this in BubbleDialogDelegateView rather than the parent DialogDelegateView?
We can remove that override (& I just did). I thought about unit-testing a bit, but I am unsure what exactly to have the test cover. Snapping in general, and that the delegate's choice is respected, are covered by BubbleFrameViewTest.WidthSnaps, and it seems a bit trivial to add a test asserting that ShouldSnapFrameWidth() returns true when GetDialogButtons() != DIALOG_BUTTON_NONE and false otherwise. If you think it would be valuable to add that test I'm happy to add it, though. https://codereview.chromium.org/2880433002/diff/1/ui/views/bubble/bubble_dial... File ui/views/bubble/bubble_dialog_delegate.cc (right): https://codereview.chromium.org/2880433002/diff/1/ui/views/bubble/bubble_dial... ui/views/bubble/bubble_dialog_delegate.cc:91: return GetDialogButtons() != ui::DIALOG_BUTTON_NONE; On 2017/05/10 20:41:24, Peter Kasting wrote: > Why do this in BubbleDialogDelegateView rather than the parent > DialogDelegateView? Oops! It should definitely be on DialogDelegateView, fixed :)
On 2017/05/10 21:06:49, Elly Fong-Jones wrote: > We can remove that override (& I just did). > > I thought about unit-testing a bit, but I am unsure what exactly to have the > test cover. Snapping in general, and that the delegate's choice is respected, > are covered by BubbleFrameViewTest.WidthSnaps, and it seems a bit trivial to add > a test asserting that ShouldSnapFrameWidth() returns true when > GetDialogButtons() != DIALOG_BUTTON_NONE and false otherwise. If you think it > would be valuable to add that test I'm happy to add it, though. I probably would. I don't think that's too much of a change-detector test. LGTM with that.
On 2017/05/10 21:46:04, Peter Kasting wrote: > On 2017/05/10 21:06:49, Elly Fong-Jones wrote: > > We can remove that override (& I just did). > > > > I thought about unit-testing a bit, but I am unsure what exactly to have the > > test cover. Snapping in general, and that the delegate's choice is respected, > > are covered by BubbleFrameViewTest.WidthSnaps, and it seems a bit trivial to > add > > a test asserting that ShouldSnapFrameWidth() returns true when > > GetDialogButtons() != DIALOG_BUTTON_NONE and false otherwise. If you think it > > would be valuable to add that test I'm happy to add it, though. > > I probably would. I don't think that's too much of a change-detector test. > > LGTM with that. Test added :)
ellyjones@chromium.org changed reviewers: + palmer@chromium.org
palmer: ptal as c/b/ui/views/page_info OWNER? :)
lgtm
The CQ bit was checked by ellyjones@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from pkasting@chromium.org Link to the patchset: https://codereview.chromium.org/2880433002/#ps40001 (title: "add unittest")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
ellyjones@chromium.org changed reviewers: + sky@chromium.org
sky: ptal as ui/views owner? :)
https://codereview.chromium.org/2880433002/diff/40001/ui/views/window/dialog_... File ui/views/window/dialog_delegate.cc (right): https://codereview.chromium.org/2880433002/diff/40001/ui/views/window/dialog_... ui/views/window/dialog_delegate.cc:136: return GetDialogButtons() != ui::DIALOG_BUTTON_NONE; Would a better fix be to have BubbleDialogDelegateView override and return false?
On 2017/05/12 17:28:07, sky wrote: > https://codereview.chromium.org/2880433002/diff/40001/ui/views/window/dialog_... > File ui/views/window/dialog_delegate.cc (right): > > https://codereview.chromium.org/2880433002/diff/40001/ui/views/window/dialog_... > ui/views/window/dialog_delegate.cc:136: return GetDialogButtons() != > ui::DIALOG_BUTTON_NONE; > Would a better fix be to have BubbleDialogDelegateView override and return > false? There are subclasses of BubbleDialogDelegateView that do have GetDialogButtons() == ui::DIALOG_BUTTON_NONE, though; those subclasses would have to separately override ShouldSnapFrameWidth().
Ok, LGTM
The CQ bit was checked by ellyjones@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by ellyjones@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1494620125574620,
"parent_rev": "9c5c339f64135eedc7af11876f52a23fda402b15", "commit_rev":
"3dbe6a55d833fb5bc63fb36a4e055988fb1d1482"}
Message was sent while issue was closed.
Description was changed from ========== views: don't snap dialogs with no buttons These are mostly bubbles/infobars/etc that do not need to be snapped. BUG=719274 ========== to ========== views: don't snap dialogs with no buttons These are mostly bubbles/infobars/etc that do not need to be snapped. BUG=719274 Review-Url: https://codereview.chromium.org/2880433002 Cr-Commit-Position: refs/heads/master@{#471471} Committed: https://chromium.googlesource.com/chromium/src/+/3dbe6a55d833fb5bc63fb36a4e05... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/3dbe6a55d833fb5bc63fb36a4e05... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
