| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PUBLIC_CPP_SHELL_CLIENT_H_ | 5 #ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ |
| 6 #define MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ | 6 #define MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 const std::string& name, | 35 const std::string& name, |
| 36 uint32_t id, | 36 uint32_t id, |
| 37 uint32_t user_id = 0); | 37 uint32_t user_id = 0); |
| 38 | 38 |
| 39 // Called when a connection to this client is brokered by the shell. Override | 39 // Called when a connection to this client is brokered by the shell. Override |
| 40 // to expose services to the remote application. Return true if the connection | 40 // to expose services to the remote application. Return true if the connection |
| 41 // should succeed. Return false if the connection should be rejected and the | 41 // should succeed. Return false if the connection should be rejected and the |
| 42 // underlying pipe closed. The default implementation returns false. | 42 // underlying pipe closed. The default implementation returns false. |
| 43 virtual bool AcceptConnection(Connection* connection); | 43 virtual bool AcceptConnection(Connection* connection); |
| 44 | 44 |
| 45 // Called when ShellConnection's pipe to the Mojo Shell is closed. | 45 // Called when ShellConnection's ShellClient binding (i.e. the pipe the |
| 46 // | 46 // Mojo Shell has to talk to us over) is closed. A shell client may use this |
| 47 // Returning true from this method will cause ... | 47 // as a signal to terminate. |
| 48 // The default implementation returns true. | 48 virtual void ShellConnectionLost(); |
| 49 virtual bool ShellConnectionLost(); | |
| 50 | 49 |
| 51 private: | 50 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(ShellClient); | 51 DISALLOW_COPY_AND_ASSIGN(ShellClient); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace mojo | 54 } // namespace mojo |
| 56 | 55 |
| 57 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ | 56 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ |
| OLD | NEW |