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
3 // found in the LICENSE file.
5 #ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_DELEGATE_H_
6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_DELEGATE_H_
10 #include "mojo/public/cpp/system/macros.h"
14 class ApplicationConnection;
15 class ApplicationImpl;
17 class ApplicationDelegate {
19 ApplicationDelegate();
20 virtual ~ApplicationDelegate();
22 // Implement this method to create the specific subclass of
23 // ApplicationDelegate. Ownership is taken by the caller. It will be deleted.
24 static ApplicationDelegate* Create();
26 virtual void Initialize(ApplicationImpl* app);
28 // Override this method to configure what services a connection supports when
29 // being connected to from an app.
30 // return false to reject the connection entirely.
31 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection);
33 // Override this method to configure what services a connection supports when
34 // connecting to another app.
35 // return false to reject the connection entirely.
36 virtual bool ConfigureOutgoingConnection(ApplicationConnection* connection);
39 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationDelegate);
44 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_DELEGATE_H_