2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef XWALK_RUNTIME_BROWSER_WEB_VIEW_IMPL_H_
18 #define XWALK_RUNTIME_BROWSER_WEB_VIEW_IMPL_H_
20 #include <efl_extension.h>
21 #include <Elementary.h>
23 #include <EWebKit_internal.h>
28 #include "common/url.h"
29 #include "runtime/browser/web_view.h"
36 WebViewImpl(WebView* view, NativeWindow* window, Ewk_Context* context);
37 virtual ~WebViewImpl();
39 void LoadUrl(const std::string& url, const std::string& mime = std::string());
46 void SetVisibility(bool show);
47 bool EvalJavascript(const std::string& script);
48 void SetAppInfo(const std::string& app_name, const std::string& version);
49 bool SetUserAgent(const std::string& user_agent);
50 void SetCSPRule(const std::string& rule, bool report_only);
51 void SetDefaultEncoding(const std::string& encoding);
52 #ifdef PROFILE_WEARABLE
53 void SetBGColor(int r, int g, int b, int a);
56 void SetEventListener(WebView::EventListener* listener);
57 Evas_Object* evas_object() const;
60 void OnKeyEvent(Eext_Callback_Type key_type);
61 void OnRotation(int degree);
65 void InitKeyCallback();
66 void InitLoaderCallback();
67 void InitPolicyDecideCallback();
68 void InitQuotaExceededCallback();
69 void InitIPCMessageCallback();
70 void InitConsoleMessageCallback();
71 void InitCustomContextMenuCallback();
72 void InitRotationCallback();
73 void InitWindowCreateCallback();
74 void InitFullscreenCallback();
75 void InitNotificationPermissionCallback();
76 void InitGeolocationPermissionCallback();
77 void InitAuthenticationCallback();
78 void InitCertificateAllowCallback();
79 void InitPopupWaitCallback();
80 void InitUsermediaCallback();
81 void InitEditorClientImeCallback();
82 #ifdef ROTARY_EVENT_FEATURE_SUPPORT
83 void InitRotaryEventCallback();
84 #endif // ROTARY_EVENT_FEATURE_SUPPORT
86 std::function<bool (const char*, const char*, char**, void*)> mime_set_cb_;
88 NativeWindow* window_;
89 Ewk_Context* context_;
90 Evas_Object* ewk_view_;
91 WebView::EventListener* listener_;
92 int rotation_handler_id_;
94 std::map<const std::string, Evas_Smart_Cb> smart_callbacks_;
96 Evas_Smart* evas_smart_class_;
97 Ewk_View_Smart_Class ewk_smart_class_;
98 bool internal_popup_opened_;
102 } // namespace runtime
104 #endif // XWALK_RUNTIME_BROWSER_WEB_VIEW_IMPL_H_