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

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

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy ash ViewsDelegate Created 5 years, 6 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/test_views_delegate_mac.mm ('k') | ui/views/test/views_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/views_test_base.h
diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h
index 933f60cd5135e45e583f97901188f4086758036a..17352ebf5d041f3a1c977278894d43acd9f9abb7 100644
--- a/ui/views/test/views_test_base.h
+++ b/ui/views/test/views_test_base.h
@@ -10,6 +10,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "ui/views/test/test_views_delegate.h"
+#include "ui/views/widget/widget.h"
#if defined(OS_WIN)
#include "ui/base/win/scoped_ole_initializer.h"
@@ -37,10 +38,10 @@ class ViewsTestBase : public PlatformTest {
Widget::InitParams CreateParams(Widget::InitParams::Type type);
protected:
- TestViewsDelegate& views_delegate() const { return *views_delegate_.get(); }
+ TestViewsDelegate* views_delegate() const { return views_delegate_.get(); }
- void set_views_delegate(TestViewsDelegate* views_delegate) {
- views_delegate_.reset(views_delegate);
+ void set_views_delegate(scoped_ptr<TestViewsDelegate> views_delegate) {
+ views_delegate_.swap(views_delegate);
}
base::MessageLoopForUI* message_loop() { return &message_loop_; }
« no previous file with comments | « ui/views/test/test_views_delegate_mac.mm ('k') | ui/views/test/views_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698