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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 307 |
308 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { | 308 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { |
309 bool reuse = how == mojom::LaunchMode::REUSE || | 309 bool reuse = how == mojom::LaunchMode::REUSE || |
310 how == mojom::LaunchMode::DEFAULT; | 310 how == mojom::LaunchMode::DEFAULT; |
311 if (reuse && !windows_.empty()) { | 311 if (reuse && !windows_.empty()) { |
312 windows_.back()->Activate(); | 312 windows_.back()->Activate(); |
313 return; | 313 return; |
314 } | 314 } |
315 | 315 |
316 service_manager::mojom::ServiceManagerPtr service_manager; | 316 service_manager::mojom::ServiceManagerPtr service_manager; |
317 context()->connector()->ConnectToInterface( | 317 context()->connector()->BindInterface(service_manager::mojom::kServiceName, |
318 service_manager::mojom::kServiceName, &service_manager); | 318 &service_manager); |
319 | 319 |
320 service_manager::mojom::ServiceManagerListenerPtr listener; | 320 service_manager::mojom::ServiceManagerListenerPtr listener; |
321 service_manager::mojom::ServiceManagerListenerRequest request(&listener); | 321 service_manager::mojom::ServiceManagerListenerRequest request(&listener); |
322 service_manager->AddListener(std::move(listener)); | 322 service_manager->AddListener(std::move(listener)); |
323 | 323 |
324 catalog::mojom::CatalogPtr catalog; | 324 catalog::mojom::CatalogPtr catalog; |
325 context()->connector()->ConnectToInterface(catalog::mojom::kServiceName, | 325 context()->connector()->BindInterface(catalog::mojom::kServiceName, &catalog); |
326 &catalog); | |
327 | 326 |
328 TaskViewerContents* task_viewer = new TaskViewerContents( | 327 TaskViewerContents* task_viewer = new TaskViewerContents( |
329 this, std::move(request), std::move(catalog)); | 328 this, std::move(request), std::move(catalog)); |
330 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 329 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
331 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); | 330 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); |
332 window->Show(); | 331 window->Show(); |
333 windows_.push_back(window); | 332 windows_.push_back(window); |
334 } | 333 } |
335 | 334 |
336 void TaskViewer::Create(const service_manager::Identity& remote_identity, | 335 void TaskViewer::Create(const service_manager::Identity& remote_identity, |
337 ::mash::mojom::LaunchableRequest request) { | 336 ::mash::mojom::LaunchableRequest request) { |
338 bindings_.AddBinding(this, std::move(request)); | 337 bindings_.AddBinding(this, std::move(request)); |
339 } | 338 } |
340 | 339 |
341 } // namespace task_viewer | 340 } // namespace task_viewer |
342 } // namespace main | 341 } // namespace main |
OLD | NEW |