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

Unified Diff: ui/views/test/test_views_delegate.h

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/test/scoped_views_test_helper.cc ('k') | ui/views/test/test_views_delegate_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/test_views_delegate.h
diff --git a/ui/views/test/test_views_delegate.h b/ui/views/test/test_views_delegate.h
index 222548f44ab182f2208c5af56c16da78ca5437dc..377ea061026102cfdedbb984c599b6ccd8c1b1e7 100644
--- a/ui/views/test/test_views_delegate.h
+++ b/ui/views/test/test_views_delegate.h
@@ -9,7 +9,7 @@
#include "base/macros.h"
#include "build/build_config.h"
-#include "ui/views/style/typography_provider.h"
+#include "ui/views/layout/layout_provider.h"
#include "ui/views/views_delegate.h"
namespace views {
@@ -40,6 +40,13 @@ class TestViewsDelegate : public ViewsDelegate {
context_factory_private_ = context_factory_private;
}
+ // For convenience, we create a layout provider by default, but embedders
+ // that use their own layout provider subclasses may need to set those classes
+ // as the layout providers for their tests.
+ void set_layout_provider(std::unique_ptr<LayoutProvider> layout_provider) {
+ layout_provider_.swap(layout_provider);
+ }
+
// ViewsDelegate:
#if defined(OS_WIN)
HICON GetSmallWindowIcon() const override;
@@ -48,14 +55,14 @@ class TestViewsDelegate : public ViewsDelegate {
internal::NativeWidgetDelegate* delegate) override;
ui::ContextFactory* GetContextFactory() override;
ui::ContextFactoryPrivate* GetContextFactoryPrivate() override;
- const TypographyProvider& GetTypographyProvider() const override;
private:
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;
bool use_desktop_native_widgets_;
bool use_transparent_windows_;
- DefaultTypographyProvider typography_provider_;
+ std::unique_ptr<LayoutProvider> layout_provider_ =
+ base::MakeUnique<LayoutProvider>();
DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
};
« no previous file with comments | « ui/views/test/scoped_views_test_helper.cc ('k') | ui/views/test/test_views_delegate_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698