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

Unified Diff: mash/task_viewer/task_viewer_application_delegate.cc

Issue 1645733002: mash: Terminate the task_viewer app when window is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/task_viewer/task_viewer_application_delegate.cc
diff --git a/mash/task_viewer/task_viewer_application_delegate.cc b/mash/task_viewer/task_viewer_application_delegate.cc
index 48595fef2c1b91c37aa470ac54c0960d19d812c8..8a4674e8a7cbc16437e63ff4c64d8d0fb0ab4b00 100644
--- a/mash/task_viewer/task_viewer_application_delegate.cc
+++ b/mash/task_viewer/task_viewer_application_delegate.cc
@@ -38,8 +38,9 @@ class TaskViewer : public views::WidgetDelegateView,
public views::ButtonListener,
public mojo::shell::mojom::ApplicationManagerListener {
public:
- explicit TaskViewer(ListenerRequest request)
+ TaskViewer(ListenerRequest request, scoped_ptr<mojo::AppRefCount> app)
: binding_(this, std::move(request)),
+ app_(std::move(app)),
table_view_(nullptr),
table_view_parent_(nullptr),
kill_button_(
@@ -199,6 +200,7 @@ class TaskViewer : public views::WidgetDelegateView,
}
mojo::Binding<mojo::shell::mojom::ApplicationManagerListener> binding_;
+ scoped_ptr<mojo::AppRefCount> app_;
views::TableView* table_view_;
views::View* table_view_parent_;
@@ -229,7 +231,8 @@ void TaskViewerApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
ListenerRequest request = GetProxy(&listener);
application_manager->AddListener(std::move(listener));
- TaskViewer* task_viewer = new TaskViewer(std::move(request));
+ TaskViewer* task_viewer = new TaskViewer(
+ std::move(request), app->app_lifetime_helper()->CreateAppRefCount());
views::Widget* window = views::Widget::CreateWindowWithBounds(
task_viewer, gfx::Rect(10, 10, 500, 500));
window->Show();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698