Regression: Bubble title/content misalignment pre-Harmony |
||
Issue descriptionVarious bubbles have title/content misaligned, or did until people started landing bandaids to fix them; see e.g. bug 704575 . The root cause of this looks to be https://codereview.chromium.org/2571613002 , which changed BubbleDialogDelegateView::CreateNonClientFrameView() to call views_delegate->GetDialogFrameViewInsets(). In the current code, this lives in the constructor of BubbleDialogDelegateView, and is the line: title_margins_ = views_delegate->GetInsetsMetric(InsetsMetric::DIALOG_TITLE); This resulted in a behavior change pre-Harmony, because the dialog title's horizontal insets differ from the previous ones used there. In the nomenclature of the old views constants, we went from using kPanelHorizMargin to kButtonHEdgeMarginNew. The bubble contents remained using the panel margin, and the panel margin seems more semantically correct to me. So I think step 1 on this bug is ensuring that the bubble title margins are set to the old values pre-Harmony. In Harmony, these values (which map to PANEL_CONTENT_MARGIN and DIALOG_BUTTON_MARGIN) are both kHarmonyLayoutUnit, so we'll see no visible effect. Step 2 is unwinding the various bandaids people have landed when they didn't trace back to fix the real root cause here. For example: * https://codereview.chromium.org/2773733002 for bug 704575 can probably just be reverted * https://codereview.chromium.org/2800723003 was landed in response to the above but I think does not need to be reverted, it looks like the previous code was newly written after the original problem above and thus was just wrong * https://codereview.chromium.org/2640593002 was landed in response to the original change; I'm wondering if maybe if this is all fixed, we can unwind this a bit and go back to the idea of not having separate title/contents margins for bubbles * Maybe other CLs did similar things? I didn't look; possibly searching for people who call set_title_margins() will turn something up
,
Apr 13 2017
Step 1 seems to be done already merely due to the churn around the LayoutProvider and similar other changes.
,
Apr 13 2017
I don't think so -- bubbles are using INSETS_DIALOG_TITLE for the title area, which uses kButtonHEdgeMarginNew for horizontal insets. We need to use kPanelHorizMargin for that value for bubbles. The two ways to do this are either to add INSETS_BUBBLE_TITLE, or to compute the correct insets from INSETS_BUBBLE_CONTENTS directly in BubbleDialogDelegateView. The latter route would suggest doing something similar for dialogs -- removing INSETS_DIALOG_TITLE and instead just having INSETS_PANEL (maybe renamed INSETS_DIALOG) and computing the title insets from that in DialogDelegate. Then post-Harmony maybe we nuke INSETS_BUBBLE entirely, since in Harmony bubbles/dialogs are all the same insets.
,
Apr 13 2017
Oh... Right. I got it backwards.
,
Apr 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/deadadaac4e84f4229d5e4d80ac04cef9dd060bc commit deadadaac4e84f4229d5e4d80ac04cef9dd060bc Author: tapted <tapted@chromium.org> Date: Wed Apr 19 00:25:17 2017 Remove unnecessary virtual ManagePasswordsTest::view(). It only complicates things. BUG= 711012 Review-Url: https://codereview.chromium.org/2818383004 Cr-Commit-Position: refs/heads/master@{#465430} [modify] https://crrev.com/deadadaac4e84f4229d5e4d80ac04cef9dd060bc/chrome/browser/ui/cocoa/passwords/passwords_bubble_browsertest.mm [modify] https://crrev.com/deadadaac4e84f4229d5e4d80ac04cef9dd060bc/chrome/browser/ui/passwords/manage_passwords_test.h [modify] https://crrev.com/deadadaac4e84f4229d5e4d80ac04cef9dd060bc/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc [modify] https://crrev.com/deadadaac4e84f4229d5e4d80ac04cef9dd060bc/chrome/browser/ui/views/passwords/manage_passwords_icon_view_interactive_uitest.cc
,
Apr 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5d0f09e42f23950e3937e36e5bdc3a384f732330 commit 5d0f09e42f23950e3937e36e5bdc3a384f732330 Author: kylixrd <kylixrd@chromium.org> Date: Wed Apr 19 16:45:10 2017 Restored Pre-Harmony Bubble title margin metrics Added INSETS_BUBBLE_TITLE metric to distinguish from INSETS_DIALOG_TITLE BUG= 711012 BUG= 705907 Review-Url: https://codereview.chromium.org/2819633002 Cr-Commit-Position: refs/heads/master@{#465635} [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/browser/ui/views/harmony/harmony_layout_provider.cc [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc [add] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/browser/ui/views/passwords/password_dialog_view_browsertest.cc [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/browser/ui/views/session_crashed_bubble_view.h [add] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/browser/ui/views/session_crashed_bubble_view_browsertest.cc [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/chrome/test/BUILD.gn [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/ui/views/bubble/bubble_dialog_delegate.cc [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/ui/views/layout/layout_provider.cc [modify] https://crrev.com/5d0f09e42f23950e3937e36e5bdc3a384f732330/ui/views/layout/layout_provider.h
,
Apr 19 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by pkasting@chromium.org
, Apr 12 2017