| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 TaskViewer::~TaskViewer() {} | 277 TaskViewer::~TaskViewer() {} |
| 278 | 278 |
| 279 void TaskViewer::RemoveWindow(views::Widget* widget) { | 279 void TaskViewer::RemoveWindow(views::Widget* widget) { |
| 280 auto it = std::find(windows_.begin(), windows_.end(), widget); | 280 auto it = std::find(windows_.begin(), windows_.end(), widget); |
| 281 DCHECK(it != windows_.end()); | 281 DCHECK(it != windows_.end()); |
| 282 windows_.erase(it); | 282 windows_.erase(it); |
| 283 if (windows_.empty()) | 283 if (windows_.empty()) |
| 284 base::MessageLoop::current()->QuitWhenIdle(); | 284 base::MessageLoop::current()->QuitWhenIdle(); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void TaskViewer::OnStart(const service_manager::Identity& identity) { | 287 void TaskViewer::OnStart(const service_manager::ServiceInfo& info) { |
| 288 tracing_.Initialize(connector(), identity.name()); | 288 tracing_.Initialize(connector(), info.identity.name()); |
| 289 | 289 |
| 290 aura_init_.reset( | 290 aura_init_.reset( |
| 291 new views::AuraInit(connector(), "views_mus_resources.pak")); | 291 new views::AuraInit(connector(), "views_mus_resources.pak")); |
| 292 window_manager_connection_ = | 292 window_manager_connection_ = |
| 293 views::WindowManagerConnection::Create(connector(), identity); | 293 views::WindowManagerConnection::Create(connector(), info.identity); |
| 294 } | 294 } |
| 295 | 295 |
| 296 bool TaskViewer::OnConnect(const service_manager::Identity& remote_identity, | 296 bool TaskViewer::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 297 service_manager::InterfaceRegistry* registry) { | 297 service_manager::InterfaceRegistry* registry) { |
| 298 registry->AddInterface<mojom::Launchable>(this); | 298 registry->AddInterface<mojom::Launchable>(this); |
| 299 return true; | 299 return true; |
| 300 } | 300 } |
| 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(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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 |