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

Unified Diff: mash/login/login.cc

Issue 2026623002: views/mus: Have explicit ownership of views::WindowManagerConnection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot-merge Created 4 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
Index: mash/login/login.cc
diff --git a/mash/login/login.cc b/mash/login/login.cc
index f10c45a377abe542795ea1718211ef5a82854f64..ee32b240cd48f1bec6662ed692c22afbe913cf49 100644
--- a/mash/login/login.cc
+++ b/mash/login/login.cc
@@ -40,9 +40,7 @@ class UI : public views::WidgetDelegateView,
const shell::Identity& identity,
Login* login) {
UI* ui = new UI(login, connector);
- ui->StartWindowManager();
-
- views::WindowManagerConnection::Create(connector, identity);
+ ui->StartWindowManager(identity);
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(
@@ -79,7 +77,7 @@ class UI : public views::WidgetDelegateView,
}
~UI() override {
// Prevent the window manager from restarting during graceful shutdown.
- window_manager_connection_->SetConnectionLostClosure(base::Closure());
+ mash_wm_connection_->SetConnectionLostClosure(base::Closure());
base::MessageLoop::current()->QuitWhenIdle();
}
@@ -114,10 +112,12 @@ class UI : public views::WidgetDelegateView,
// Overridden from views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
- void StartWindowManager() {
- window_manager_connection_ = connector_->Connect("mojo:ash");
- window_manager_connection_->SetConnectionLostClosure(
- base::Bind(&UI::StartWindowManager, base::Unretained(this)));
+ void StartWindowManager(const shell::Identity& identity) {
+ mash_wm_connection_ = connector_->Connect("mojo:ash");
+ mash_wm_connection_->SetConnectionLostClosure(
+ base::Bind(&UI::StartWindowManager, base::Unretained(this), identity));
+ window_manager_connection_ =
+ views::WindowManagerConnection::Create(connector_, identity);
}
Login* login_;
@@ -126,7 +126,8 @@ class UI : public views::WidgetDelegateView,
const std::string user_id_2_;
views::LabelButton* login_button_1_;
views::LabelButton* login_button_2_;
- std::unique_ptr<shell::Connection> window_manager_connection_;
+ std::unique_ptr<shell::Connection> mash_wm_connection_;
+ std::unique_ptr<views::WindowManagerConnection> window_manager_connection_;
DISALLOW_COPY_AND_ASSIGN(UI);
};
@@ -182,7 +183,6 @@ class Login : public shell::ShellClient,
std::unique_ptr<views::AuraInit> aura_init_;
mojo::BindingSet<mojom::Login> bindings_;
mus::mojom::UserAccessManagerPtr user_access_manager_;
- std::unique_ptr<shell::Connection> window_manager_connection_;
DISALLOW_COPY_AND_ASSIGN(Login);
};
« no previous file with comments | « mash/example/window_type_launcher/window_type_launcher.cc ('k') | mash/quick_launch/quick_launch_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698