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/connection.h" | 13 #include "mojo/shell/public/cpp/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(Shell* shell, const std::string& url, | 24 void ShellApplicationDelegate::Initialize(Shell* shell, const std::string& url, |
25 uint32_t id) {} | 25 uint32_t id) {} |
26 bool ShellApplicationDelegate::AcceptConnection(Connection* connection) { | 26 bool ShellApplicationDelegate::AcceptConnection(Connection* connection) { |
27 connection->AddService<mojom::ApplicationManager>(this); | 27 connection->AddInterface<mojom::ApplicationManager>(this); |
28 return true; | 28 return true; |
29 } | 29 } |
30 | 30 |
31 void ShellApplicationDelegate::Create( | 31 void ShellApplicationDelegate::Create( |
32 Connection* connection, | 32 Connection* connection, |
33 InterfaceRequest<mojom::ApplicationManager> request) { | 33 InterfaceRequest<mojom::ApplicationManager> request) { |
34 bindings_.AddBinding(this, std::move(request)); | 34 bindings_.AddBinding(this, std::move(request)); |
35 } | 35 } |
36 | 36 |
37 void ShellApplicationDelegate::CreateInstanceForHandle( | 37 void ShellApplicationDelegate::CreateInstanceForHandle( |
38 ScopedHandle channel, | 38 ScopedHandle channel, |
39 const String& url, | 39 const String& url, |
40 mojom::CapabilityFilterPtr filter, | 40 mojom::CapabilityFilterPtr filter, |
41 InterfaceRequest<mojom::PIDReceiver> pid_receiver) { | 41 InterfaceRequest<mojom::PIDReceiver> pid_receiver) { |
42 manager_->CreateInstanceForHandle(std::move(channel), GURL(url.get()), | 42 manager_->CreateInstanceForHandle(std::move(channel), GURL(url.get()), |
43 std::move(filter), std::move(pid_receiver)); | 43 std::move(filter), std::move(pid_receiver)); |
44 } | 44 } |
45 | 45 |
46 void ShellApplicationDelegate::AddListener( | 46 void ShellApplicationDelegate::AddListener( |
47 mojom::ApplicationManagerListenerPtr listener) { | 47 mojom::ApplicationManagerListenerPtr listener) { |
48 manager_->AddListener(std::move(listener)); | 48 manager_->AddListener(std::move(listener)); |
49 } | 49 } |
50 | 50 |
51 } // namespace shell | 51 } // namespace shell |
52 } // namespace mojo | 52 } // namespace mojo |
OLD | NEW |