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

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

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: fix windows Created 3 years, 9 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_item_view.cc
diff --git a/chrome/browser/ui/views/passwords/credentials_item_view.cc b/chrome/browser/ui/views/passwords/credentials_item_view.cc
index 8f0e4faeebcccb638ff3367b69bccefc66ae4777..41eece2c485f7a250a83eedbb2f1962a00942423 100644
--- a/chrome/browser/ui/views/passwords/credentials_item_view.cc
+++ b/chrome/browser/ui/views/passwords/credentials_item_view.cc
@@ -10,6 +10,7 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
#include "components/autofill/core/common/password_form.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/path.h"
@@ -90,17 +91,24 @@ CredentialsItemView::CredentialsItemView(
}
AddChildView(image_view_);
- ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
+ // TODO(tapted): Check these against the spec on http://crbug.com/651681.
+ const views::TextContext kLabelContext =
+ ui::MaterialDesignController::IsSecondaryUiMaterial()
+ ? views::TextContext::DIALOG_TEXT_SMALL
+ : views::TextContext::DEPRECATED_SMALL;
+ constexpr views::TextStyle kUpperLabelStyle = views::TextStyle::PRIMARY;
+ constexpr views::TextStyle kLowerLabelStyle = views::TextStyle::SECONDARY;
+
if (!upper_text.empty()) {
- upper_label_ = new views::Label(
- upper_text, rb->GetFontList(ui::ResourceBundle::SmallFont));
+ upper_label_ =
+ new views::Label(upper_text, kLabelContext, kUpperLabelStyle);
upper_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(upper_label_);
}
if (!lower_text.empty()) {
- lower_label_ = new views::Label(
- lower_text, rb->GetFontList(ui::ResourceBundle::SmallFont));
+ lower_label_ =
+ new views::Label(lower_text, kLabelContext, kLowerLabelStyle);
lower_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
lower_label_->SetMultiLine(true);
AddChildView(lower_label_);

Powered by Google App Engine
This is Rietveld 408576698