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

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

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 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/label_button.cc ('k') | ui/views/examples/dialog_example.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 4453f2a2aa72f428b0e7519f9061938bcb93d4fb..9e9e780ac00a6f6ac199c18ea9678fa9da2351c9 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -19,9 +19,9 @@
#include "ui/views/border.h"
#include "ui/views/controls/button/blue_button.h"
#include "ui/views/controls/focus_ring.h"
+#include "ui/views/layout/layout_provider.h"
#include "ui/views/painter.h"
#include "ui/views/style/platform_style.h"
-#include "ui/views/views_delegate.h"
namespace views {
@@ -193,8 +193,8 @@ MdTextButton::MdTextButton(ButtonListener* listener)
set_has_ink_drop_action_on_click(true);
SetHorizontalAlignment(gfx::ALIGN_CENTER);
SetFocusForPlatform();
- const int minimum_width = ViewsDelegate::GetInstance()->GetDistanceMetric(
- DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH);
+ const int minimum_width = LayoutProvider::Get()->GetDistanceMetric(
+ DISTANCE_DIALOG_BUTTON_MINIMUM_WIDTH);
SetMinSize(gfx::Size(minimum_width, 0));
SetFocusPainter(nullptr);
label()->SetAutoColorReadabilityEnabled(false);
@@ -240,9 +240,8 @@ 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 horizontal_padding =
- ViewsDelegate::GetInstance()->GetDistanceMetric(
- DistanceMetric::BUTTON_HORIZONTAL_PADDING);
+ const int horizontal_padding = LayoutProvider::Get()->GetDistanceMetric(
+ DISTANCE_BUTTON_HORIZONTAL_PADDING);
SetBorder(CreateEmptyBorder(top_padding, horizontal_padding, bottom_padding,
horizontal_padding));
}
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/examples/dialog_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698