#include "browser/selectpicker/popup_picker.h"
#include "content/browser/renderer_host/event_with_latency_info.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/browser/web_contents_efl_delegate.h"
-#include "content/public/common/context_menu_params.h"
#include "content/public/common/input_event_ack_state.h"
-#include "content/public/common/menu_item.h"
+#include "content_browser_client_efl.h"
#include "context_menu_controller_efl.h"
#include "eweb_context.h"
#include "eweb_view_callbacks.h"
#include "public/ewk_touch_internal.h"
#include "public/ewk_view_product.h"
#include "scroll_detector.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 "web_contents_delegate_efl.h"
+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 WebContentsViewEfl;
class PopupControllerEfl;
}
class EWebView {
public:
static EWebView* FromEvasObject(Evas_Object* eo);
- static int GetOrientation();
EWebView(Ewk_Context*, Evas_Object* smart_object);
~EWebView();
// call this once after created and before use
void Initialize();
- void CreateNewWindow(
+ bool CreateNewWindow(
content::WebContentsEflDelegate::WebContentsCreateCallback);
static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
+ 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_; }
// ewk_view api
void SetURL(const GURL& url);
const GURL& GetURL() const;
+ const GURL& GetOriginalURL() const;
void Reload();
void ReloadBypassingCache();
Eina_Bool CanGoBack();
void SetPageZoomFactor(double page_zoom_factor);
void ExecuteEditCommand(const char* command, const char* value);
void SetOrientation(int orientation);
+ int GetOrientation();
bool TouchEventsEnabled() const;
void SetTouchEventsEnabled(bool enabled);
bool MouseEventsEnabled() const;
bool GetPrivateBrowsing() const;
const char* GetUserAgent() const;
const char* GetUserAgentAppName() const;
- const char* GetSelectedText() const;
+ const char* CacheSelectedText();
Ewk_Settings* GetSettings() { return settings_.get(); }
_Ewk_Frame* GetMainFrame();
void UpdateWebKitPreferences();
const char* base_uri,
const char* unreachable_uri = NULL);
- void InvokeLoadError(const GURL& url,
- int error_code,
- const std::string& error_description,
- bool is_main_frame);
+ 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,
+ void ShowPopupMenu(const std::vector<blink::MenuItemInfo>& items,
int selectedIndex,
bool multiple);
Eina_Bool HidePopupMenu();
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,
void ExitFullscreen();
double GetScale();
void DidChangePageScaleFactor(double scale_factor);
+ void SetScaledContentsSize();
void SetJavaScriptAlertCallback(Ewk_View_JavaScript_Alert_Callback callback,
void* user_data);
void JavaScriptAlertReply();
void* user_data);
void InvokeQuotaPermissionRequest(
_Ewk_Quota_Permission_Request* request,
- const content::QuotaPermissionContext::PermissionCallback& cb);
+ content::QuotaPermissionContext::PermissionCallback cb);
void QuotaRequestReply(const _Ewk_Quota_Permission_Request* request,
bool allow);
void QuotaRequestCancel(const _Ewk_Quota_Permission_Request* request);
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);
int y,
Ewk_Hit_Test_Mode mode,
WebViewAsyncRequestHitTestDataCallback* cb);
-
+#if !defined(USE_AURA)
content::WebContentsViewEfl* GetWebContentsViewEfl() const;
-
-#if defined(OS_TIZEN) && !defined(EWK_BRINGUP)
+#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) && !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();
void ReleasePopupMenuList();
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_;
mutable std::string user_agent_;
mutable std::string user_agent_app_name_;
std::unique_ptr<_Ewk_Auth_Challenge> auth_challenge_;
+ std::string selected_text_cached_;
Eina_List* popupMenuItems_;
Popup_Picker* popupPicker_;
std::unique_ptr<content::FileChooserControllerEfl> file_chooser_;
#endif
std::unique_ptr<content::PopupControllerEfl> popup_controller_;
- base::string16 previous_text_;
+ std::u16string previous_text_;
int current_find_request_id_;
static int find_request_id_counter_;
Hit_Test_Params hit_test_params_;
base::WaitableEvent hit_test_completion_;
double page_scale_factor_;
- double min_page_scale_factor_;
- double max_page_scale_factor_;
+ double x_delta_;
+ double y_delta_;
WebViewCallback<Ewk_View_Geolocation_Permission_Callback,
_Ewk_Geolocation_Permission_Request*>
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*>
std::unique_ptr<PermissionPopupManager> permission_popup_manager_;
std::unique_ptr<ScrollDetector> scroll_detector_;
-#if defined(OS_TIZEN)
+#if BUILDFLAG(IS_TIZEN)
blink::mojom::FileChooserParams::Mode filechooser_mode_;
#endif
std::map<const _Ewk_Quota_Permission_Request*,
std::vector<IPC::Message*> delayed_messages_;
std::map<int64_t, WebViewAsyncRequestHitTestDataCallback*> hit_test_callback_;
+
+ 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;