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

Unified Diff: chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc

Issue 2799163002: Views/Harmony: Remove references to layout constants in c/b/ui/views/sync. (Closed)
Patch Set: Review comments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/sync/one_click_signin_dialog_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
diff --git a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
index 838dd7863f74c1493d0e740013f1bda24f5920dc..3d81a4f9cbb41af8f9a4de242458b79b9e772307 100644
--- a/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
+++ b/chrome/browser/ui/views/sync/profile_signin_confirmation_dialog_views.cc
@@ -13,7 +13,6 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/views/harmony/layout_delegate.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
@@ -33,7 +32,7 @@
#include "ui/views/controls/styled_label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/grid_layout.h"
-#include "ui/views/layout/layout_constants.h"
+#include "ui/views/views_delegate.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
@@ -194,10 +193,13 @@ void ProfileSigninConfirmationDialogViews::ViewHierarchyChanged(
views::StyledLabel::RangeStyleInfo::CreateForLink());
// Layout the components.
- const int panel_margin = LayoutDelegate::Get()->GetMetric(
- LayoutDelegate::Metric::PANEL_CONTENT_MARGIN);
+ const gfx::Insets panel_insets =
+ views::ViewsDelegate::GetInstance()->GetInsetsMetric(
+ views::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_margin, 0, 0, 0);
+ dialog_layout->SetInsets(panel_insets.top(), 0, 0, 0);
Peter Kasting 2017/04/06 06:12:39 FWIW, I think we should use the bottom inset here
Patti Lor 2017/04/07 00:53:55 Done.
SetLayoutManager(dialog_layout);
// Use GridLayout inside the prompt bar because StyledLabel requires it.
@@ -217,14 +219,16 @@ void ProfileSigninConfirmationDialogViews::ViewHierarchyChanged(
views::GridLayout::FILL, views::GridLayout::FILL, 0, 0);
// Use a new column set for the explanation label so we can add padding.
- dialog_layout->AddPaddingRow(0.0, panel_margin);
- views::ColumnSet* explanation_columns = dialog_layout->AddColumnSet(1);
- explanation_columns->AddPaddingColumn(0.0, views::kButtonHEdgeMarginNew);
+ dialog_layout->AddPaddingRow(0.0, panel_insets.bottom());
Peter Kasting 2017/04/06 06:12:39 I think you actually want the top inset again rath
Patti Lor 2017/04/07 00:53:55 Done.
+ constexpr int kExplanationColumnSetId = 1;
Peter Kasting 2017/04/06 06:12:39 Nit: I don't mind naming the column set like this,
Patti Lor 2017/04/07 00:53:55 Done.
+ views::ColumnSet* explanation_columns =
+ dialog_layout->AddColumnSet(kExplanationColumnSetId);
+ explanation_columns->AddPaddingColumn(0.0, panel_insets.left());
explanation_columns->AddColumn(
views::GridLayout::FILL, views::GridLayout::FILL, 100,
views::GridLayout::USE_PREF, 0, 0);
- explanation_columns->AddPaddingColumn(0.0, views::kButtonHEdgeMarginNew);
- dialog_layout->StartRow(0, 1);
+ explanation_columns->AddPaddingColumn(0.0, panel_insets.right());
+ dialog_layout->StartRow(0, kExplanationColumnSetId);
const int kPreferredWidth = 440;
dialog_layout->AddView(explanation_label, 1, 1, views::GridLayout::FILL,
views::GridLayout::FILL, kPreferredWidth,
« no previous file with comments | « chrome/browser/ui/views/sync/one_click_signin_dialog_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698