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

Unified Diff: ui/views/examples/dialog_example.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/md_text_button.cc ('k') | ui/views/layout/grid_layout.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/dialog_example.cc
diff --git a/ui/views/examples/dialog_example.cc b/ui/views/examples/dialog_example.cc
index 56be1b86283acfd5b3a880fbecb92fb5510a5932..895db3cb490d7cf105ee814c6c6a934dfcc9063c 100644
--- a/ui/views/examples/dialog_example.cc
+++ b/ui/views/examples/dialog_example.cc
@@ -16,7 +16,7 @@
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/grid_layout.h"
#include "ui/views/layout/layout_constants.h"
-#include "ui/views/views_delegate.h"
+#include "ui/views/layout/layout_provider.h"
#include "ui/views/widget/widget.h"
#include "ui/views/window/dialog_client_view.h"
@@ -132,8 +132,8 @@ void DialogExample::CreateExampleView(View* container) {
const float kStretchy = 1.f;
const int horizontal_spacing =
- ViewsDelegate::GetInstance()->GetDistanceMetric(
- views::DistanceMetric::RELATED_BUTTON_HORIZONTAL);
+ views::LayoutProvider::Get()->GetDistanceMetric(
+ views::DISTANCE_RELATED_BUTTON_HORIZONTAL);
GridLayout* layout = GridLayout::CreatePanel(container);
container->SetLayoutManager(layout);
ColumnSet* column_set = layout->AddColumnSet(kFieldsColumnId);
@@ -186,10 +186,10 @@ void DialogExample::CreateExampleView(View* container) {
void DialogExample::StartRowWithLabel(GridLayout* layout, const char* label) {
const float kFixedVerticalResize = 0.f;
- layout->StartRowWithPadding(
- kFixedVerticalResize, kFieldsColumnId, kFixedVerticalResize,
- ViewsDelegate::GetInstance()->GetDistanceMetric(
- views::DistanceMetric::RELATED_CONTROL_VERTICAL));
+ layout->StartRowWithPadding(kFixedVerticalResize, kFieldsColumnId,
+ kFixedVerticalResize,
+ views::LayoutProvider::Get()->GetDistanceMetric(
+ views::DISTANCE_RELATED_CONTROL_VERTICAL));
layout->AddView(new Label(base::ASCIIToUTF16(label)));
}
« no previous file with comments | « ui/views/controls/button/md_text_button.cc ('k') | ui/views/layout/grid_layout.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698