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

Unified Diff: services/ui/public/cpp/tests/test_window_tree_client_setup.h

Issue 2301353003: Changes ownership of WindowTreeClient (Closed)
Patch Set: fix navigation Created 4 years, 3 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 | « services/ui/demo/mus_demo.cc ('k') | services/ui/public/cpp/tests/test_window_tree_client_setup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/tests/test_window_tree_client_setup.h
diff --git a/services/ui/public/cpp/tests/test_window_tree_client_setup.h b/services/ui/public/cpp/tests/test_window_tree_client_setup.h
index 04f3961bd5a89fed4b5045ba92a8a9aa2c4327df..7f5ae7aa0ef2a31eeb590c8a861e29ba6b0d7343 100644
--- a/services/ui/public/cpp/tests/test_window_tree_client_setup.h
+++ b/services/ui/public/cpp/tests/test_window_tree_client_setup.h
@@ -8,7 +8,6 @@
#include <memory>
#include "base/macros.h"
-#include "services/ui/public/cpp/window_tree_client_observer.h"
namespace display {
class Display;
@@ -23,10 +22,10 @@ class WindowTreeClientDelegate;
// TestWindowTreeClientSetup is used to create a WindowTreeClient that is not
// connected to mus.
-class TestWindowTreeClientSetup : public ui::WindowTreeClientObserver {
+class TestWindowTreeClientSetup {
public:
TestWindowTreeClientSetup();
- ~TestWindowTreeClientSetup() override;
+ ~TestWindowTreeClientSetup();
// Initializes the WindowTreeClient.
void Init(WindowTreeClientDelegate* window_tree_delegate);
@@ -37,6 +36,9 @@ class TestWindowTreeClientSetup : public ui::WindowTreeClientObserver {
// The WindowTree that WindowTreeClient talks to.
TestWindowTree* window_tree() { return window_tree_.get(); }
+ // Returns ownership of WindowTreeClient to the caller.
+ std::unique_ptr<WindowTreeClient> OwnWindowTreeClient();
+
WindowTreeClient* window_tree_client();
private:
@@ -44,14 +46,8 @@ class TestWindowTreeClientSetup : public ui::WindowTreeClientObserver {
void CommonInit(WindowTreeClientDelegate* window_tree_delegate,
WindowManagerDelegate* window_manager_delegate);
- // ui::WindowTreeClientObserver:
- void OnDidDestroyClient(ui::WindowTreeClient* client) override;
-
std::unique_ptr<TestWindowTree> window_tree_;
- // See description of WindowTreeClientDelegate for details on ownership. The
- // WindowTreeClient may be deleted during shutdown by the test. If not,
- // we own it and must delete it.
std::unique_ptr<WindowTreeClient> window_tree_client_;
DISALLOW_COPY_AND_ASSIGN(TestWindowTreeClientSetup);
« no previous file with comments | « services/ui/demo/mus_demo.cc ('k') | services/ui/public/cpp/tests/test_window_tree_client_setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698