|
|
DescriptionViews/Harmony: Remove references to layout constants in c/b/ui/views/sync.
Remove unnecessary includes for ui/views/layout/layout_constants.h and do some
refactoring to remove references to layout constants in
ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*.
See
https://drive.google.com/file/d/0BzEa5HU1aAqBOXBDazdRT245Wk0/view?usp=sharing
for before/after screenshots of ProfileSigninConfirmationDialogViews.
BUG=691897
Review-Url: https://codereview.chromium.org/2799163002
Cr-Commit-Position: refs/heads/master@{#462771}
Committed: https://chromium.googlesource.com/chromium/src/+/8b6a69f075e5f117b6a9df69cb42ebd6ffe52fa6
Patch Set 1 #
Total comments: 3
Patch Set 2 : Review comments. #
Total comments: 6
Patch Set 3 : Review comments. #
Messages
Total messages: 26 (17 generated)
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
patricialor@chromium.org changed reviewers: + tapted@chromium.org
Hi Trent, PTAL? https://codereview.chromium.org/2799163002/diff/1/chrome/browser/ui/views/syn... File chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc (right): https://codereview.chromium.org/2799163002/diff/1/chrome/browser/ui/views/syn... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:228: explanation_columns->AddPaddingColumn(0.0, button_margin); Not sure if these two should also be |panel_margin| (same as the |prompt_bar| above)?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2799163002/diff/1/chrome/browser/ui/views/syn... File chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc (right): https://codereview.chromium.org/2799163002/diff/1/chrome/browser/ui/views/syn... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:228: explanation_columns->AddPaddingColumn(0.0, button_margin); On 2017/04/06 02:17:19, Patti Lor wrote: > Not sure if these two should also be |panel_margin| (same as the |prompt_bar| > above)? |prompt_bar| is the host passed to GridLayout::CreatePanel which was using kButtonHEdgeMarginNew for horizontal until recently. Now it's InsetsMetric::PANEL, which gives LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN under harmony for horizontal. So I think this is fine - button_margin is the correct horizontal padding. But this could be clearer. I think the nicer approach would be to remove |panel_margin| and |button_margin|, and do: const gfx::Insets panel_insets = ViewsDelegate::GetInstance()->GetInsetsMetric(InsetsMetric::PANEL); // The prompt bar needs to go to the edge of the dialog, so ignore insets for the outer layout. views::GridLayout* dialog_layout = new views::GridLayout(this); dialog_layout->SetInsets(panel_insets.top(), 0, 0, 0); SetLayoutManager(dialog_layout); ... dialog_layout->AddPaddingRow(0.0, panel_insets.bottom()); constexpr int kExplanationColumnSetId = 1; views::ColumnSet* explanation_columns = dialog_layout->AddColumnSet(kExplanationColumnSetId); explanation_columns->AddPaddingColumn(0.0, panel_insets.left()); .. explanation_columns->AddPaddingColumn(0.0, panel_insets.right()); dialog_layout->StartRow(0, kExplanationColumnSetId);
The CQ bit was checked by patricialor@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Views/Harmony: Replace layout constants in chrome/browser/ui/views/sync. Replace all direct references to constants in ui/views/layout/layout_constants.h under chrome/browser/ui/views/sync/* with LayoutDelegate metrics. BUG=691897 ========== to ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. BUG=691897 ==========
Description was changed from ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. BUG=691897 ========== to ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. BUG=691897 ==========
Thanks Trent. I updated the CL description as well. https://codereview.chromium.org/2799163002/diff/1/chrome/browser/ui/views/syn... File chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc (right): https://codereview.chromium.org/2799163002/diff/1/chrome/browser/ui/views/syn... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:228: explanation_columns->AddPaddingColumn(0.0, button_margin); On 2017/04/06 03:09:56, tapted wrote: > On 2017/04/06 02:17:19, Patti Lor wrote: > > Not sure if these two should also be |panel_margin| (same as the |prompt_bar| > > above)? > > |prompt_bar| is the host passed to GridLayout::CreatePanel which was using > kButtonHEdgeMarginNew for horizontal until recently. Now it's > InsetsMetric::PANEL, which gives LayoutDelegate::Metric::DIALOG_BUTTON_MARGIN > under harmony for horizontal. > > So I think this is fine - button_margin is the correct horizontal padding. > > But this could be clearer. > > I think the nicer approach would be to remove |panel_margin| and > |button_margin|, and do: > > > const gfx::Insets panel_insets = > ViewsDelegate::GetInstance()->GetInsetsMetric(InsetsMetric::PANEL); > > // The prompt bar needs to go to the edge of the dialog, so ignore insets for > the outer layout. > views::GridLayout* dialog_layout = new views::GridLayout(this); > dialog_layout->SetInsets(panel_insets.top(), 0, 0, 0); > SetLayoutManager(dialog_layout); > > ... > > dialog_layout->AddPaddingRow(0.0, panel_insets.bottom()); > constexpr int kExplanationColumnSetId = 1; > views::ColumnSet* explanation_columns = > dialog_layout->AddColumnSet(kExplanationColumnSetId); > explanation_columns->AddPaddingColumn(0.0, panel_insets.left()); > .. > explanation_columns->AddPaddingColumn(0.0, panel_insets.right()); > dialog_layout->StartRow(0, kExplanationColumnSetId); > Done.
lgtm - thanks!
patricialor@chromium.org changed reviewers: + pkasting@chromium.org
Hi Peter, PTAL? Thanks.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
LGTM https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... File chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc (right): https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:202: dialog_layout->SetInsets(panel_insets.top(), 0, 0, 0); FWIW, I think we should use the bottom inset here in place of the current bottom "0". That's a behavior change, but it seems like a correct one. https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:222: dialog_layout->AddPaddingRow(0.0, panel_insets.bottom()); I think you actually want the top inset again rather than the bottom one here. https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:223: constexpr int kExplanationColumnSetId = 1; Nit: I don't mind naming the column set like this, but maybe it makes sense to do so for set 0 above also?
Description was changed from ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. BUG=691897 ========== to ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. See https://drive.google.com/file/d/0BzEa5HU1aAqBOXBDazdRT245Wk0/view?usp=sharing for before/after screenshots of ProfileSigninConfirmationDialogViews. BUG=691897 ==========
Thanks for the review! I updated the CL description to include a link to before/after screenshots, since there are a few spacing (and thus size) changes. https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... File chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc (right): https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:202: dialog_layout->SetInsets(panel_insets.top(), 0, 0, 0); On 2017/04/06 06:12:39, Peter Kasting wrote: > FWIW, I think we should use the bottom inset here in place of the current bottom > "0". That's a behavior change, but it seems like a correct one. Done. https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:222: dialog_layout->AddPaddingRow(0.0, panel_insets.bottom()); On 2017/04/06 06:12:39, Peter Kasting wrote: > I think you actually want the top inset again rather than the bottom one here. Done. https://codereview.chromium.org/2799163002/diff/20001/chrome/browser/ui/views... chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc:223: constexpr int kExplanationColumnSetId = 1; On 2017/04/06 06:12:39, Peter Kasting wrote: > Nit: I don't mind naming the column set like this, but maybe it makes sense to > do so for set 0 above also? Done.
The CQ bit was checked by patricialor@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from tapted@chromium.org, pkasting@chromium.org Link to the patchset: https://codereview.chromium.org/2799163002/#ps40001 (title: "Review comments.")
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": 1491527711387790, "parent_rev": "849138699e4f0a7dfe4fb22d18cc05f576c3fdba", "commit_rev": "8b6a69f075e5f117b6a9df69cb42ebd6ffe52fa6"}
Message was sent while issue was closed.
Description was changed from ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. See https://drive.google.com/file/d/0BzEa5HU1aAqBOXBDazdRT245Wk0/view?usp=sharing for before/after screenshots of ProfileSigninConfirmationDialogViews. BUG=691897 ========== to ========== Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. Remove unnecessary includes for ui/views/layout/layout_constants.h and do some refactoring to remove references to layout constants in ProfileSigninConfirmationDialogViews under chrome/browser/ui/views/sync/*. See https://drive.google.com/file/d/0BzEa5HU1aAqBOXBDazdRT245Wk0/view?usp=sharing for before/after screenshots of ProfileSigninConfirmationDialogViews. BUG=691897 Review-Url: https://codereview.chromium.org/2799163002 Cr-Commit-Position: refs/heads/master@{#462771} Committed: https://chromium.googlesource.com/chromium/src/+/8b6a69f075e5f117b6a9df69cb42... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/8b6a69f075e5f117b6a9df69cb42... |