summaryrefslogtreecommitdiffstats
path: root/mojo/shell/standalone/android/android_handler.h
blob: e58d3bf640bcb6c5715c72e2d60471124b418011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_SHELL_STANDALONE_ANDROID_ANDROID_HANDLER_H_
#define MOJO_SHELL_STANDALONE_ANDROID_ANDROID_HANDLER_H_

#include <jni.h>

#include "mojo/shell/public/cpp/application_delegate.h"
#include "mojo/shell/public/cpp/content_handler_factory.h"
#include "mojo/shell/public/cpp/interface_factory_impl.h"
#include "mojo/shell/public/interfaces/content_handler.mojom.h"

namespace base {
class FilePath;
}

namespace mojo {
namespace shell {

class AndroidHandler : public ApplicationDelegate,
                       public ContentHandlerFactory::Delegate {
 public:
  AndroidHandler();
  ~AndroidHandler();

 private:
  // ApplicationDelegate:
  void Initialize(Shell* shell, const std::string& url, uint32_t id) override;
  bool AcceptConnection(ApplicationConnection* connection) override;

  // ContentHandlerFactory::Delegate:
  void RunApplication(InterfaceRequest<mojom::Application> application_request,
                      URLResponsePtr response) override;

  ContentHandlerFactory content_handler_factory_;
  MOJO_DISALLOW_COPY_AND_ASSIGN(AndroidHandler);
};

bool RegisterAndroidHandlerJni(JNIEnv* env);

}  // namespace shell
}  // namespace mojo

#endif  // MOJO_SHELL_STANDALONE_ANDROID_ANDROID_HANDLER_H_