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 #ifndef MOJO_SHELL_CONNECT_UTIL_H_ | 5 #ifndef MOJO_SHELL_CONNECT_UTIL_H_ |
6 #define MOJO_SHELL_CONNECT_UTIL_H_ | 6 #define MOJO_SHELL_CONNECT_UTIL_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "mojo/public/cpp/bindings/interface_ptr.h" | 10 #include "mojo/public/cpp/bindings/interface_ptr.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u)); | 38 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u)); |
39 } | 39 } |
40 | 40 |
41 template <typename Interface> | 41 template <typename Interface> |
42 inline void ConnectToInterface(ApplicationManager* application_manager, | 42 inline void ConnectToInterface(ApplicationManager* application_manager, |
43 const Identity& source, | 43 const Identity& source, |
44 const GURL& application_url, | 44 const GURL& application_url, |
45 InterfacePtr<Interface>* ptr) { | 45 InterfacePtr<Interface>* ptr) { |
46 ScopedMessagePipeHandle service_handle = ConnectToInterfaceByName( | 46 ScopedMessagePipeHandle service_handle = ConnectToInterfaceByName( |
47 application_manager, source, | 47 application_manager, source, |
48 Identity(application_url, std::string(), mojom::Connector::kUserInherit, | 48 Identity(application_url, std::string(), mojom::Connector::kUserInherit), |
49 GetPermissiveCapabilityFilter()), | |
50 Interface::Name_); | 49 Interface::Name_); |
51 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u)); | 50 ptr->Bind(InterfacePtrInfo<Interface>(std::move(service_handle), 0u)); |
52 } | 51 } |
53 | 52 |
54 } // namespace shell | 53 } // namespace shell |
55 } // namespace mojo | 54 } // namespace mojo |
56 | 55 |
57 | 56 |
58 #endif // MOJO_SHELL_CONNECT_UTIL_H_ | 57 #endif // MOJO_SHELL_CONNECT_UTIL_H_ |
OLD | NEW |