#ifndef EWEB_VIEW_H
#define EWEB_VIEW_H
-#if defined(OS_TIZEN_MOBILE)
-#if !defined(EWK_BRINGUP)
-// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to include instead.
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
+// FIXME: appfw/app_service.h is no more in Tizen 2.3, figure out what to
+// include instead.
#include <appcore-agent/service_app.h>
#endif
-#include <vector>
-#endif
#include <map>
#include <string>
#include <Evas.h>
#include <locale.h>
+#include <vector>
#include "base/callback.h"
-#include "base/memory/scoped_ptr.h"
+#include "base/containers/id_map.h"
#include "base/synchronization/waitable_event.h"
-#include "content/public/common/context_menu_params.h"
-#include "content/public/common/file_chooser_params.h"
+#include "browser/inputpicker/InputPicker.h"
+#include "browser/selectpicker/popup_picker.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
-#include "content/common/input/input_event_ack_state.h"
+#include "content/browser/selection/selection_controller_efl.h"
+#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/web_contents_delegate.h"
-#include "content/public/common/menu_item.h"
-#include "base/id_map.h"
+#include "content/public/browser/web_contents_efl_delegate.h"
+#include "content/public/common/input_event_ack_state.h"
+#include "content_browser_client_efl.h"
#include "context_menu_controller_efl.h"
#include "eweb_context.h"
-#include "ewk_touch.h"
-#include "private/ewk_history_private.h"
-#include "private/ewk_hit_test_private.h"
+#include "eweb_view_callbacks.h"
+#include "file_chooser_controller_efl.h"
+#include "permission_popup_manager.h"
+#include "popup_controller_efl.h"
#include "private/ewk_auth_challenge_private.h"
#include "private/ewk_back_forward_list_private.h"
+#include "private/ewk_history_private.h"
+#include "private/ewk_hit_test_private.h"
#include "private/ewk_settings_private.h"
#include "private/ewk_web_application_icon_data_private.h"
-#include "public/ewk_hit_test.h"
-#include "public/ewk_view.h"
-#include "eweb_view_callbacks.h"
+#include "public/ewk_hit_test_internal.h"
+#include "public/ewk_touch_internal.h"
+#include "public/ewk_view_product.h"
#include "scroll_detector.h"
-#include "selection_controller_efl.h"
-#include "web_contents_delegate_efl.h"
-#include "context_menu_controller_efl.h"
-#include "file_chooser_controller_efl.h"
+#include "third_party/blink/public/common/context_menu_data/menu_item_info.h"
+#include "third_party/blink/public/mojom/choosers/file_chooser.mojom.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/size.h"
-#include "browser/inputpicker/InputPicker.h"
-#include "popup_controller_efl.h"
+#include "web_contents_delegate_efl.h"
-#if defined(OS_TIZEN)
-#include "browser/selectpicker/popup_picker.h"
-#endif
+namespace aura {
+namespace client {
+class FocusClient;
+class WindowParentingClient;
+} // namespace client
+} // namespace aura
namespace content {
+class RenderFrameHost;
class RenderViewHost;
-class RenderWidgetHostViewEfl;
+class RenderWidgetHostViewAura;
class WebContentsDelegateEfl;
class ContextMenuControllerEfl;
-class DevToolsDelegateEfl;
-class WebContentsViewEfl;
class PopupControllerEfl;
}
-namespace ui {
-class GestureRecognizer;
-class GestureEvent;
-class TouchEvent;
-}
-
-namespace tizen_webview {
-class WebContext;
-class WebView;
-class WebViewDelegate;
-class WebViewEvasEventHandler;
-}
-
class ErrorParams;
class _Ewk_Policy_Decision;
class _Ewk_Hit_Test;
+class Ewk_Context;
+class WebViewEvasEventHandler;
+class _Ewk_Quota_Permission_Request;
-class WebAppScreenshotCapturedCallback : public base::RefCounted<WebAppScreenshotCapturedCallback> {
+template <typename CallbackPtr, typename CallbackParameter>
+class WebViewCallback {
public:
- WebAppScreenshotCapturedCallback(Ewk_Web_App_Screenshot_Captured_Callback func, void *user_data, Evas* canvas)
- : func_(func), user_data_(user_data), canvas_(canvas) {}
- void Run(Evas_Object* image) {
- if (func_ != NULL)
- (func_)(image, user_data_);
+ WebViewCallback() { Set(nullptr, nullptr); }
+
+ void Set(CallbackPtr cb, void* data) {
+ callback_ = cb;
+ user_data_ = data;
}
- private:
- Ewk_Web_App_Screenshot_Captured_Callback func_;
- void *user_data_;
- Evas* canvas_;
-};
+ bool IsCallbackSet() const { return callback_; }
-class EwkViewPlainTextGetCallback {
- public:
- EwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback,
- void* user_data)
- : callback_(callback), user_data_(user_data)
- { }
- void TriggerCallback(Evas_Object* obj, const std::string& content_text);
+ Eina_Bool Run(Evas_Object* webview,
+ CallbackParameter param,
+ Eina_Bool* callback_result) {
+ CHECK(callback_result);
+ if (IsCallbackSet()) {
+ *callback_result = callback_(webview, param, user_data_);
+ return true;
+ }
+ return false;
+ }
+
+ void Run(Evas_Object* webview, CallbackParameter param) {
+ if (IsCallbackSet())
+ callback_(webview, param, user_data_);
+ }
private:
- Ewk_View_Plain_Text_Get_Callback callback_;
+ CallbackPtr callback_;
void* user_data_;
};
-class OrientationLockCallback {
- public:
- OrientationLockCallback(Ewk_Orientation_Lock_Cb lock,
- void* user_data)
- : lock_(lock),
- user_data_(user_data)
- {}
- private:
- Ewk_Orientation_Lock_Cb lock_;
- void* user_data_;
-};
-
-class MHTMLCallbackDetails {
- public:
- MHTMLCallbackDetails(Ewk_View_MHTML_Data_Get_Callback callback_func, void *user_data)
- : callback_func_(callback_func),
- user_data_(user_data)
- {}
- void Run(Evas_Object* obj, const std::string& mhtml_content);
-
- Ewk_View_MHTML_Data_Get_Callback callback_func_;
- void *user_data_;
-};
-
class WebApplicationIconUrlGetCallback {
public:
- WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func, void *user_data)
- : func_(func), user_data_(user_data)
- {}
- void Run(const std::string &url) {
+ WebApplicationIconUrlGetCallback(Ewk_Web_App_Icon_URL_Get_Callback func,
+ void* user_data)
+ : func_(func), user_data_(user_data) {}
+ void Run(const std::string& url) {
if (func_) {
(func_)(url.c_str(), user_data_);
}
private:
Ewk_Web_App_Icon_URL_Get_Callback func_;
- void *user_data_;
+ void* user_data_;
};
class WebApplicationIconUrlsGetCallback {
public:
- WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func, void *user_data)
- : func_(func), user_data_(user_data)
- {}
- void Run(const std::map<std::string, std::string> &urls) {
+ WebApplicationIconUrlsGetCallback(Ewk_Web_App_Icon_URLs_Get_Callback func,
+ void* user_data)
+ : func_(func), user_data_(user_data) {}
+ void Run(const std::map<std::string, std::string>& urls) {
if (func_) {
- Eina_List *list = NULL;
- for (std::map<std::string, std::string>::const_iterator it = urls.begin(); it != urls.end(); ++it) {
- _Ewk_Web_App_Icon_Data *data = ewkWebAppIconDataCreate(it->first, it->second);
+ Eina_List* list = NULL;
+ for (std::map<std::string, std::string>::const_iterator it = urls.begin();
+ it != urls.end(); ++it) {
+ _Ewk_Web_App_Icon_Data* data =
+ ewkWebAppIconDataCreate(it->first, it->second);
list = eina_list_append(list, data);
}
(func_)(list, user_data_);
private:
Ewk_Web_App_Icon_URLs_Get_Callback func_;
- void *user_data_;
+ void* user_data_;
};
class WebApplicationCapableGetCallback {
public:
- WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func, void *user_data)
- : func_(func), user_data_(user_data)
- {}
+ WebApplicationCapableGetCallback(Ewk_Web_App_Capable_Get_Callback func,
+ void* user_data)
+ : func_(func), user_data_(user_data) {}
void Run(bool capable) {
if (func_) {
(func_)(capable ? EINA_TRUE : EINA_FALSE, user_data_);
private:
Ewk_Web_App_Capable_Get_Callback func_;
- void *user_data_;
-};
-
-class AsyncHitTestRequest;
-class NotificationPermissionCallback {
- public:
- NotificationPermissionCallback(
- Evas_Object* obj,
- Ewk_View_Notification_Permission_Callback func,
- void* user_data)
- : obj_(obj), func_(func), user_data_(user_data) {}
- bool Run(Ewk_Notification_Permission_Request* request) {
- if (func_) {
- return (func_)(obj_, request, user_data_) == EINA_TRUE;
- }
- return false;
- }
-
-private:
- Evas_Object* obj_;
- Ewk_View_Notification_Permission_Callback func_;
void* user_data_;
};
class WebViewAsyncRequestHitTestDataCallback;
class JavaScriptDialogManagerEfl;
-class WebViewGeolocationPermissionCallback;
-class WebViewUnfocusAllowCallback;
+class PermissionPopupManager;
class EWebView {
public:
static EWebView* FromEvasObject(Evas_Object* eo);
- static int GetOrientation();
+
+ EWebView(Ewk_Context*, Evas_Object* smart_object);
+ ~EWebView();
// initialize data members and activate event handlers.
// call this once after created and before use
void Initialize();
- void CreateNewWindow(content::WebContentsDelegate::WebContentsCreateCallback);
+ bool CreateNewWindow(
+ content::WebContentsEflDelegate::WebContentsCreateCallback);
static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
- tizen_webview::WebView* GetPublicWebView();
- tizen_webview::WebContext* context() const { return context_.get(); }
+ content::RenderWidgetHostViewAura* rwhva() const;
+ Ewk_Context* context() const { return context_.get(); }
Evas_Object* evas_object() const { return evas_object_; }
+ Evas_Object* native_view() const { return native_view_; }
Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
-
- content::WebContents& web_contents() const
- {
- return *web_contents_.get();
+ PermissionPopupManager* GetPermissionPopupManager() const {
+ return permission_popup_manager_.get();
}
- template<EWebViewCallbacks::CallbackType callbackType>
- EWebViewCallbacks::CallBack<callbackType> SmartCallback() const
- {
+ content::WebContents& web_contents() const { return *web_contents_.get(); }
+
+ template <EWebViewCallbacks::CallbackType callbackType>
+ EWebViewCallbacks::CallBack<callbackType> SmartCallback() const {
return EWebViewCallbacks::CallBack<callbackType>(evas_object_);
}
void set_magnifier(bool status);
// ewk_view api
- void SetURL(const char* url_string);
- const char* GetURL() const;
+ void SetURL(const GURL& url);
+ const GURL& GetURL() const;
+ const GURL& GetOriginalURL() const;
void Reload();
- void ReloadIgnoringCache();
+ void ReloadBypassingCache();
Eina_Bool CanGoBack();
Eina_Bool CanGoForward();
Eina_Bool HasFocus() const;
void Stop();
double GetTextZoomFactor() const;
void SetTextZoomFactor(double text_zoom_factor);
+ double GetPageZoomFactor() const;
+ void SetPageZoomFactor(double page_zoom_factor);
void ExecuteEditCommand(const char* command, const char* value);
void SetOrientation(int orientation);
- void SetOrientationLockCallback(Ewk_Orientation_Lock_Cb func, void* data);
+ int GetOrientation();
bool TouchEventsEnabled() const;
void SetTouchEventsEnabled(bool enabled);
bool MouseEventsEnabled() const;
void SetMouseEventsEnabled(bool enabled);
- void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
+ void HandleTouchEvents(Ewk_Touch_Event_Type type,
+ const Eina_List* points,
+ const Evas_Modifier* modifiers);
void Show();
void Hide();
- bool ExecuteJavaScript(const char* script, Ewk_View_Script_Execute_Callback callback, void* userdata);
+ bool ExecuteJavaScript(const char* script,
+ Ewk_View_Script_Execute_Callback callback,
+ void* userdata);
bool SetUserAgent(const char* userAgent);
bool SetUserAgentAppName(const char* application_name);
bool SetPrivateBrowsing(bool incognito);
bool GetPrivateBrowsing() const;
const char* GetUserAgent() const;
const char* GetUserAgentAppName() const;
- const char* GetSelectedText() const;
- Ewk_Settings* GetSettings();
+ const char* CacheSelectedText();
+ Ewk_Settings* GetSettings() { return settings_.get(); }
_Ewk_Frame* GetMainFrame();
void UpdateWebKitPreferences();
- void LoadHTMLString(const char* html, const char* base_uri, const char* unreachable_uri);
+ void LoadHTMLString(const char* html,
+ const char* base_uri,
+ const char* unreachable_uri);
void LoadPlainTextString(const char* plain_text);
- void LoadData(const char* data, size_t size, const char* mime_type, const char* encoding, const char* base_uri, const char* unreachable_uri = NULL);
- void InvokeLoadError(const ErrorParams &error);
- void InvokeAuthCallback(LoginDelegateEfl* login_delegate, const GURL& url, const std::string& realm);
+ void LoadData(const char* data,
+ size_t size,
+ const char* mime_type,
+ const char* encoding,
+ const char* base_uri,
+ const char* unreachable_uri = NULL);
+
+ void InvokeLoadError(const GURL& url, int error_code, bool is_cancellation);
+
+ void SetViewAuthCallback(Ewk_View_Authentication_Callback callback,
+ void* user_data);
+ void InvokeAuthCallback(LoginDelegateEfl* login_delegate,
+ const GURL& url,
+ const std::string& realm);
void Find(const char* text, Ewk_Find_Options);
void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
void SetContentSecurityPolicy(const char* policy, Ewk_CSP_Header_Type type);
- void ShowPopupMenu(const std::vector<content::MenuItem>& items,
- int selectedIndex, bool multiple);
+ void ShowPopupMenu(const std::vector<blink::MenuItemInfo>& items,
+ int selectedIndex,
+ bool multiple);
Eina_Bool HidePopupMenu();
- void UpdateFormNavigation(int formElementCount, int currentNodeIndex,
- bool prevState, bool nextState);
+ void UpdateFormNavigation(int formElementCount,
+ int currentNodeIndex,
+ bool prevState,
+ bool nextState);
void FormNavigate(bool direction);
bool IsSelectPickerShown() const;
void CloseSelectPicker();
Eina_Bool DidSelectPopupMenuItem(int selectedIndex);
Eina_Bool DidMultipleSelectPopupMenuItem(std::vector<int>& selectedIndices);
Eina_Bool PopupMenuClose();
- void ShowContextMenu(
- const content::ContextMenuParams& params,
- content::ContextMenuType type = content::MENU_TYPE_LINK,
- bool show_selection = true);
+ void HandleLongPressGesture(const content::ContextMenuParams&);
+ void ShowContextMenu(const content::ContextMenuParams&);
void CancelContextMenu(int request_id);
- void SetScale(double scale_factor, int x, int y);
+ void SetScale(double scale_factor);
bool GetScrollPosition(int* x, int* y) const;
void SetScroll(int x, int y);
void UrlRequestSet(const char* url,
- content::NavigationController::LoadURLType loadtype,
- Eina_Hash* headers,
- const char* body);
+ content::NavigationController::LoadURLType loadtype,
+ Eina_Hash* headers,
+ const char* body);
- content::SelectionControllerEfl* GetSelectionController() const { return selection_controller_.get(); }
- content::PopupControllerEfl* GetPopupController() const { return popup_controller_.get(); }
+ content::SelectionControllerEfl* GetSelectionController() const;
+ content::PopupControllerEfl* GetPopupController() const {
+ return popup_controller_.get();
+ }
ScrollDetector* GetScrollDetector() const { return scroll_detector_.get(); }
void MoveCaret(const gfx::Point& point);
void QuerySelectionStyle();
void OnQuerySelectionStyleReply(const SelectionStylePrams& params);
- void SelectClosestWord(const gfx::Point& touch_point);
void SelectLinkText(const gfx::Point& touch_point);
bool GetSelectionRange(Eina_Rectangle* left_rect, Eina_Rectangle* right_rect);
- void GetSnapShotForRect(gfx::Rect& rect);
+ Eina_Bool ClearSelection();
- // Callback OnCopyFromBackingStore will be called once we get the snapshot from render
+ // Callback OnCopyFromBackingStore will be called once we get the snapshot
+ // from render
void OnCopyFromBackingStore(bool success, const SkBitmap& bitmap);
+ void RenderViewCreated(content::RenderViewHost* render_view_host);
+
/**
* Creates a snapshot of given rectangle from EWebView
*
*/
Evas_Object* GetSnapshot(Eina_Rectangle rect);
- bool GetSnapshotAsync(Eina_Rectangle rect, Evas* canvas, Ewk_Web_App_Screenshot_Captured_Callback callback, void* user_data);
+ bool GetSnapshotAsync(Eina_Rectangle rect,
+ Ewk_Web_App_Screenshot_Captured_Callback callback,
+ void* user_data);
void InvokePolicyResponseCallback(_Ewk_Policy_Decision* policy_decision);
void InvokePolicyNavigationCallback(content::RenderViewHost* rvh,
- NavigationPolicyParams params, bool* handled);
+ NavigationPolicyParams params,
+ bool* handled);
void UseSettingsFont();
_Ewk_Hit_Test* RequestHitTestDataAt(int x, int y, Ewk_Hit_Test_Mode mode);
- Eina_Bool AsyncRequestHitTestDataAt(int x, int y,
- Ewk_Hit_Test_Mode mode,
- Ewk_View_Hit_Test_Request_Callback,
- void* user_data);
- _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x, int y,
- Ewk_Hit_Test_Mode mode);
- Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
+ Eina_Bool AsyncRequestHitTestDataAt(int x,
+ int y,
+ Ewk_Hit_Test_Mode mode,
+ Ewk_View_Hit_Test_Request_Callback,
+ void* user_data);
+ _Ewk_Hit_Test* RequestHitTestDataAtBlinkCoords(int x,
+ int y,
+ Ewk_Hit_Test_Mode mode);
+ Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
Ewk_View_Hit_Test_Request_Callback,
void* user_data);
- void DispatchAsyncHitTestData(const Hit_Test_Params& params, int64_t request_id);
+ void DispatchAsyncHitTestData(const Hit_Test_Params& params,
+ int64_t request_id);
void UpdateHitTestData(const Hit_Test_Params& params);
int current_find_request_id() const { return current_find_request_id_; }
bool PlainTextGet(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
- void InvokePlainTextGetCallback(const std::string& content_text, int plain_text_get_callback_id);
- int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback, void* user_data);
- void SetViewGeolocationPermissionCallback(Ewk_View_Geolocation_Permission_Callback callback, void* user_data);
- bool InvokeViewGeolocationPermissionCallback(_Ewk_Geolocation_Permission_Request* geolocation_permission_request_context, Eina_Bool* result);
- void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback, void* user_data);
- bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction, Eina_Bool* result);
+ void InvokePlainTextGetCallback(const std::string& content_text,
+ int plain_text_get_callback_id);
+ int SetEwkViewPlainTextGetCallback(Ewk_View_Plain_Text_Get_Callback callback,
+ void* user_data);
+ void SetViewGeolocationPermissionCallback(
+ Ewk_View_Geolocation_Permission_Callback callback,
+ void* user_data);
+ bool InvokeViewGeolocationPermissionCallback(
+ _Ewk_Geolocation_Permission_Request*
+ geolocation_permission_request_context,
+ Eina_Bool* result);
+ void SetViewUserMediaPermissionCallback(
+ Ewk_View_User_Media_Permission_Callback callback,
+ void* user_data);
+ bool InvokeViewUserMediaPermissionCallback(
+ _Ewk_User_Media_Permission_Request* user_media_permission_request_context,
+ Eina_Bool* result);
+ void SetViewUnfocusAllowCallback(Ewk_View_Unfocus_Allow_Callback callback,
+ void* user_data);
+ bool InvokeViewUnfocusAllowCallback(Ewk_Unfocus_Direction direction,
+ Eina_Bool* result);
void DidChangeContentsSize(int width, int height);
const Eina_Rectangle GetContentsSize() const;
void GetScrollSize(int* w, int* h);
_Ewk_Back_Forward_List* GetBackForwardList() const;
void InvokeBackForwardListChangedCallback();
_Ewk_History* GetBackForwardHistory() const;
- bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback, void *userData);
- bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback, void *userData);
- bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback, void *userData);
+ bool WebAppCapableGet(Ewk_Web_App_Capable_Get_Callback callback,
+ void* userData);
+ bool WebAppIconUrlGet(Ewk_Web_App_Icon_URL_Get_Callback callback,
+ void* userData);
+ bool WebAppIconUrlsGet(Ewk_Web_App_Icon_URLs_Get_Callback callback,
+ void* userData);
void InvokeWebAppCapableGetCallback(bool capable, int callbackId);
- void InvokeWebAppIconUrlGetCallback(const std::string &iconUrl, int callbackId);
- void InvokeWebAppIconUrlsGetCallback(const std::map<std::string, std::string> &iconUrls, int callbackId);
- void SetNotificationPermissionCallback(Ewk_View_Notification_Permission_Callback callback, void* user_data);
+ void InvokeWebAppIconUrlGetCallback(const std::string& iconUrl,
+ int callbackId);
+ void InvokeWebAppIconUrlsGetCallback(
+ const std::map<std::string, std::string>& iconUrls,
+ int callbackId);
+ void SetNotificationPermissionCallback(
+ Ewk_View_Notification_Permission_Callback callback,
+ void* user_data);
bool IsNotificationPermissionCallbackSet() const;
- bool InvokeNotificationPermissionCallback(Ewk_Notification_Permission_Request* request);
+ bool InvokeNotificationPermissionCallback(
+ Ewk_Notification_Permission_Request* request);
bool GetMHTMLData(Ewk_View_MHTML_Data_Get_Callback callback, void* user_data);
void OnMHTMLContentGet(const std::string& mhtml_content, int callback_id);
void ExitFullscreen();
double GetScale();
void DidChangePageScaleFactor(double scale_factor);
- void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback, void* user_data);
+ void SetScaledContentsSize();
+ void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
+ void* user_data);
void JavaScriptAlertReply();
- void SetJavaScriptConfirmCallback(Ewk_View_JavaScript_Confirm_Callback callback, void* user_data);
+ void SetJavaScriptConfirmCallback(
+ Ewk_View_JavaScript_Confirm_Callback callback,
+ void* user_data);
void JavaScriptConfirmReply(bool result);
- void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback, void* user_data);
+ void SetJavaScriptPromptCallback(Ewk_View_JavaScript_Prompt_Callback callback,
+ void* user_data);
void JavaScriptPromptReply(const char* result);
void set_renderer_crashed();
- void GetPageScaleRange(double *min_scale, double *max_scale);
- void DidChangePageScaleRange(double min_scale, double max_scale);
+ void GetPageScaleRange(double* min_scale, double* max_scale);
void SetDrawsTransparentBackground(bool enabled);
- void GetSessionData(const char **data, unsigned *length) const;
- bool RestoreFromSessionData(const char *data, unsigned length);
- void ShowFileChooser(const content::FileChooserParams&);
- void DidChangeContentsArea(int width, int height);
+ void GetSessionData(const char** data, unsigned* length) const;
+ bool RestoreFromSessionData(const char* data, unsigned length);
+ void ShowFileChooser(content::RenderFrameHost* render_frame_host,
+ const blink::mojom::FileChooserParams&);
void SetBrowserFont();
void SetCertificatePem(const std::string& certificate);
bool IsDragging() const;
void DismissColorPicker();
bool SetColorPickerColor(int r, int g, int b, int a);
void InputPickerShow(ui::TextInputType input_type, double input_value);
- void OnSnapshot(const std::vector<unsigned char>& pixData, int width, int height, int snapshotId);
void ShowContentsDetectedPopup(const char*);
void SetLinkMagnifierEnabled(bool enabled);
void SetOverrideEncoding(const std::string& encoding);
+ void SetQuotaPermissionRequestCallback(
+ Ewk_Quota_Permission_Request_Callback callback,
+ void* user_data);
+ void InvokeQuotaPermissionRequest(
+ _Ewk_Quota_Permission_Request* request,
+ content::QuotaPermissionContext::PermissionCallback cb);
+ void QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
+ bool allow);
+ void QuotaRequestCancel(const _Ewk_Quota_Permission_Request* request);
+#if !defined(EWK_BRINGUP) // FIXME: m67 bringup
void SetViewMode(blink::WebViewMode view_mode);
-
+#endif
gfx::Point GetContextMenuPosition() const;
- void SendDelayedMessages(content::RenderViewHost* render_view_host);
+ content::ContextMenuControllerEfl* GetContextMenuController() {
+ return context_menu_.get();
+ }
+ void ResetContextMenuController();
/// ---- Event handling
bool HandleShow();
bool HandleTextSelectionUp(int x, int y);
void HandleRendererProcessCrash();
- void HandlePostponedGesture(int x, int y, ui::EventType type);
+ void InvokeWebProcessCrashedCallback();
+
+ void HandleTapGestureForSelection(bool is_content_editable);
+ void HandleZoomGesture(blink::WebGestureEvent& event);
+ void ClosePage();
+
+ void RequestManifest(Ewk_View_Request_Manifest_Callback callback,
+ void* user_data);
+ void DidRespondRequestManifest(_Ewk_View_Request_Manifest* manifest,
+ Ewk_View_Request_Manifest_Callback callback,
+ void* user_data);
+
+ void SyncAcceptLanguages(const std::string& accept_languages);
+
+ void OnOverscrolled(const gfx::Vector2dF& accumulated_overscroll,
+ const gfx::Vector2dF& latest_overscroll_delta);
+
private:
void InitializeContent();
+ void InitializeWindowTreeHost();
+ void SendDelayedMessages(content::RenderViewHost* render_view_host);
+
void EvasToBlinkCords(int x, int y, int* view_x, int* view_y);
- Eina_Bool AsyncRequestHitTestDataAtBlinkCords(int x, int y,
+ Eina_Bool AsyncRequestHitTestDataAtBlinkCords(
+ int x,
+ int y,
Ewk_Hit_Test_Mode mode,
WebViewAsyncRequestHitTestDataCallback* cb);
- void HandleLongPressGesture(int x, int y, Ewk_Hit_Test_Mode mode,
- _Ewk_Hit_Test*);
- void HandleTapGesture(int x, int y, Ewk_Hit_Test_Mode mode,
- _Ewk_Hit_Test*);
+#if !defined(USE_AURA)
content::WebContentsViewEfl* GetWebContentsViewEfl() const;
-
-#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
- static void cameraResultCb(service_h request, service_h reply,
- service_result_e result, void* data);
+#endif
+#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
+ static void cameraResultCb(service_h request,
+ service_h reply,
+ service_result_e result,
+ void* data);
#endif
-#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
- bool LaunchCamera(base::string16 mimetype);
+#if BUILDFLAG(IS_TIZEN) && !defined(EWK_BRINGUP)
+ bool LaunchCamera(std::u16string mimetype);
#endif
+#if !defined(USE_AURA)
content::RenderWidgetHostViewEfl* rwhv() const;
+#endif
JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
-#if defined(OS_TIZEN)
void ReleasePopupMenuList();
-#endif
- tizen_webview::WebView* public_webview_;
- scoped_refptr<tizen_webview::WebContext> context_;
- scoped_refptr<tizen_webview::WebContext> old_context_;
- scoped_ptr<content::WebContents> web_contents_;
- scoped_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
+ void ShowContextMenuInternal(const content::ContextMenuParams&);
+
+ void UpdateWebkitPreferencesEfl(content::RenderViewHost*);
+
+ void ChangeScroll(int& x, int& y);
+
+ scoped_refptr<WebViewEvasEventHandler> evas_event_handler_;
+ scoped_refptr<Ewk_Context> context_;
+ scoped_refptr<Ewk_Context> old_context_;
+ std::unique_ptr<content::WebContents> web_contents_;
+ std::unique_ptr<content::WebContentsDelegateEfl> web_contents_delegate_;
std::string pending_url_request_;
- scoped_ptr<Ewk_Settings> settings_;
- scoped_ptr<_Ewk_Frame> frame_;
- scoped_ptr<_Ewk_Policy_Decision> window_policy_;
+ std::unique_ptr<Ewk_Settings> settings_;
+ std::unique_ptr<_Ewk_Frame> frame_;
+ std::unique_ptr<_Ewk_Policy_Decision> window_policy_;
Evas_Object* evas_object_;
Evas_Object* native_view_;
bool touch_events_enabled_;
bool mouse_events_enabled_;
double text_zoom_factor_;
- mutable std::string selected_text_;
mutable std::string user_agent_;
mutable std::string user_agent_app_name_;
- scoped_ptr<_Ewk_Auth_Challenge> auth_challenge_;
+ std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_;
+ std::string selected_text_cached_;
-#if defined(OS_TIZEN)
Eina_List* popupMenuItems_;
Popup_Picker* popupPicker_;
-#endif
bool formIsNavigating_;
typedef struct {
int count;
bool nextState;
} formNavigation;
formNavigation formNavigation_;
- scoped_ptr<content::ContextMenuControllerEfl> context_menu_;
- scoped_ptr<content::FileChooserControllerEfl> file_chooser_;
- scoped_ptr<content::PopupControllerEfl> popup_controller_;
- scoped_ptr<content::SelectionControllerEfl> selection_controller_;
- base::string16 previous_text_;
+ std::unique_ptr<content::ContextMenuControllerEfl> context_menu_;
+#if !defined(EWK_BRINGUP) // FIXME: m71 bringup
+ std::unique_ptr<content::FileChooserControllerEfl> file_chooser_;
+#endif
+ std::unique_ptr<content::PopupControllerEfl> popup_controller_;
+ std::u16string previous_text_;
int current_find_request_id_;
static int find_request_id_counter_;
- IDMap<EwkViewPlainTextGetCallback, IDMapOwnPointer> plain_text_get_callback_map_;
+
+ typedef WebViewCallback<Ewk_View_Plain_Text_Get_Callback, const char*>
+ EwkViewPlainTextGetCallback;
+ base::IDMap<EwkViewPlainTextGetCallback*> plain_text_get_callback_map_;
+
+ typedef WebViewCallback<Ewk_View_MHTML_Data_Get_Callback, const char*>
+ MHTMLCallbackDetails;
+ base::IDMap<MHTMLCallbackDetails*> mhtml_callback_map_;
+
gfx::Size contents_size_;
double progress_;
mutable std::string title_;
mutable std::string pem_certificate_;
Hit_Test_Params hit_test_params_;
base::WaitableEvent hit_test_completion_;
- IDMap<MHTMLCallbackDetails, IDMapOwnPointer> mhtml_callback_map_;
double page_scale_factor_;
- double min_page_scale_factor_;
- double max_page_scale_factor_;
- scoped_ptr<OrientationLockCallback> orientation_lock_callback_;
- scoped_ptr<WebViewGeolocationPermissionCallback> geolocation_permission_cb_;
- scoped_ptr<WebViewUnfocusAllowCallback> unfocus_allow_cb_;
- scoped_ptr<content::InputPicker> inputPicker_;
- IDMap<WebApplicationIconUrlGetCallback, IDMapOwnPointer> web_app_icon_url_get_callback_map_;
- IDMap<WebApplicationIconUrlsGetCallback, IDMapOwnPointer> web_app_icon_urls_get_callback_map_;
- IDMap<WebApplicationCapableGetCallback, IDMapOwnPointer> web_app_capable_get_callback_map_;
- IDMap< WebAppScreenshotCapturedCallback, IDMapOwnPointer> screen_capture_cb_map_;
- scoped_ptr<NotificationPermissionCallback> notification_permission_callback_;
- content::DevToolsDelegateEfl* inspector_server_;
- scoped_ptr<ScrollDetector> scroll_detector_;
-#if defined(OS_TIZEN_MOBILE)
- content::FileChooserParams::Mode filechooser_mode_;
+ double x_delta_;
+ double y_delta_;
+
+ WebViewCallback<Ewk_View_Geolocation_Permission_Callback,
+ _Ewk_Geolocation_Permission_Request*>
+ geolocation_permission_cb_;
+ WebViewCallback<Ewk_View_User_Media_Permission_Callback,
+ _Ewk_User_Media_Permission_Request*>
+ user_media_permission_cb_;
+ WebViewCallback<Ewk_View_Unfocus_Allow_Callback, Ewk_Unfocus_Direction>
+ unfocus_allow_cb_;
+ WebViewCallback<Ewk_View_Notification_Permission_Callback,
+ Ewk_Notification_Permission_Request*>
+ notification_permission_callback_;
+ WebViewCallback<Ewk_Quota_Permission_Request_Callback,
+ const _Ewk_Quota_Permission_Request*>
+ quota_request_callback_;
+ WebViewCallback<Ewk_View_Authentication_Callback, _Ewk_Auth_Challenge*>
+ authentication_cb_;
+
+ std::unique_ptr<content::InputPicker> inputPicker_;
+ base::IDMap<WebApplicationIconUrlGetCallback*>
+ web_app_icon_url_get_callback_map_;
+ base::IDMap<WebApplicationIconUrlsGetCallback*>
+ web_app_icon_urls_get_callback_map_;
+ base::IDMap<WebApplicationCapableGetCallback*>
+ web_app_capable_get_callback_map_;
+ std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
+ std::unique_ptr<ScrollDetector> scroll_detector_;
+
+#if BUILDFLAG(IS_TIZEN)
+ blink::mojom::FileChooserParams::Mode filechooser_mode_;
#endif
+ std::map<const _Ewk_Quota_Permission_Request*,
+ content::QuotaPermissionContext::PermissionCallback>
+ quota_permission_request_map_;
+
bool is_initialized_;
- scoped_ptr<_Ewk_Back_Forward_List> back_forward_list_;
+ std::unique_ptr<_Ewk_Back_Forward_List> back_forward_list_;
- static content::WebContentsDelegate::WebContentsCreateCallback
+ static content::WebContentsEflDelegate::WebContentsCreateCallback
create_new_window_web_contents_cb_;
-private:
- Eina_Bool AsyncRequestHitTestPrivate(
- int x, int y, Ewk_Hit_Test_Mode mode,
- AsyncHitTestRequest* asyncHitTestRequest);
-
+ private:
gfx::Vector2d previous_scroll_position_;
gfx::Point context_menu_position_;
- std::set<IPC::Message*> delayed_messages_;
+ std::vector<IPC::Message*> delayed_messages_;
std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
- // only tizen_webview::WebView can create and delete this
- EWebView(tizen_webview::WebView* owner, tizen_webview::WebContext*, Evas_Object* smart_object);
- ~EWebView();
- friend class tizen_webview::WebView;
- friend class tizen_webview::WebViewEvasEventHandler;
-};
-namespace tizen_webview {
-typedef ::EWebView WebViewImpl;
+ content::ContentBrowserClientEfl::AcceptLangsChangedCallback
+ accept_langs_changed_callback_;
+
+ std::unique_ptr<aura::WindowTreeHost> host_;
+ std::unique_ptr<aura::client::FocusClient> focus_client_;
+ std::unique_ptr<aura::client::WindowParentingClient> window_parenting_client_;
};
const unsigned int g_default_tilt_motion_sensitivity = 3;
-
#endif