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

Unified Diff: ash/system/toast/toast_overlay.cc

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)
Patch Set: placate gn check. new_avatar_button now just avatar_button 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: ash/system/toast/toast_overlay.cc
diff --git a/ash/system/toast/toast_overlay.cc b/ash/system/toast/toast_overlay.cc
index 8c0fcd946087a46c801a804cce4b35e2e9e0fedd..d87952106741a92478f631b6d1ed54d005321aeb 100644
--- a/ash/system/toast/toast_overlay.cc
+++ b/ash/system/toast/toast_overlay.cc
@@ -4,6 +4,7 @@
#include "ash/system/toast/toast_overlay.h"
+#include "ash/public/cpp/ash_typography.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/root_window_controller.h"
#include "ash/shelf/wm_shelf.h"
@@ -15,7 +16,6 @@
#include "base/threading/thread_task_runner_handle.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font_list.h"
#include "ui/views/border.h"
@@ -34,10 +34,6 @@ namespace {
// Offset of the overlay from the edge of the work area.
const int kOffset = 5;
-// Font style used for modifier key labels.
-const ui::ResourceBundle::FontStyle kTextFontStyle =
- ui::ResourceBundle::MediumFont;
-
// Duration of slide animation when overlay is shown or hidden.
const int kSlideAnimationDurationMs = 100;
@@ -71,12 +67,9 @@ class ToastOverlayLabel : public views::Label {
DISALLOW_COPY_AND_ASSIGN(ToastOverlayLabel);
};
-ToastOverlayLabel::ToastOverlayLabel(const base::string16& label) {
- ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
-
- SetText(label);
+ToastOverlayLabel::ToastOverlayLabel(const base::string16& label)
+ : Label(label, CONTEXT_TOAST_OVERLAY) {
SetHorizontalAlignment(gfx::ALIGN_LEFT);
- SetFontList(rb->GetFontList(kTextFontStyle));
SetAutoColorReadabilityEnabled(false);
SetMultiLine(true);
SetEnabledColor(SK_ColorWHITE);
@@ -107,15 +100,12 @@ class ToastOverlayButton : public views::LabelButton {
ToastOverlayButton::ToastOverlayButton(views::ButtonListener* listener,
const base::string16& text)
- : views::LabelButton(listener, text) {
+ : views::LabelButton(listener, text, CONTEXT_TOAST_OVERLAY) {
SetInkDropMode(InkDropMode::ON);
set_has_ink_drop_action_on_click(true);
set_ink_drop_base_color(SK_ColorWHITE);
- ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
-
SetEnabledTextColors(kButtonTextColor);
- SetFontList(rb->GetFontList(kTextFontStyle));
// Treat the space below the baseline as a margin.
int verticalSpacing = kToastVerticalSpacing -

Powered by Google App Engine
This is Rietveld 408576698