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

Unified Diff: ui/views/window/dialog_client_view.cc

Issue 1926943002: Introduce new flag to control usage of MD in secondary (not top-chrome) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve docs 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
Index: ui/views/window/dialog_client_view.cc
diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc
index e93e980ae472b1918ce4d05f03faf54ad2d674e1..3c49753516513de8d32779b679efc9d2f3cb92b1 100644
--- a/ui/views/window/dialog_client_view.cc
+++ b/ui/views/window/dialog_client_view.cc
@@ -7,10 +7,12 @@
#include <algorithm>
#include "build/build_config.h"
+#include "ui/base/material_design/material_design_controller.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/views/background.h"
#include "ui/views/controls/button/blue_button.h"
#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/button/md_text_button.h"
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_delegate.h"
@@ -308,10 +310,15 @@ LabelButton* DialogClientView::CreateDialogButton(ui::DialogButton type) {
if (GetDialogDelegate()->UseNewStyleForThisDialog() &&
GetDialogDelegate()->GetDefaultDialogButton() == type &&
GetDialogDelegate()->ShouldDefaultButtonBeBlue()) {
- button = new BlueButton(this, title);
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ MdTextButton* md_button = MdTextButton::CreateMdButton(this, title);
+ md_button->SetCallToAction(MdTextButton::STRONG_CALL_TO_ACTION);
+ button = md_button;
+ } else {
+ button = new BlueButton(this, title);
+ }
} else {
- button = new LabelButton(this, title);
- button->SetStyle(Button::STYLE_BUTTON);
+ button = MdTextButton::CreateSecondaryUiButton(this, title);
}
button->SetFocusBehavior(FocusBehavior::ALWAYS);
« ui/views/controls/button/label_button.h ('K') | « ui/views/controls/button/md_text_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698