Chromium Code Reviews| 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 cf50c1c6182b6d613c33ac53ce8d0fbfa7feace7..82817517d4ee906b211c71e9a5da419330928b4c 100644 |
| --- a/ui/views/window/dialog_client_view.cc |
| +++ b/ui/views/window/dialog_client_view.cc |
| @@ -15,6 +15,7 @@ |
| #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/style/platform_style.h" |
| #include "ui/views/views_delegate.h" |
| #include "ui/views/widget/widget.h" |
| #include "ui/views/window/dialog_delegate.h" |
| @@ -322,10 +323,15 @@ void DialogClientView::ChildVisibilityChanged(View* child) { |
| LabelButton* DialogClientView::CreateDialogButton(ui::DialogButton type) { |
| const base::string16 title = GetDialogDelegate()->GetDialogButtonLabel(type); |
| LabelButton* button = nullptr; |
| + |
| + const bool is_default = |
| + GetDialogDelegate()->GetDefaultDialogButton() == type && |
| + (type != ui::DIALOG_BUTTON_CANCEL || |
|
karandeepb
2017/01/04 07:46:51
This is similar to what we do in DialogDelegate::U
tapted
2017/01/04 23:11:40
IMO the nicer fix would be to merge the Blue/Regul
|
| + PlatformStyle::kDialogDefaultButtonCanBeCancel); |
| + |
| // The default button is always blue in Harmony. |
| - if (GetDialogDelegate()->GetDefaultDialogButton() == type && |
| - (ui::MaterialDesignController::IsSecondaryUiMaterial() || |
| - GetDialogDelegate()->ShouldDefaultButtonBeBlue())) { |
| + if (is_default && (ui::MaterialDesignController::IsSecondaryUiMaterial() || |
| + GetDialogDelegate()->ShouldDefaultButtonBeBlue())) { |
| button = MdTextButton::CreateSecondaryUiBlueButton(this, title); |
| } else { |
| button = MdTextButton::CreateSecondaryUiButton(this, title); |