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

Unified Diff: ui/views/controls/button/md_text_button.cc

Issue 1978403003: [MD] Eliminate as many SetStyle(STYLE_BUTTON) calls as possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
« no previous file with comments | « ui/views/controls/button/md_text_button.h ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/md_text_button.cc
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc
index 1036a2addf0ee7acf71f08671d10fccae9d46e37..5dfbe83e29defd19fb3aef427855d0eeaa88d74a 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -10,6 +10,7 @@
#include "ui/native_theme/native_theme.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
+#include "ui/views/controls/button/blue_button.h"
#include "ui/views/painter.h"
namespace views {
@@ -51,6 +52,19 @@ LabelButton* MdTextButton::CreateSecondaryUiButton(ButtonListener* listener,
}
// static
+LabelButton* MdTextButton::CreateSecondaryUiBlueButton(
+ ButtonListener* listener,
+ const base::string16& text) {
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ MdTextButton* md_button = MdTextButton::CreateMdButton(listener, text);
+ md_button->SetCallToAction(MdTextButton::STRONG_CALL_TO_ACTION);
+ return md_button;
+ }
+
+ return new BlueButton(listener, text);
+}
+
+// static
MdTextButton* MdTextButton::CreateMdButton(ButtonListener* listener,
const base::string16& text) {
MdTextButton* button = new MdTextButton(listener);
@@ -60,6 +74,7 @@ MdTextButton* MdTextButton::CreateMdButton(ButtonListener* listener,
button->SetBorder(
Border::CreateEmptyBorder(kVerticalPadding, kHorizontalPadding,
kVerticalPadding, kHorizontalPadding));
+ ConfigureDefaultFocus(button);
return button;
}
« no previous file with comments | « ui/views/controls/button/md_text_button.h ('k') | ui/views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698