Index: mojo/shell/public/cpp/shell_client.h |
diff --git a/mojo/shell/public/cpp/application_delegate.h b/mojo/shell/public/cpp/shell_client.h |
similarity index 54% |
rename from mojo/shell/public/cpp/application_delegate.h |
rename to mojo/shell/public/cpp/shell_client.h |
index b0a537f7907200dbc5e0af240b75cae5a41ab6a0..e7c56d9d9b53108cf520471a476ab22b6b765ff8 100644 |
--- a/mojo/shell/public/cpp/application_delegate.h |
+++ b/mojo/shell/public/cpp/shell_client.h |
@@ -2,40 +2,43 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef MOJO_SHELL_PUBLIC_CPP_APPLICATION_DELEGATE_H_ |
-#define MOJO_SHELL_PUBLIC_CPP_APPLICATION_DELEGATE_H_ |
+#ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ |
+#define MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ |
#include <stdint.h> |
#include <string> |
#include "mojo/public/cpp/system/macros.h" |
+#include "mojo/shell/public/cpp/connection.h" |
namespace mojo { |
-class ApplicationConnection; |
-class ApplicationImpl; |
class Shell; |
// An abstract class that the application may subclass to control various |
// behaviors of ApplicationImpl. |
-class ApplicationDelegate { |
+class ShellClient { |
public: |
- ApplicationDelegate(); |
- virtual ~ApplicationDelegate(); |
+ ShellClient(); |
+ virtual ~ShellClient(); |
+ // Called once a bidirectional connection with the shell has been established. |
+ // |url| is the URL used to start the application. |id| is a unique identifier |
+ // the shell uses to identify this specific instance of the application. |
// Called exactly once before any other method. |
- virtual void Initialize(Shell* app, const std::string& url, uint32_t id); |
+ virtual void Initialize(Shell* shell, const std::string& url, uint32_t id); |
// Override this method to configure what services a connection supports when |
// being connected to from an app. |
- // Return false to reject the connection entirely. |
- virtual bool AcceptConnection(ApplicationConnection* connection); |
+ // Return false to reject the connection entirely. The default implementation |
+ // returns false. |
+ virtual bool AcceptConnection(Connection* connection); |
// Called when the shell connection has a connection error. |
// |
// Return true to shutdown the application. Return false to skip shutting |
// down the connection, but user is then required to call |
- // ApplicationImpl::QuitNow() when done. |
+ // ApplicationImpl::QuitNow() when done. Default implementation returns true. |
virtual bool ShellConnectionLost(); |
// Called before ApplicationImpl::Terminate(). After returning from this call |
@@ -43,9 +46,9 @@ class ApplicationDelegate { |
virtual void Quit(); |
private: |
- MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationDelegate); |
+ MOJO_DISALLOW_COPY_AND_ASSIGN(ShellClient); |
}; |
} // namespace mojo |
-#endif // MOJO_SHELL_PUBLIC_CPP_APPLICATION_DELEGATE_H_ |
+#endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_ |