Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / xwalk / application / extension / application_runtime_extension.h
1 // Copyright (c) 2013 Intel Corporation. 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.
4
5 #ifndef XWALK_APPLICATION_EXTENSION_APPLICATION_RUNTIME_EXTENSION_H_
6 #define XWALK_APPLICATION_EXTENSION_APPLICATION_RUNTIME_EXTENSION_H_
7
8 #include <string>
9
10 #include "xwalk/extensions/browser/xwalk_extension_function_handler.h"
11 #include "xwalk/extensions/common/xwalk_extension.h"
12
13 namespace xwalk {
14 namespace application {
15 class Application;
16
17 using extensions::XWalkExtension;
18 using extensions::XWalkExtensionFunctionHandler;
19 using extensions::XWalkExtensionFunctionInfo;
20 using extensions::XWalkExtensionInstance;
21
22 class ApplicationRuntimeExtension : public XWalkExtension {
23  public:
24   explicit ApplicationRuntimeExtension(Application* application);
25
26   // XWalkExtension implementation.
27   XWalkExtensionInstance* CreateInstance() override;
28
29  private:
30   Application* application_;
31 };
32
33 class AppRuntimeExtensionInstance : public XWalkExtensionInstance {
34  public:
35   explicit AppRuntimeExtensionInstance(Application* application);
36
37   void HandleMessage(scoped_ptr<base::Value> msg) override;
38
39  private:
40   void OnGetManifest(scoped_ptr<XWalkExtensionFunctionInfo> info);
41
42   Application* application_;
43
44   XWalkExtensionFunctionHandler handler_;
45 };
46
47 }  // namespace application
48 }  // namespace xwalk
49
50 #endif  // XWALK_APPLICATION_EXTENSION_APPLICATION_RUNTIME_EXTENSION_H_