Chromium Code Reviews| 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_APPLICATION_PUBLIC_CPP_APPLICATION_DELEGATE_H_ | 5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_DELEGATE_H_ |
| 6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_DELEGATE_H_ | 6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "mojo/public/cpp/system/macros.h" | 10 #include "mojo/public/cpp/system/macros.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 // Override this method to configure what services a connection supports when | 32 // Override this method to configure what services a connection supports when |
| 33 // connecting to another app. | 33 // connecting to another app. |
| 34 // Return false to reject the connection entirely. | 34 // Return false to reject the connection entirely. |
| 35 virtual bool ConfigureOutgoingConnection(ApplicationConnection* connection); | 35 virtual bool ConfigureOutgoingConnection(ApplicationConnection* connection); |
| 36 | 36 |
| 37 // Called when an ApplicationConnection is about to close. After returning, | 37 // Called when an ApplicationConnection is about to close. After returning, |
| 38 // the |connection| object will be destroyed. | 38 // the |connection| object will be destroyed. |
| 39 virtual void OnWillCloseConnection(ApplicationConnection* connection) {} | 39 virtual void OnWillCloseConnection(ApplicationConnection* connection) {} |
| 40 | 40 |
| 41 // Called when the shell connection has a connection error. | |
| 42 // | |
| 43 // Return true to shutdown the application. Return false to skip shutting | |
| 44 // down the connection, but user is then required to call QuitNow() when done. | |
|
jam
2015/07/13 15:48:33
nit, to be clear, ApplicationImpl::QuitNow()?
| |
| 45 virtual bool OnShellConnectionError(); | |
|
jam
2015/07/13 15:48:33
nit: perhaps the method name would make things obv
| |
| 46 | |
| 41 // Called before ApplicationImpl::Terminate(). After returning from this call | 47 // Called before ApplicationImpl::Terminate(). After returning from this call |
| 42 // the delegate can no longer rely on the main run loop still running. | 48 // the delegate can no longer rely on the main run loop still running. |
| 43 virtual void Quit(); | 49 virtual void Quit(); |
| 44 | 50 |
| 45 private: | 51 private: |
| 46 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationDelegate); | 52 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationDelegate); |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 } // namespace mojo | 55 } // namespace mojo |
| 50 | 56 |
| 51 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_DELEGATE_H_ | 57 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_DELEGATE_H_ |
| OLD | NEW |