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_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_ |
6 #define CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_ | 6 #define CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "mojo/shell/public/interfaces/shell_client.mojom.h" | 10 #include "mojo/shell/public/interfaces/shell_client.mojom.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // UsingExternalShell() for details of |is_external|. | 52 // UsingExternalShell() for details of |is_external|. |
53 static void Create(mojo::shell::mojom::ShellClientRequest request, | 53 static void Create(mojo::shell::mojom::ShellClientRequest request, |
54 bool is_external); | 54 bool is_external); |
55 | 55 |
56 virtual mojo::Connector* GetConnector() = 0; | 56 virtual mojo::Connector* GetConnector() = 0; |
57 | 57 |
58 // Indicates whether the shell connection is to an external shell (true) or | 58 // Indicates whether the shell connection is to an external shell (true) or |
59 // a shell embedded in the browser process (false). | 59 // a shell embedded in the browser process (false). |
60 virtual bool UsingExternalShell() const = 0; | 60 virtual bool UsingExternalShell() const = 0; |
61 | 61 |
| 62 // Sets a closure that is called when the connection is lost. |
| 63 virtual void SetConnectionLostClosure(const base::Closure& closure) = 0; |
| 64 |
62 // [De]Register an impl of Listener that will be consulted when the wrapped | 65 // [De]Register an impl of Listener that will be consulted when the wrapped |
63 // ShellConnection exposes services to inbound connections. | 66 // ShellConnection exposes services to inbound connections. |
64 // Registered listeners are owned by this MojoShellConnection. | 67 // Registered listeners are owned by this MojoShellConnection. |
65 virtual void AddListener(Listener* listener) = 0; | 68 virtual void AddListener(Listener* listener) = 0; |
66 virtual void RemoveListener(Listener* listener) = 0; | 69 virtual void RemoveListener(Listener* listener) = 0; |
67 | 70 |
68 protected: | 71 protected: |
69 virtual ~MojoShellConnection(); | 72 virtual ~MojoShellConnection(); |
70 }; | 73 }; |
71 | 74 |
72 } // namespace content | 75 } // namespace content |
73 | 76 |
74 #endif // CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_ | 77 #endif // CONTENT_PUBLIC_COMMON_MOJO_SHELL_CONNECTION_H_ |
OLD | NEW |