| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 | 287 |
| 288 void TaskViewer::OnStart(const shell::Identity& identity) { | 288 void TaskViewer::OnStart(const shell::Identity& identity) { |
| 289 tracing_.Initialize(connector(), identity.name()); | 289 tracing_.Initialize(connector(), identity.name()); |
| 290 | 290 |
| 291 aura_init_.reset( | 291 aura_init_.reset( |
| 292 new views::AuraInit(connector(), "views_mus_resources.pak")); | 292 new views::AuraInit(connector(), "views_mus_resources.pak")); |
| 293 window_manager_connection_ = | 293 window_manager_connection_ = |
| 294 views::WindowManagerConnection::Create(connector(), identity); | 294 views::WindowManagerConnection::Create(connector(), identity); |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool TaskViewer::OnConnect(shell::Connection* connection) { | 297 bool TaskViewer::OnConnect(const shell::Identity& remote_identity, |
| 298 connection->AddInterface<mojom::Launchable>(this); | 298 shell::InterfaceRegistry* registry) { |
| 299 registry->AddInterface<mojom::Launchable>(this); |
| 299 return true; | 300 return true; |
| 300 } | 301 } |
| 301 | 302 |
| 302 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { | 303 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { |
| 303 bool reuse = how == mojom::LaunchMode::REUSE || | 304 bool reuse = how == mojom::LaunchMode::REUSE || |
| 304 how == mojom::LaunchMode::DEFAULT; | 305 how == mojom::LaunchMode::DEFAULT; |
| 305 if (reuse && !windows_.empty()) { | 306 if (reuse && !windows_.empty()) { |
| 306 windows_.back()->Activate(); | 307 windows_.back()->Activate(); |
| 307 return; | 308 return; |
| 308 } | 309 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 325 windows_.push_back(window); | 326 windows_.push_back(window); |
| 326 } | 327 } |
| 327 | 328 |
| 328 void TaskViewer::Create(const shell::Identity& remote_identity, | 329 void TaskViewer::Create(const shell::Identity& remote_identity, |
| 329 mojom::LaunchableRequest request) { | 330 mojom::LaunchableRequest request) { |
| 330 bindings_.AddBinding(this, std::move(request)); | 331 bindings_.AddBinding(this, std::move(request)); |
| 331 } | 332 } |
| 332 | 333 |
| 333 } // namespace task_viewer | 334 } // namespace task_viewer |
| 334 } // namespace main | 335 } // namespace main |
| OLD | NEW |