OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mash/task_viewer/task_viewer.h" | 5 #include "mash/task_viewer/task_viewer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 301 |
302 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { | 302 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { |
303 bool reuse = how == mojom::LaunchMode::REUSE || | 303 bool reuse = how == mojom::LaunchMode::REUSE || |
304 how == mojom::LaunchMode::DEFAULT; | 304 how == mojom::LaunchMode::DEFAULT; |
305 if (reuse && !windows_.empty()) { | 305 if (reuse && !windows_.empty()) { |
306 windows_.back()->Activate(); | 306 windows_.back()->Activate(); |
307 return; | 307 return; |
308 } | 308 } |
309 | 309 |
310 service_manager::mojom::ServiceManagerPtr service_manager; | 310 service_manager::mojom::ServiceManagerPtr service_manager; |
311 connector()->ConnectToInterface("service:shell", &service_manager); | 311 connector()->ConnectToInterface("service:service_manager", &service_manager); |
312 | 312 |
313 service_manager::mojom::ServiceManagerListenerPtr listener; | 313 service_manager::mojom::ServiceManagerListenerPtr listener; |
314 service_manager::mojom::ServiceManagerListenerRequest request = | 314 service_manager::mojom::ServiceManagerListenerRequest request = |
315 GetProxy(&listener); | 315 GetProxy(&listener); |
316 service_manager->AddListener(std::move(listener)); | 316 service_manager->AddListener(std::move(listener)); |
317 | 317 |
318 catalog::mojom::CatalogPtr catalog; | 318 catalog::mojom::CatalogPtr catalog; |
319 connector()->ConnectToInterface("service:catalog", &catalog); | 319 connector()->ConnectToInterface("service:catalog", &catalog); |
320 | 320 |
321 TaskViewerContents* task_viewer = new TaskViewerContents( | 321 TaskViewerContents* task_viewer = new TaskViewerContents( |
322 this, std::move(request), std::move(catalog)); | 322 this, std::move(request), std::move(catalog)); |
323 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 323 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
324 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); | 324 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); |
325 window->Show(); | 325 window->Show(); |
326 windows_.push_back(window); | 326 windows_.push_back(window); |
327 } | 327 } |
328 | 328 |
329 void TaskViewer::Create(const service_manager::Identity& remote_identity, | 329 void TaskViewer::Create(const service_manager::Identity& remote_identity, |
330 mojom::LaunchableRequest request) { | 330 mojom::LaunchableRequest request) { |
331 bindings_.AddBinding(this, std::move(request)); | 331 bindings_.AddBinding(this, std::move(request)); |
332 } | 332 } |
333 | 333 |
334 } // namespace task_viewer | 334 } // namespace task_viewer |
335 } // namespace main | 335 } // namespace main |
OLD | NEW |