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

Unified Diff: ash/mus/window_manager_application.cc

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 | « ash/mus/window_manager_application.h ('k') | ash/mus/window_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/window_manager_application.cc
diff --git a/ash/mus/window_manager_application.cc b/ash/mus/window_manager_application.cc
index 6f3faa11ddd3b38a249430e7b210084902c0ed01..eae07e130d2e6929fe5446d29d9e953236268399 100644
--- a/ash/mus/window_manager_application.cc
+++ b/ash/mus/window_manager_application.cc
@@ -96,7 +96,7 @@ void WindowManagerApplication::OnAcceleratorRegistrarDestroyed(
}
void WindowManagerApplication::InitWindowManager(
- ui::WindowTreeClient* window_tree_client) {
+ std::unique_ptr<ui::WindowTreeClient> window_tree_client) {
InitializeComponents();
#if defined(OS_CHROMEOS)
// TODO(jamescook): Refactor StatisticsProvider so we can get just the data
@@ -107,7 +107,7 @@ void WindowManagerApplication::InitWindowManager(
statistics_provider_->SetMachineStatistic("initial_locale", "en-US");
statistics_provider_->SetMachineStatistic("keyboard_layout", "");
#endif
- window_manager_->Init(window_tree_client);
+ window_manager_->Init(std::move(window_tree_client));
}
void WindowManagerApplication::OnStart(const shell::Identity& identity) {
@@ -123,14 +123,15 @@ void WindowManagerApplication::OnStart(const shell::Identity& identity) {
tracing_.Initialize(connector(), identity.name());
- ui::WindowTreeClient* window_tree_client = new ui::WindowTreeClient(
- window_manager_.get(), window_manager_.get(), nullptr);
+ std::unique_ptr<ui::WindowTreeClient> window_tree_client =
+ base::MakeUnique<ui::WindowTreeClient>(window_manager_.get(),
+ window_manager_.get());
window_tree_client->ConnectAsWindowManager(connector());
native_widget_factory_mus_.reset(
new NativeWidgetFactoryMus(window_manager_.get()));
- InitWindowManager(window_tree_client);
+ InitWindowManager(std::move(window_tree_client));
}
bool WindowManagerApplication::OnConnect(const shell::Identity& remote_identity,
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | ash/mus/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698