From: Piotr Tworek
Date: Wed, 11 Mar 2015 12:02:20 +0000 (+0100)
Subject: Make EWK use WebContentsViewDelegate for popup menu handling.
X-Git-Tag: submit/tizen/20201118.160233~1091
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae37a498fd7c4b21751682637759da6be41ee71e;p=platform%2Fframework%2Fweb%2Fchromium-efl.git
Make EWK use WebContentsViewDelegate for popup menu handling.
Apps wishing to show custom popup menus should implement
WebContentsViewDelegate::ShowPopupMenu function. This patch does it for
EWK.
Change-Id: Id587ac954c3d016c5a0717eca365610aec1e2a82
Signed-off-by: Piotr Tworek
---
diff --git a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc
index c4b3e0c6..45ce932 100644
--- a/tizen_src/ewk/efl_integration/content_browser_client_efl.cc
+++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.cc
@@ -9,6 +9,7 @@
#include "browser_main_parts_efl.h"
#include "browser_context_efl.h"
#include "web_contents_delegate_efl.h"
+#include "web_contents_view_delegate_ewk.h"
#include "devtools_manager_delegate_efl.h"
#include "browser/editor_client_observer.h"
#include "browser/geolocation/access_token_store_efl.h"
@@ -425,4 +426,9 @@ void ContentBrowserClientEfl::SetNotificationCallbacks(Notification_Show_Callbac
notification_callback_user_data_ = user_data;
}
+WebContentsViewDelegate* ContentBrowserClientEfl::GetWebContentsViewDelegate(
+ WebContents* web_contents) {
+ return new WebContentsViewDelegateEwk(WebViewFromWebContents(web_contents));
+}
+
}
diff --git a/tizen_src/ewk/efl_integration/content_browser_client_efl.h b/tizen_src/ewk/efl_integration/content_browser_client_efl.h
index 34e1909..20ed281 100644
--- a/tizen_src/ewk/efl_integration/content_browser_client_efl.h
+++ b/tizen_src/ewk/efl_integration/content_browser_client_efl.h
@@ -136,6 +136,9 @@ class ContentBrowserClientEfl: public ContentBrowserClient {
return notification_controller_.get();
}
+ WebContentsViewDelegate* GetWebContentsViewDelegate(
+ WebContents* web_contents) override;
+
private:
static void SetCertificatePemOnUIThread(int render_process_id,
int render_view_id, std::string certificate);
diff --git a/tizen_src/ewk/efl_integration/efl_integration.gypi b/tizen_src/ewk/efl_integration/efl_integration.gypi
index 3cafbf5..da803c8 100644
--- a/tizen_src/ewk/efl_integration/efl_integration.gypi
+++ b/tizen_src/ewk/efl_integration/efl_integration.gypi
@@ -160,6 +160,8 @@
'url_request_context_getter_efl.h',
'web_contents_delegate_efl.cc',
'web_contents_delegate_efl.h',
+ 'web_contents_view_delegate_ewk.cc',
+ 'web_contents_view_delegate_ewk.h',
'web_process_content_main_delegate_efl.cc',
'web_process_content_main_delegate_efl.h',
diff --git a/tizen_src/ewk/efl_integration/eweb_view.cc b/tizen_src/ewk/efl_integration/eweb_view.cc
index d67a0f2..f337a4a 100644
--- a/tizen_src/ewk/efl_integration/eweb_view.cc
+++ b/tizen_src/ewk/efl_integration/eweb_view.cc
@@ -1147,7 +1147,8 @@ void EWebView::InvokeLoadError(const tizen_webview::Error &error) {
}
}
-void EWebView::ShowPopupMenu(const gfx::Rect& rect, blink::TextDirection textDirection, double pageScaleFactor, const std::vector& items, int data, int selectedIndex, bool multiple) {
+void EWebView::ShowPopupMenu(const std::vector& items,
+ int selectedIndex, bool multiple) {
#if defined(OS_TIZEN)
Eina_List* popupItems = 0;
const size_t size = items.size();
diff --git a/tizen_src/ewk/efl_integration/eweb_view.h b/tizen_src/ewk/efl_integration/eweb_view.h
index 7af2a6a..4a717b0 100644
--- a/tizen_src/ewk/efl_integration/eweb_view.h
+++ b/tizen_src/ewk/efl_integration/eweb_view.h
@@ -306,7 +306,8 @@ class EWebView {
void Find(const char* text, tizen_webview::Find_Options);
void InvokeAuthCallbackOnUI(_Ewk_Auth_Challenge* auth_challenge);
void SetContentSecurityPolicy(const char* policy, tizen_webview::ContentSecurityPolicyType type);
- void ShowPopupMenu(const gfx::Rect& rect, blink::TextDirection textDirection, double pageScaleFactor, const std::vector& items, int data, int selectedIndex, bool multiple);
+ void ShowPopupMenu(const std::vector& items,
+ int selectedIndex, bool multiple);
Eina_Bool HidePopupMenu();
void UpdateFormNavigation(int formElementCount, int currentNodeIndex,
bool prevState, bool nextState);
diff --git a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc
index 94d34aa..3f4e4db 100644
--- a/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc
+++ b/tizen_src/ewk/efl_integration/web_contents_delegate_efl.cc
@@ -441,27 +441,6 @@ void WebContentsDelegateEfl::SetContentSecurityPolicy(const std::string& policy,
}
}
-void WebContentsDelegateEfl::ShowPopupMenu(RenderFrameHost* render_frame_host,
- const gfx::Rect& rect,
- blink::TextDirection textDirection,
- double pageScaleFactor,
- const std::vector