Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: mojo/shell/public/cpp/shell_client.h

Issue 1675083002: Rename ApplicationDelegate to ShellClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/public/cpp/shell.h ('k') | mojo/shell/public/cpp/tests/service_registry_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_APPLICATION_DELEGATE_H_ 5 #ifndef MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_
6 #define MOJO_SHELL_PUBLIC_CPP_APPLICATION_DELEGATE_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
11 #include "mojo/public/cpp/system/macros.h" 11 #include "mojo/public/cpp/system/macros.h"
12 #include "mojo/shell/public/cpp/connection.h"
12 13
13 namespace mojo { 14 namespace mojo {
14 15
15 class ApplicationConnection;
16 class ApplicationImpl;
17 class Shell; 16 class Shell;
18 17
19 // An abstract class that the application may subclass to control various 18 // An abstract class that the application may subclass to control various
20 // behaviors of ApplicationImpl. 19 // behaviors of ApplicationImpl.
21 class ApplicationDelegate { 20 class ShellClient {
22 public: 21 public:
23 ApplicationDelegate(); 22 ShellClient();
24 virtual ~ApplicationDelegate(); 23 virtual ~ShellClient();
25 24
25 // Called once a bidirectional connection with the shell has been established.
26 // |url| is the URL used to start the application. |id| is a unique identifier
27 // the shell uses to identify this specific instance of the application.
26 // Called exactly once before any other method. 28 // Called exactly once before any other method.
27 virtual void Initialize(Shell* app, const std::string& url, uint32_t id); 29 virtual void Initialize(Shell* shell, const std::string& url, uint32_t id);
28 30
29 // Override this method to configure what services a connection supports when 31 // Override this method to configure what services a connection supports when
30 // being connected to from an app. 32 // being connected to from an app.
31 // Return false to reject the connection entirely. 33 // Return false to reject the connection entirely. The default implementation
32 virtual bool AcceptConnection(ApplicationConnection* connection); 34 // returns false.
35 virtual bool AcceptConnection(Connection* connection);
33 36
34 // Called when the shell connection has a connection error. 37 // Called when the shell connection has a connection error.
35 // 38 //
36 // Return true to shutdown the application. Return false to skip shutting 39 // Return true to shutdown the application. Return false to skip shutting
37 // down the connection, but user is then required to call 40 // down the connection, but user is then required to call
38 // ApplicationImpl::QuitNow() when done. 41 // ApplicationImpl::QuitNow() when done. Default implementation returns true.
39 virtual bool ShellConnectionLost(); 42 virtual bool ShellConnectionLost();
40 43
41 // Called before ApplicationImpl::Terminate(). After returning from this call 44 // Called before ApplicationImpl::Terminate(). After returning from this call
42 // the delegate can no longer rely on the main run loop still running. 45 // the delegate can no longer rely on the main run loop still running.
43 virtual void Quit(); 46 virtual void Quit();
44 47
45 private: 48 private:
46 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationDelegate); 49 MOJO_DISALLOW_COPY_AND_ASSIGN(ShellClient);
47 }; 50 };
48 51
49 } // namespace mojo 52 } // namespace mojo
50 53
51 #endif // MOJO_SHELL_PUBLIC_CPP_APPLICATION_DELEGATE_H_ 54 #endif // MOJO_SHELL_PUBLIC_CPP_SHELL_CLIENT_H_
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/shell.h ('k') | mojo/shell/public/cpp/tests/service_registry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698