1 // Copyright 2014 Samsung Electronics. 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.
8 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
9 // FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to
11 #include <appcore-agent/service_app.h>
20 #include "base/callback.h"
21 #include "base/containers/id_map.h"
22 #include "base/synchronization/waitable_event.h"
23 #include "browser/input_picker/input_picker.h"
24 #include "browser/selectpicker/popup_picker.h"
25 #include "content/browser/date_time_chooser_efl.h"
26 #include "content/browser/renderer_host/event_with_latency_info.h"
27 #include "content/browser/selection/selection_controller_efl.h"
28 #include "content/browser/web_contents/web_contents_view_aura.h"
29 #include "content/browser/web_contents/web_contents_view_aura_helper_efl.h"
30 #include "content/public/browser/context_menu_params.h"
31 #include "content/public/browser/navigation_controller.h"
32 #include "content/public/browser/quota_permission_context.h"
33 #include "content/public/browser/web_contents_delegate.h"
34 #include "content/public/browser/web_contents_efl_delegate.h"
35 #include "content/public/common/input_event_ack_state.h"
36 #include "content_browser_client_efl.h"
37 #include "context_menu_controller_efl.h"
38 #include "eweb_context.h"
39 #include "eweb_view_callbacks.h"
40 #include "file_chooser_controller_efl.h"
41 #include "permission_popup_manager.h"
42 #include "popup_controller_efl.h"
43 #include "private/ewk_auth_challenge_private.h"
44 #include "private/ewk_back_forward_list_private.h"
45 #include "private/ewk_history_private.h"
46 #include "private/ewk_hit_test_private.h"
47 #include "private/ewk_settings_private.h"
48 #include "private/ewk_web_application_icon_data_private.h"
49 #include "public/ewk_hit_test_internal.h"
50 #include "public/ewk_touch_internal.h"
51 #include "public/ewk_view_product.h"
52 #include "scroll_detector.h"
53 #include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
54 #include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
55 #include "third_party/blink/public/mojom/choosers/popup_menu.mojom.h"
56 #include "ui/aura/window_tree_host.h"
57 #include "ui/gfx/geometry/point.h"
58 #include "ui/gfx/geometry/size.h"
59 #include "web_contents_delegate_efl.h"
64 class WindowParentingClient;
73 class RenderFrameHost;
75 class RenderWidgetHostViewAura;
76 class WebContentsDelegateEfl;
77 class WebContentsViewAura;
78 class ContextMenuControllerEfl;
79 class PopupControllerEfl;
81 class GinNativeBridgeDispatcherHost;
82 class NavigationHandle;
86 class _Ewk_App_Control;
87 class _Ewk_Policy_Decision;
90 class WebViewEvasEventHandler;
91 class _Ewk_Quota_Permission_Request;
93 template <typename CallbackPtr, typename CallbackParameter>
94 class WebViewCallback {
96 WebViewCallback() { Set(nullptr, nullptr); }
98 void Set(CallbackPtr cb, void* data) {
103 bool IsCallbackSet() const { return callback_; }
105 Eina_Bool Run(Evas_Object* webview,
106 CallbackParameter param,
107 Eina_Bool* callback_result) {
108 CHECK(callback_result);
109 if (IsCallbackSet()) {
110 *callback_result = callback_(webview, param, user_data_);
116 void Run(Evas_Object* webview, CallbackParameter param) {
118 callback_(webview, param, user_data_);
122 CallbackPtr callback_;
126 template <typename CallbackReturnValue,
127 typename CallbackPtr,
128 typename CallbackParameter>
129 class WebViewCallbackWithReturnValue {
131 WebViewCallbackWithReturnValue() { Set(nullptr, nullptr); }
133 void Set(CallbackPtr cb, void* data) {
138 /* LCOV_EXCL_START */
139 bool IsCallbackSet() const { return callback_; }
141 CallbackReturnValue Run(Evas_Object* webview, CallbackParameter param) {
143 return callback_(webview, param, user_data_);
150 CallbackPtr callback_;
154 template <typename CallbackPtr, typename... CallbackParameter>
155 class WebViewExceededQuotaCallback {
157 WebViewExceededQuotaCallback() { Set(nullptr, nullptr); }
159 void Set(CallbackPtr cb, void* data) {
164 bool IsCallbackSet() const { return callback_; }
166 /* LCOV_EXCL_START */
167 void Run(Evas_Object* webview, CallbackParameter... param) {
169 callback_(webview, param..., user_data_);
174 CallbackPtr callback_;
178 class BackgroundColorGetCallback {
180 BackgroundColorGetCallback(Ewk_View_Background_Color_Get_Callback func,
182 : func_(func), user_data_(user_data) {}
184 void Run(Evas_Object* webview, int r, int g, int b, int a) {
186 func_(webview, r, g, b, a, user_data_);
190 Ewk_View_Background_Color_Get_Callback func_;
194 class WebApplicationIconUrlGetCallback {
196 WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func,
198 : func_(func), user_data_(user_data) {}
199 void Run(const std::string& url) {
201 (func_)(url.c_str(), user_data_);
206 Ewk_Web_App_Icon_URL_Get_Callback func_;
210 class WebApplicationIconUrlsGetCallback {
212 WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func,
214 : func_(func), user_data_(user_data) {}
215 void Run(const std::map<std::string, std::string>& urls) {
217 Eina_List* list = NULL;
218 for (std::map<std::string, std::string>::const_iterator it = urls.begin();
219 it != urls.end(); ++it) {
220 _Ewk_Web_App_Icon_Data* data =
221 ewkWebAppIconDataCreate(it->first, it->second);
222 list = eina_list_append(list, data);
224 (func_)(list, user_data_);
229 Ewk_Web_App_Icon_URLs_Get_Callback func_;
233 class WebApplicationCapableGetCallback {
235 WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func,
237 : func_(func), user_data_(user_data) {}
238 void Run(bool capable) {
240 (func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
245 Ewk_Web_App_Capable_Get_Callback func_;
249 class WebViewAsyncRequestHitTestDataCallback;
250 class JavaScriptDialogManagerEfl;
251 class PermissionPopupManager;
255 static EWebView* FromEvasObject(Evas_Object* eo);
257 EWebView(Ewk_Context*, Evas_Object* smart_object);
260 // initialize data members and activate event handlers.
261 // call this once after created and before use
264 bool CreateNewWindow(
265 content::WebContentsEflDelegate::WebContentsCreateCallback);
266 static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
268 content::WebContentsViewAura* wcva() const;
269 content::RenderWidgetHostViewAura* rwhva() const;
270 Ewk_Context* context() const { return context_.get(); }
271 Evas_Object* evas_object() const { return evas_object_; }
272 Evas_Object* native_view() const { return native_view_; }
273 Evas_Object* GetElmWindow() const;
274 Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
275 PermissionPopupManager* GetPermissionPopupManager() const {
276 return permission_popup_manager_.get();
279 content::WebContents& web_contents() const { return *web_contents_.get(); }
281 template <EWebViewCallbacks::CallbackType callbackType>
282 EWebViewCallbacks::CallBack<callbackType> SmartCallback() const {
283 return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
286 void set_magnifier(bool status);
289 void SetURL(const GURL& url, bool from_api = false);
290 const GURL& GetURL() const;
291 const GURL& GetOriginalURL() const;
293 void ReloadBypassingCache();
294 Eina_Bool CanGoBack();
295 Eina_Bool CanGoForward();
296 Eina_Bool HasFocus() const;
297 void SetFocus(Eina_Bool focus);
299 Eina_Bool GoForward();
303 void SetSessionTimeout(uint64_t timeout);
304 double GetTextZoomFactor() const;
305 void SetTextZoomFactor(double text_zoom_factor);
306 double GetPageZoomFactor() const;
307 void SetPageZoomFactor(double page_zoom_factor);
308 void ExecuteEditCommand(const char* command, const char* value);
309 void SetOrientation(int orientation);
310 int GetOrientation();
311 bool TouchEventsEnabled() const;
312 void SetTouchEventsEnabled(bool enabled);
313 bool MouseEventsEnabled() const;
314 void SetMouseEventsEnabled(bool enabled);
315 void HandleTouchEvents(Ewk_Touch_Event_Type type,
316 const Eina_List* points,
317 const Evas_Modifier* modifiers);
320 bool ExecuteJavaScript(const char* script,
321 Ewk_View_Script_Execute_Callback callback,
323 bool SetUserAgent(const char* userAgent);
324 bool SetUserAgentAppName(const char* application_name);
325 bool SetPrivateBrowsing(bool incognito);
326 bool GetPrivateBrowsing() const;
327 const char* GetUserAgent() const;
328 const char* GetUserAgentAppName() const;
329 const char* CacheSelectedText();
330 Ewk_Settings* GetSettings() { return settings_.get(); }
331 _Ewk_Frame* GetMainFrame();
332 void UpdateWebKitPreferences();
333 void LoadHTMLString(const char* html,
334 const char* base_uri,
335 const char* unreachable_uri);
336 void LoadPlainTextString(const char* plain_text);
337 void LoadData(const char* data,
339 const char* mime_type,
340 const char* encoding,
341 const char* base_uri,
342 const char* unreachable_uri = NULL);
344 void InvokeLoadError(const GURL& url, int error_code, bool is_cancellation);
346 void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
348 void InvokeAuthCallback(LoginDelegateEfl* login_delegate,
350 const std::string& realm);
351 void Find(const char* text, Ewk_Find_Options);
352 void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
353 void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
354 void HandlePopupMenu(std::vector<blink::mojom::MenuItemPtr> items,
357 void HidePopupMenu();
358 void UpdateFormNavigation(int formElementCount,
359 int currentNodeIndex,
362 void FormNavigate(bool direction);
363 bool FormIsNavigating() const { return formIsNavigating_; }
364 void SetFormIsNavigating(bool formIsNavigating);
365 Eina_Bool PopupMenuUpdate(Eina_List* items, int selectedIndex);
366 Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
367 Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
368 void PopupMenuClose();
369 void HandleLongPressGesture(const content::ContextMenuParams&);
370 void ShowContextMenu(const content::ContextMenuParams&);
371 void CancelContextMenu(int request_id);
372 void SetScale(double scale_factor);
373 void SetScaleChangedCallback(Ewk_View_Scale_Changed_Callback callback,
376 bool GetScrollPosition(int* x, int* y) const;
377 void SetScroll(int x, int y);
378 void UrlRequestSet(const char* url,
379 content::NavigationController::LoadURLType loadtype,
383 content::SelectionControllerEfl* GetSelectionController() const;
384 content::PopupControllerEfl* GetPopupController() const {
385 return popup_controller_.get();
387 ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
388 void MoveCaret(const gfx::Point& point);
389 void SelectLinkText(const gfx::Point& touch_point);
390 bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
391 Eina_Bool ClearSelection();
393 // Callback OnCopyFromBackingStore will be called once we get the snapshot
395 void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
400 void RenderViewReady();
403 * Creates a snapshot of given rectangle from EWebView
405 * @param rect rectangle of EWebView which will be taken into snapshot
406 * @param scale_factor scale factor
407 * @return created snapshot or NULL if error occured.
408 * @note ownership of snapshot is passed to caller
410 Evas_Object* GetSnapshot(Eina_Rectangle rect, float scale_factor);
412 bool GetSnapshotAsync(Eina_Rectangle rect,
413 Ewk_Web_App_Screenshot_Captured_Callback callback,
416 void InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision,
418 void InvokePolicyNavigationCallback(const NavigationPolicyParams& params,
420 void UseSettingsFont();
422 _Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
423 Eina_Bool AsyncRequestHitTestDataAt(int x,
425 Ewk_Hit_Test_Mode mode,
426 Ewk_View_Hit_Test_Request_Callback,
428 _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x,
430 Ewk_Hit_Test_Mode mode);
431 Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
434 Ewk_Hit_Test_Mode mode,
435 Ewk_View_Hit_Test_Request_Callback,
437 void DispatchAsyncHitTestData(const Hit_Test_Params& params,
439 void UpdateHitTestData(const Hit_Test_Params& params);
441 int current_find_request_id() const { return current_find_request_id_; }
442 bool PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
443 void InvokePlainTextGetCallback(const std::string& content_text,
444 int plain_text_get_callback_id);
445 int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback,
447 void SetViewGeolocationPermissionCallback(
448 Ewk_View_Geolocation_Permission_Callback callback,
450 bool InvokeViewGeolocationPermissionCallback(
451 _Ewk_Geolocation_Permission_Request*
452 geolocation_permission_request_context,
454 void SetViewUserMediaPermissionCallback(
455 Ewk_View_User_Media_Permission_Callback callback,
457 bool InvokeViewUserMediaPermissionCallback(
458 _Ewk_User_Media_Permission_Request* user_media_permission_request_context,
460 void SetViewUserMediaPermissionQueryCallback(
461 Ewk_View_User_Media_Permission_Query_Callback callback,
463 Ewk_User_Media_Permission_Query_Result
464 InvokeViewUserMediaPermissionQueryCallback(
465 _Ewk_User_Media_Permission_Query* user_media_permission_query_context);
466 void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback,
468 bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
470 void DidChangeContentsSize(int width, int height);
471 const Eina_Rectangle GetContentsSize() const;
472 void GetScrollSize(int* w, int* h);
474 void SetProgressValue(double progress);
475 double GetProgressValue();
476 const char* GetTitle();
477 bool SaveAsPdf(int width, int height, const std::string& file_name);
478 void BackForwardListClear();
479 _Ewk_Back_Forward_List* GetBackForwardList() const;
480 void InvokeBackForwardListChangedCallback();
481 _Ewk_History* GetBackForwardHistory() const;
482 bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback,
484 bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback,
486 bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback,
488 void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
489 void InvokeWebAppIconUrlGetCallback(const std::string& iconUrl,
491 void InvokeWebAppIconUrlsGetCallback(
492 const std::map<std::string, std::string>& iconUrls,
494 void SetNotificationPermissionCallback(
495 Ewk_View_Notification_Permission_Callback callback,
497 bool IsNotificationPermissionCallbackSet() const;
498 bool InvokeNotificationPermissionCallback(
499 Ewk_Notification_Permission_Request* request);
501 bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
502 void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
503 bool SavePageAsMHTML(const std::string& path,
504 Ewk_View_Save_Page_Callback callback,
507 void ExitFullscreen();
509 void DidChangePageScaleFactor(double scale_factor);
510 void SetScaledContentsSize();
511 void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
513 void JavaScriptAlertReply();
514 void SetJavaScriptConfirmCallback(
515 Ewk_View_JavaScript_Confirm_Callback callback,
517 void JavaScriptConfirmReply(bool result);
518 void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback,
520 void JavaScriptPromptReply(const char* result);
521 void set_renderer_crashed();
522 void GetPageScaleRange(double* min_scale, double* max_scale);
523 void SetDrawsTransparentBackground(bool enabled);
524 bool GetBackgroundColor(Ewk_View_Background_Color_Get_Callback callback,
526 void OnGetBackgroundColor(int callback_id, SkColor bg_color);
528 void GetSessionData(const char** data, unsigned* length) const;
529 bool RestoreFromSessionData(const char* data, unsigned length);
530 void ShowFileChooser(content::RenderFrameHost* render_frame_host,
531 const blink::mojom::FileChooserParams&);
532 void SetBrowserFont();
533 bool IsDragging() const;
535 void RequestColorPicker(int r, int g, int b, int a);
536 bool SetColorPickerColor(int r, int g, int b, int a);
537 void InputPickerShow(ui::TextInputType input_type,
539 content::DateTimeChooserEfl* date_time_chooser);
541 void ShowContentsDetectedPopup(const char*);
543 // Returns TCP port number with Inspector, or 0 if error.
544 int StartInspectorServer(int port = 0);
545 bool StopInspectorServer();
547 void LoadNotFoundErrorPage(const std::string& invalidUrl);
548 static std::string GetPlatformLocale();
549 bool GetLinkMagnifierEnabled() const;
550 void SetLinkMagnifierEnabled(bool enabled);
552 void SetQuotaPermissionRequestCallback(
553 Ewk_Quota_Permission_Request_Callback callback,
555 void InvokeQuotaPermissionRequest(
556 _Ewk_Quota_Permission_Request* request,
557 content::QuotaPermissionContext::PermissionCallback cb);
558 void QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
560 void QuotaRequestCancel(const _Ewk_Quota_Permission_Request* request);
561 #if !defined(EWK_BRINGUP) // FIXME: m67 bringup
562 void SetViewMode(blink::WebViewMode view_mode);
564 gfx::Point GetContextMenuPosition() const;
566 content::ContextMenuControllerEfl* GetContextMenuController() {
567 return context_menu_.get();
569 void ResetContextMenuController();
570 Eina_Bool AddJavaScriptMessageHandler(Evas_Object* view,
571 Ewk_View_Script_Message_Cb callback,
574 content::GinNativeBridgeDispatcherHost* GetGinNativeBridgeDispatcherHost()
576 return gin_native_bridge_dispatcher_host_.get();
578 bool SetPageVisibility(Ewk_Page_Visibility_State page_visibility_state);
580 void SetExceededIndexedDatabaseQuotaCallback(
581 Ewk_View_Exceeded_Indexed_Database_Quota_Callback callback,
583 void InvokeExceededIndexedDatabaseQuotaCallback(const GURL& origin,
584 int64_t current_quota);
585 void ExceededIndexedDatabaseQuotaReply(bool allow);
587 /// ---- Event handling
590 bool HandleMove(int x, int y);
591 bool HandleResize(int width, int height);
592 bool HandleTextSelectionDown(int x, int y);
593 bool HandleTextSelectionUp(int x, int y);
595 void HandleRendererProcessCrash();
596 void InvokeWebProcessCrashedCallback();
598 void HandleTapGestureForSelection(bool is_content_editable);
599 void HandleZoomGesture(blink::WebGestureEvent& event);
602 void RequestManifest(Ewk_View_Request_Manifest_Callback callback,
604 void DidRespondRequestManifest(_Ewk_View_Request_Manifest* manifest,
605 Ewk_View_Request_Manifest_Callback callback,
608 void SyncAcceptLanguages(const std::string& accept_languages);
610 void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
611 const gfx::Vector2dF& latest_overscroll_delta);
613 bool SetVisibility(bool enable);
615 content::DateTimeChooserEfl* GetDateTimeChooser() {
616 return date_time_chooser_;
619 bool ShouldIgnoreNavigation(content::NavigationHandle* navigation_handle);
622 void InitializeContent();
623 void InitializeWindowTreeHost();
624 void SendDelayedMessages(content::RenderViewHost* render_view_host);
626 void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
627 Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
630 Ewk_Hit_Test_Mode mode,
631 WebViewAsyncRequestHitTestDataCallback* cb);
632 #if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
633 static void cameraResultCb(service_h request,
635 service_result_e result,
639 #if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
640 bool LaunchCamera(std::u16string mimetype);
642 #if !defined(USE_AURA)
643 content::RenderWidgetHostViewEfl* rwhv() const;
645 JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
647 void ReleasePopupMenuList();
648 // Changes viewport without resizing Evas_Object representing webview
649 // and its corresponding RWHV to let Blink renders custom viewport
650 // while showing picker.
651 void AdjustViewPortHeightToPopupMenu(bool is_popup_menu_visible);
653 void ShowContextMenuInternal(const content::ContextMenuParams&);
655 void UpdateWebkitPreferencesEfl(content::RenderViewHost*);
657 void ChangeScroll(int& x, int& y);
658 void ScrollFocusedNodeIntoView();
660 void GenerateMHTML(Ewk_View_Save_Page_Callback callback,
662 const base::FilePath& file_path);
663 void MHTMLGenerated(Ewk_View_Save_Page_Callback callback,
665 const base::FilePath& file_path,
668 static void OnViewFocusIn(void* data, Evas*, Evas_Object*, void*);
669 static void OnViewFocusOut(void* data, Evas*, Evas_Object*, void*);
671 scoped_refptr<WebViewEvasEventHandler> evas_event_handler_;
672 scoped_refptr<Ewk_Context> context_;
673 scoped_refptr<Ewk_Context> old_context_;
674 std::unique_ptr<content::WebContents> web_contents_;
675 std::unique_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
676 std::string pending_url_request_;
677 std::unique_ptr<Ewk_Settings> settings_;
678 std::unique_ptr<_Ewk_Frame> frame_;
679 std::unique_ptr<_Ewk_Policy_Decision> window_policy_;
680 Evas_Object* evas_object_;
681 Evas_Object* native_view_;
682 bool touch_events_enabled_;
683 bool mouse_events_enabled_;
684 double text_zoom_factor_;
685 mutable std::string user_agent_;
686 mutable std::string user_agent_app_name_;
687 std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_;
688 std::string selected_text_cached_;
690 Eina_List* popupMenuItems_;
691 Popup_Picker* popupPicker_;
692 bool formIsNavigating_;
699 formNavigation formNavigation_;
700 std::unique_ptr<content::ContextMenuControllerEfl> context_menu_;
701 #if !defined(EWK_BRINGUP) // FIXME: m71 bringup
702 std::unique_ptr<content::FileChooserControllerEfl> file_chooser_;
704 std::unique_ptr<content::PopupControllerEfl> popup_controller_;
705 std::u16string previous_text_;
706 int current_find_request_id_;
707 static int find_request_id_counter_;
709 typedef WebViewCallback<Ewk_View_Plain_Text_Get_Callback, const char*>
710 EwkViewPlainTextGetCallback;
711 base::IDMap<EwkViewPlainTextGetCallback*> plain_text_get_callback_map_;
713 typedef WebViewCallback<Ewk_View_MHTML_Data_Get_Callback, const char*>
714 MHTMLCallbackDetails;
715 base::IDMap<MHTMLCallbackDetails*> mhtml_callback_map_;
717 typedef WebViewCallback<Ewk_View_Main_Frame_Scrollbar_Visible_Get_Callback,
719 MainFrameScrollbarVisibleGetCallback;
720 base::IDMap<MainFrameScrollbarVisibleGetCallback*>
721 main_frame_scrollbar_visible_callback_map_;
723 base::IDMap<BackgroundColorGetCallback*> background_color_get_callback_map_;
725 gfx::Size contents_size_;
727 mutable std::string title_;
728 Hit_Test_Params hit_test_params_;
729 base::WaitableEvent hit_test_completion_;
730 double page_scale_factor_;
734 WebViewCallback<Ewk_View_Geolocation_Permission_Callback,
735 _Ewk_Geolocation_Permission_Request*>
736 geolocation_permission_cb_;
737 WebViewCallback<Ewk_View_User_Media_Permission_Callback,
738 _Ewk_User_Media_Permission_Request*>
739 user_media_permission_cb_;
740 WebViewCallbackWithReturnValue<Ewk_User_Media_Permission_Query_Result,
741 Ewk_View_User_Media_Permission_Query_Callback,
742 _Ewk_User_Media_Permission_Query*>
743 user_media_permission_query_cb_;
744 WebViewCallback<Ewk_View_Unfocus_Allow_Callback, Ewk_Unfocus_Direction>
746 WebViewCallback<Ewk_View_Notification_Permission_Callback,
747 Ewk_Notification_Permission_Request*>
748 notification_permission_callback_;
749 WebViewCallback<Ewk_Quota_Permission_Request_Callback,
750 const _Ewk_Quota_Permission_Request*>
751 quota_request_callback_;
752 WebViewCallback<Ewk_View_Authentication_Callback, _Ewk_Auth_Challenge*>
754 WebViewCallback<Ewk_View_Scale_Changed_Callback, double> scale_changed_cb_;
756 std::unique_ptr<content::InputPicker> input_picker_;
757 base::IDMap<WebApplicationIconUrlGetCallback*>
758 web_app_icon_url_get_callback_map_;
759 base::IDMap<WebApplicationIconUrlsGetCallback*>
760 web_app_icon_urls_get_callback_map_;
761 base::IDMap<WebApplicationCapableGetCallback*>
762 web_app_capable_get_callback_map_;
763 std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
764 std::unique_ptr<ScrollDetector> scroll_detector_;
766 // Manages injecting native objects.
767 std::unique_ptr<content::GinNativeBridgeDispatcherHost>
768 gin_native_bridge_dispatcher_host_;
770 WebViewExceededQuotaCallback<
771 Ewk_View_Exceeded_Indexed_Database_Quota_Callback,
772 Ewk_Security_Origin*,
774 exceeded_indexed_db_quota_callback_;
775 std::unique_ptr<Ewk_Security_Origin> exceeded_indexed_db_quota_origin_;
777 #if BUILDFLAG(IS_TIZEN)
778 blink::mojom::FileChooserParams::Mode filechooser_mode_;
780 std::map<const _Ewk_Quota_Permission_Request*,
781 content::QuotaPermissionContext::PermissionCallback>
782 quota_permission_request_map_;
784 bool is_initialized_;
786 std::unique_ptr<_Ewk_Back_Forward_List> back_forward_list_;
788 static content::WebContentsEflDelegate::WebContentsCreateCallback
789 create_new_window_web_contents_cb_;
792 gfx::Vector2d previous_scroll_position_;
794 gfx::Point context_menu_position_;
796 std::vector<IPC::Message*> delayed_messages_;
798 std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
800 content::AcceptLanguagesHelper::AcceptLangsChangedCallback
801 accept_langs_changed_callback_;
803 std::unique_ptr<aura::WindowTreeHost> host_;
804 std::unique_ptr<aura::client::FocusClient> focus_client_;
805 std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
806 content::DateTimeChooserEfl* date_time_chooser_ = nullptr;
809 const unsigned int g_default_tilt_motion_sensitivity = 3;