1 // Copyright 2015 Samsung Electronics Co, Ltd. 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 WRT_RUNTIME_WEB_APPLICATION_H_
6 #define WRT_RUNTIME_WEB_APPLICATION_H_
11 #include "runtime/web_view.h"
12 #include "extension/extension_server.h"
19 class WebApplication : public WebView::EventListener {
21 explicit WebApplication(const std::string& appid);
22 virtual ~WebApplication();
29 bool Initialize(NativeWindow* window);
30 std::string data_path() const { return app_data_path_; }
31 bool initialized() const { return initialized_; }
33 virtual void OnCreatedNewWebView(WebView* view, WebView* new_view);
34 virtual void OnClosedWebView(WebView * view);
35 virtual void OnRendered(WebView* view);
36 virtual void OnReceivedWrtMessage(WebView* view,
37 Ewk_IPC_Wrt_Message_Data* message);
38 virtual void OnOrientationLock(WebView* view,
40 int preferred_rotation);
41 virtual void OnHardwareKey(WebView* view, const std::string& keyname);
44 void ClearViewStack();
45 void SendAppControlEvent();
49 Ewk_Context* ewk_context_;
50 NativeWindow* window_;
51 ExtensionServer* extension_server_;
52 std::list<WebView*> view_stack_;
53 std::string app_data_path_;
58 #endif // WRT_RUNTIME_WEB_APPLICATION_H_