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

Unified Diff: chrome/browser/ui/views/passwords/credentials_selection_view.cc

Issue 2869683003: Views/Harmony: Remove references to layout constants in c/b/u/v/passwords. (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/browser/ui/views/passwords/credentials_selection_view.cc
diff --git a/chrome/browser/ui/views/passwords/credentials_selection_view.cc b/chrome/browser/ui/views/passwords/credentials_selection_view.cc
index 15832cb9951c117e5961df84daf8fc0ce841aa82..5a125f7ef5890a558059a44f49b8043b5d03c136 100644
--- a/chrome/browser/ui/views/passwords/credentials_selection_view.cc
+++ b/chrome/browser/ui/views/passwords/credentials_selection_view.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
+#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "ui/base/models/simple_combobox_model.h"
#include "ui/base/resource/resource_bundle.h"
@@ -14,14 +15,13 @@
#include "ui/views/controls/combobox/combobox.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/grid_layout.h"
-#include "ui/views/layout/layout_constants.h"
namespace {
views::Label* GeneratePasswordLabel(const autofill::PasswordForm& form) {
views::Label* label = new views::Label(form.password_value);
tapted 2017/05/10 05:30:11 CONTEXT_DEPRECATED_SMALL to the constructor
Patti Lor 2017/05/11 06:59:18 Done.
- label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList(
- ui::ResourceBundle::SmallFont));
+ label->SetFontList(views::style::GetFont(views::style::CONTEXT_LABEL,
+ views::style::STYLE_PRIMARY));
label->SetHorizontalAlignment(gfx::ALIGN_CENTER);
label->SetObscured(true);
return label;
@@ -47,14 +47,18 @@ CredentialsSelectionView::CredentialsSelectionView(
views::ColumnSet* column_set = layout->AddColumnSet(column_set_id);
column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
views::GridLayout::FIXED, 0, 0);
- column_set->AddPaddingColumn(0, views::kItemLabelSpacing);
+ ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get();
+ const int inner_padding =
+ layout_provider->GetDistanceMetric(DISTANCE_RELATED_LABEL_HORIZONTAL);
+ column_set->AddPaddingColumn(0, inner_padding);
column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
views::GridLayout::FIXED, 0, 0);
- column_set->AddPaddingColumn(0, views::kItemLabelSpacing);
+ column_set->AddPaddingColumn(0, inner_padding);
// The username combobox and password label.
layout->StartRowWithPadding(0, column_set_id, 0,
- views::kRelatedControlVerticalSpacing);
+ layout_provider->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
Patti Lor 2017/05/11 06:59:18 Deleted this, because I realised that this is alwa
GenerateUsernameCombobox(
manage_passwords_bubble_model->pending_password().username_value);
layout->AddView(combobox_.get());

Powered by Google App Engine
This is Rietveld 408576698