| 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 "mojo/shell/shell_application_delegate.h" | 5 #include "mojo/shell/shell_application_delegate.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/process/process.h" | 11 #include "base/process/process.h" |
| 12 #include "mojo/shell/application_manager.h" | 12 #include "mojo/shell/application_manager.h" |
| 13 #include "mojo/shell/public/cpp/application_connection.h" | 13 #include "mojo/shell/public/cpp/application_connection.h" |
| 14 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 14 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 namespace shell { | 17 namespace shell { |
| 18 | 18 |
| 19 ShellApplicationDelegate::ShellApplicationDelegate( | 19 ShellApplicationDelegate::ShellApplicationDelegate( |
| 20 mojo::shell::ApplicationManager* manager) | 20 mojo::shell::ApplicationManager* manager) |
| 21 : manager_(manager) {} | 21 : manager_(manager) {} |
| 22 ShellApplicationDelegate::~ShellApplicationDelegate() {} | 22 ShellApplicationDelegate::~ShellApplicationDelegate() {} |
| 23 | 23 |
| 24 void ShellApplicationDelegate::Initialize(ApplicationImpl* app) {} | 24 void ShellApplicationDelegate::Initialize(Shell* shell, const std::string& url, |
| 25 uint32_t id) {} |
| 25 bool ShellApplicationDelegate::AcceptConnection( | 26 bool ShellApplicationDelegate::AcceptConnection( |
| 26 ApplicationConnection* connection) { | 27 ApplicationConnection* connection) { |
| 27 connection->AddService<mojom::ApplicationManager>(this); | 28 connection->AddService<mojom::ApplicationManager>(this); |
| 28 return true; | 29 return true; |
| 29 } | 30 } |
| 30 | 31 |
| 31 void ShellApplicationDelegate::Create( | 32 void ShellApplicationDelegate::Create( |
| 32 ApplicationConnection* connection, | 33 ApplicationConnection* connection, |
| 33 InterfaceRequest<mojom::ApplicationManager> request) { | 34 InterfaceRequest<mojom::ApplicationManager> request) { |
| 34 bindings_.AddBinding(this, std::move(request)); | 35 bindings_.AddBinding(this, std::move(request)); |
| 35 } | 36 } |
| 36 | 37 |
| 37 void ShellApplicationDelegate::CreateInstanceForHandle( | 38 void ShellApplicationDelegate::CreateInstanceForHandle( |
| 38 ScopedHandle channel, | 39 ScopedHandle channel, |
| 39 const String& url, | 40 const String& url, |
| 40 mojom::CapabilityFilterPtr filter, | 41 mojom::CapabilityFilterPtr filter, |
| 41 InterfaceRequest<mojom::PIDReceiver> pid_receiver) { | 42 InterfaceRequest<mojom::PIDReceiver> pid_receiver) { |
| 42 manager_->CreateInstanceForHandle(std::move(channel), GURL(url.get()), | 43 manager_->CreateInstanceForHandle(std::move(channel), GURL(url.get()), |
| 43 std::move(filter), std::move(pid_receiver)); | 44 std::move(filter), std::move(pid_receiver)); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void ShellApplicationDelegate::AddListener( | 47 void ShellApplicationDelegate::AddListener( |
| 47 mojom::ApplicationManagerListenerPtr listener) { | 48 mojom::ApplicationManagerListenerPtr listener) { |
| 48 manager_->AddListener(std::move(listener)); | 49 manager_->AddListener(std::move(listener)); |
| 49 } | 50 } |
| 50 | 51 |
| 51 } // namespace shell | 52 } // namespace shell |
| 52 } // namespace mojo | 53 } // namespace mojo |
| OLD | NEW |