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 CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ |
6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 6 #define CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 // Connects an application at |url| and gets a handle to its exposed services. | 37 // Connects an application at |url| and gets a handle to its exposed services. |
38 // This is only intended for use in browser code that's not part of some Mojo | 38 // This is only intended for use in browser code that's not part of some Mojo |
39 // application. May be called from any thread. |requestor_url| is given to | 39 // application. May be called from any thread. |requestor_url| is given to |
40 // the target application as the requestor's URL upon connection. | 40 // the target application as the requestor's URL upon connection. |
41 static void ConnectToApplication( | 41 static void ConnectToApplication( |
42 const GURL& url, | 42 const GURL& url, |
43 const GURL& requestor_url, | 43 const GURL& requestor_url, |
44 mojo::shell::mojom::InterfaceProviderRequest request, | 44 mojo::shell::mojom::InterfaceProviderRequest request, |
45 mojo::shell::mojom::InterfaceProviderPtr exposed_services, | 45 mojo::shell::mojom::InterfaceProviderPtr exposed_services, |
46 const mojo::shell::CapabilityFilter& filter, | |
47 const mojo::shell::mojom::Connector::ConnectCallback& callback); | 46 const mojo::shell::mojom::Connector::ConnectCallback& callback); |
48 | 47 |
49 static void SetApplicationsForTest(const StaticApplicationMap* apps); | 48 static void SetApplicationsForTest(const StaticApplicationMap* apps); |
50 | 49 |
51 private: | 50 private: |
52 class Proxy; | 51 class Proxy; |
53 friend class Proxy; | 52 friend class Proxy; |
54 | 53 |
55 void ConnectToApplicationOnOwnThread( | 54 void ConnectToApplicationOnOwnThread( |
56 const GURL& url, | 55 const GURL& url, |
57 const GURL& requestor_url, | 56 const GURL& requestor_url, |
58 mojo::shell::mojom::InterfaceProviderRequest request, | 57 mojo::shell::mojom::InterfaceProviderRequest request, |
59 mojo::shell::mojom::InterfaceProviderPtr exposed_services, | 58 mojo::shell::mojom::InterfaceProviderPtr exposed_services, |
60 const mojo::shell::CapabilityFilter& filter, | |
61 const mojo::shell::mojom::Connector::ConnectCallback& callback); | 59 const mojo::shell::mojom::Connector::ConnectCallback& callback); |
62 | 60 |
63 static base::LazyInstance<scoped_ptr<Proxy>> proxy_; | 61 static base::LazyInstance<scoped_ptr<Proxy>> proxy_; |
64 | 62 |
65 scoped_ptr<mojo::shell::ApplicationManager> application_manager_; | 63 scoped_ptr<mojo::shell::ApplicationManager> application_manager_; |
66 | 64 |
67 DISALLOW_COPY_AND_ASSIGN(MojoShellContext); | 65 DISALLOW_COPY_AND_ASSIGN(MojoShellContext); |
68 }; | 66 }; |
69 | 67 |
70 } // namespace content | 68 } // namespace content |
71 | 69 |
72 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ | 70 #endif // CONTENT_BROWSER_MOJO_MOJO_SHELL_CONTEXT_H_ |
OLD | NEW |