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

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

Issue 2660553005: Harmony - convert hung renderer dialog. (Closed)
Patch Set: disable dialog test on osx Created 3 years, 10 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 | « chrome/test/BUILD.gn ('k') | ui/views/layout/layout_constants.h » ('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 46272dc61be0263e3c34d7438d1e3acfa100473e..19eeac35eadbaf759fd36b8d5f0a2bdea7585c4c 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -21,14 +21,12 @@
#include "ui/views/controls/focus_ring.h"
#include "ui/views/painter.h"
#include "ui/views/style/platform_style.h"
+#include "ui/views/views_delegate.h"
namespace views {
namespace {
-// Minimum size to reserve for the button contents.
-const int kMinWidth = 48;
-
LabelButton* CreateButton(ButtonListener* listener,
const base::string16& text,
bool md) {
@@ -195,7 +193,9 @@ MdTextButton::MdTextButton(ButtonListener* listener)
set_has_ink_drop_action_on_click(true);
SetHorizontalAlignment(gfx::ALIGN_CENTER);
SetFocusForPlatform();
- SetMinSize(gfx::Size(kMinWidth, 0));
+ const int minimum_width =
+ ViewsDelegate::GetInstance()->GetDialogButtonMinimumWidth();
+ SetMinSize(gfx::Size(minimum_width, 0));
SetFocusPainter(nullptr);
label()->SetAutoColorReadabilityEnabled(false);
set_request_focus_on_press(false);
@@ -240,9 +240,10 @@ void MdTextButton::UpdatePadding() {
// TODO(estade): can we get rid of the platform style border hoopla if
// we apply the MD treatment to all buttons, even GTK buttons?
- const int kHorizontalPadding = 16;
- SetBorder(CreateEmptyBorder(top_padding, kHorizontalPadding, bottom_padding,
- kHorizontalPadding));
+ const int horizontal_padding =
+ ViewsDelegate::GetInstance()->GetButtonHorizontalPadding();
+ SetBorder(CreateEmptyBorder(top_padding, horizontal_padding, bottom_padding,
+ horizontal_padding));
}
void MdTextButton::UpdateColors() {
« no previous file with comments | « chrome/test/BUILD.gn ('k') | ui/views/layout/layout_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698