| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 tracing_.Initialize(context()->connector(), context()->identity().name()); | 295 tracing_.Initialize(context()->connector(), context()->identity().name()); |
| 296 | 296 |
| 297 aura_init_ = base::MakeUnique<views::AuraInit>( | 297 aura_init_ = base::MakeUnique<views::AuraInit>( |
| 298 context()->connector(), context()->identity(), "views_mus_resources.pak"); | 298 context()->connector(), context()->identity(), "views_mus_resources.pak"); |
| 299 window_manager_connection_ = views::WindowManagerConnection::Create( | 299 window_manager_connection_ = views::WindowManagerConnection::Create( |
| 300 context()->connector(), context()->identity()); | 300 context()->connector(), context()->identity()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 bool TaskViewer::OnConnect(const service_manager::ServiceInfo& remote_info, | 303 bool TaskViewer::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 304 service_manager::InterfaceRegistry* registry) { | 304 service_manager::InterfaceRegistry* registry) { |
| 305 registry->AddInterface<mojom::Launchable>(this); | 305 registry->AddInterface<::mash::mojom::Launchable>(this); |
| 306 return true; | 306 return true; |
| 307 } | 307 } |
| 308 | 308 |
| 309 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { | 309 void TaskViewer::Launch(uint32_t what, mojom::LaunchMode how) { |
| 310 bool reuse = how == mojom::LaunchMode::REUSE || | 310 bool reuse = how == mojom::LaunchMode::REUSE || |
| 311 how == mojom::LaunchMode::DEFAULT; | 311 how == mojom::LaunchMode::DEFAULT; |
| 312 if (reuse && !windows_.empty()) { | 312 if (reuse && !windows_.empty()) { |
| 313 windows_.back()->Activate(); | 313 windows_.back()->Activate(); |
| 314 return; | 314 return; |
| 315 } | 315 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 329 | 329 |
| 330 TaskViewerContents* task_viewer = new TaskViewerContents( | 330 TaskViewerContents* task_viewer = new TaskViewerContents( |
| 331 this, std::move(request), std::move(catalog)); | 331 this, std::move(request), std::move(catalog)); |
| 332 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 332 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
| 333 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); | 333 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); |
| 334 window->Show(); | 334 window->Show(); |
| 335 windows_.push_back(window); | 335 windows_.push_back(window); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void TaskViewer::Create(const service_manager::Identity& remote_identity, | 338 void TaskViewer::Create(const service_manager::Identity& remote_identity, |
| 339 mojom::LaunchableRequest request) { | 339 ::mash::mojom::LaunchableRequest request) { |
| 340 bindings_.AddBinding(this, std::move(request)); | 340 bindings_.AddBinding(this, std::move(request)); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace task_viewer | 343 } // namespace task_viewer |
| 344 } // namespace main | 344 } // namespace main |
| OLD | NEW |