diff options
author | m.kawonczyk <m.kawonczyk@samsung.com> | 2016-09-22 15:44:00 +0200 |
---|---|---|
committer | HyeKyoung Hwang <cookie@samsung.com> | 2016-10-28 11:10:18 +0900 |
commit | 37663bfecd30501b0aaea5b48e1341a31d101733 (patch) | |
tree | e53e6fb6d8826bd20ce5e1c36a928e1d4babb21b | |
parent | 33024a74876057a5c791438689f37f81d52be6c8 (diff) | |
download | browser-37663bfecd30501b0aaea5b48e1341a31d101733.tar.gz browser-37663bfecd30501b0aaea5b48e1341a31d101733.tar.bz2 browser-37663bfecd30501b0aaea5b48e1341a31d101733.zip |
The Dummy Button removal
[Issue] N/A
[Problem] WebView team managed to extract Evas_Object from
ewk_view smart object. This object can be focused
and unfocused, so The Dummy Button - proxy widget is
not needed anymore
[Solution] Delete The Dummy Button, add support for extracted
Evas_Object.
[Verify] Open any website, check if focus is working as
intended.
Change-Id: Idf388056f1c6be494f76b5d36fef0be6bcef4556
-rw-r--r-- | core/AbstractWebEngine/AbstractWebEngine.h | 6 | ||||
-rw-r--r-- | services/SimpleUI/SimpleUI.cpp | 1 | ||||
-rwxr-xr-x | services/WebEngineService/WebEngineService.cpp | 11 | ||||
-rw-r--r-- | services/WebEngineService/WebEngineService.h | 1 | ||||
-rwxr-xr-x | services/WebEngineService/WebView.cpp | 5 | ||||
-rw-r--r-- | services/WebEngineService/WebView.h | 1 | ||||
-rwxr-xr-x | services/WebPageUI/WebPageUI.cpp | 40 | ||||
-rw-r--r-- | services/WebPageUI/WebPageUI.h | 4 | ||||
-rw-r--r-- | services/WebPageUI/edc/WebPageUI_mob.edc | 19 |
9 files changed, 26 insertions, 62 deletions
diff --git a/core/AbstractWebEngine/AbstractWebEngine.h b/core/AbstractWebEngine/AbstractWebEngine.h index 693e2f0d..710f84b9 100644 --- a/core/AbstractWebEngine/AbstractWebEngine.h +++ b/core/AbstractWebEngine/AbstractWebEngine.h @@ -56,6 +56,12 @@ public: virtual T * getLayout() = 0; /** + * Remember that there must be at least 1 tab created to return layout + * @return pointer to Evas_Object widget connected with a current WebView. + */ + virtual Evas_Object* getWidget() = 0; + + /** * Initialize WebEngine. * @param guiParent GUI parent object (now should pass Evas_Object) * \todo make guiParent nonEFL object diff --git a/services/SimpleUI/SimpleUI.cpp b/services/SimpleUI/SimpleUI.cpp index 217a7b9e..1e80ace8 100644 --- a/services/SimpleUI/SimpleUI.cpp +++ b/services/SimpleUI/SimpleUI.cpp @@ -135,7 +135,6 @@ void SimpleUI::suspend() void SimpleUI::resume() { m_webEngine->preinitializeWebViewCache(); - m_webPageUI->createDummyButton(); m_webEngine->resume(); #if PROFILE_MOBILE if (m_findOnPageUI && m_findOnPageUI->isVisible()) diff --git a/services/WebEngineService/WebEngineService.cpp b/services/WebEngineService/WebEngineService.cpp index 5d918b64..ffe9aa10 100755 --- a/services/WebEngineService/WebEngineService.cpp +++ b/services/WebEngineService/WebEngineService.cpp @@ -83,6 +83,17 @@ Evas_Object * WebEngineService::getLayout() return m_currentWebView->getLayout(); } +Evas_Object * WebEngineService::getWidget() +{ + BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); + M_ASSERT(m_currentWebView); + if (!m_currentWebView) { + BROWSER_LOGD("[%s:%d:%s] ", __PRETTY_FUNCTION__, __LINE__, "m_currentWebView is null"); + return nullptr; + } + return m_currentWebView->getWidget(); +} + void WebEngineService::init(void * guiParent) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); diff --git a/services/WebEngineService/WebEngineService.h b/services/WebEngineService/WebEngineService.h index def644e2..925cb846 100644 --- a/services/WebEngineService/WebEngineService.h +++ b/services/WebEngineService/WebEngineService.h @@ -50,6 +50,7 @@ public: virtual std::string getName(); Evas_Object * getLayout(); + Evas_Object * getWidget(); void init(void * guiParent); void preinitializeWebViewCache(); diff --git a/services/WebEngineService/WebView.cpp b/services/WebEngineService/WebView.cpp index 139bcc22..bd47fb0d 100755 --- a/services/WebEngineService/WebView.cpp +++ b/services/WebEngineService/WebView.cpp @@ -644,6 +644,11 @@ Evas_Object * WebView::getLayout() return m_ewkView; } +Evas_Object * WebView::getWidget() +{ + return ewk_view_widget_get(m_ewkView); +} + void WebView::setURI(const std::string & uri) { BROWSER_LOGD("[%s:%d] uri=%s", __PRETTY_FUNCTION__, __LINE__, uri.c_str()); diff --git a/services/WebEngineService/WebView.h b/services/WebEngineService/WebView.h index f9601579..aaa99a72 100644 --- a/services/WebEngineService/WebView.h +++ b/services/WebEngineService/WebView.h @@ -109,6 +109,7 @@ public: std::map<std::string, std::vector<std::string> > parse_uri(const char *uriToParse); Evas_Object * getLayout(); + Evas_Object * getWidget(); void confirmationResult(WebConfirmationPtr); diff --git a/services/WebPageUI/WebPageUI.cpp b/services/WebPageUI/WebPageUI.cpp index 0c6227f1..efb210cb 100755 --- a/services/WebPageUI/WebPageUI.cpp +++ b/services/WebPageUI/WebPageUI.cpp @@ -37,7 +37,6 @@ EXPORT_SERVICE(WebPageUI, "org.tizen.browser.webpageui") WebPageUI::WebPageUI() : m_parent(nullptr) , m_mainLayout(nullptr) - , m_dummy_button(nullptr) , m_errorLayout(nullptr) , m_privateLayout(nullptr) , m_bookmarkManagerButton(nullptr) @@ -60,8 +59,6 @@ WebPageUI::WebPageUI() WebPageUI::~WebPageUI() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - evas_object_smart_callback_del(m_dummy_button, "focused", _dummy_button_focused); - evas_object_smart_callback_del(m_dummy_button, "unfocused", _dummy_button_unfocused); } void WebPageUI::init(Evas_Object* parent) @@ -486,43 +483,6 @@ void WebPageUI::createLayout() #endif } -void WebPageUI::createDummyButton() -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (!m_dummy_button) { - M_ASSERT(m_mainLayout); - m_dummy_button = elm_button_add(m_mainLayout); - elm_object_style_set(m_dummy_button, "invisible_button"); - evas_object_size_hint_align_set(m_dummy_button, EVAS_HINT_FILL, EVAS_HINT_FILL); - evas_object_size_hint_weight_set(m_dummy_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_focus_allow_set(m_dummy_button, EINA_TRUE); - elm_object_focus_set(m_dummy_button, EINA_TRUE); - evas_object_show(m_dummy_button); - elm_object_part_content_set(m_mainLayout, "web_view_dummy_button", m_dummy_button); - - evas_object_smart_callback_add(m_dummy_button, "focused", _dummy_button_focused, this); - evas_object_smart_callback_add(m_dummy_button, "unfocused", _dummy_button_unfocused, this); - } -} - -void WebPageUI::_dummy_button_focused(void *data, Evas_Object *, void *) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (data != nullptr) { - WebPageUI* webPageUI = static_cast<WebPageUI*>(data); - webPageUI->focusWebView(); - } -} - -void WebPageUI::_dummy_button_unfocused(void *data, Evas_Object *, void *) -{ - BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (data != nullptr) { - WebPageUI* webPageUI = static_cast<WebPageUI*>(data); - webPageUI->unfocusWebView(); - } -} - void WebPageUI::createErrorLayout() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); diff --git a/services/WebPageUI/WebPageUI.h b/services/WebPageUI/WebPageUI.h index 850dfaba..9080fba5 100644 --- a/services/WebPageUI/WebPageUI.h +++ b/services/WebPageUI/WebPageUI.h @@ -53,7 +53,6 @@ public: UrlHistoryPtr getUrlHistoryList(); virtual void showUI(); virtual void hideUI(); - void createDummyButton(); #if PROFILE_MOBILE virtual void orientationChanged() override; void fullscreenModeSet(bool state); @@ -121,8 +120,6 @@ private: static void faviconClicked(void* data, Evas_Object* obj, const char* emission, const char* source); static Eina_Bool _cb_down_pressed_on_urlbar(void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info); static void _bookmark_manager_clicked(void * data, Evas_Object *, void *); - static void _dummy_button_focused(void *data, Evas_Object *, void *); - static void _dummy_button_unfocused(void *data, Evas_Object *, void *); #if PROFILE_MOBILE static void _more_menu_background_clicked(void* data, Evas_Object*, const char*, const char*); static void _content_clicked(void * data, Evas_Object *, void *); @@ -163,7 +160,6 @@ private: Evas_Object* m_parent; Evas_Object* m_mainLayout; - Evas_Object* m_dummy_button; Evas_Object* m_errorLayout; Evas_Object* m_privateLayout; Evas_Object* m_bookmarkManagerButton; diff --git a/services/WebPageUI/edc/WebPageUI_mob.edc b/services/WebPageUI/edc/WebPageUI_mob.edc index 74b58071..116caa02 100644 --- a/services/WebPageUI/edc/WebPageUI_mob.edc +++ b/services/WebPageUI/edc/WebPageUI_mob.edc @@ -286,23 +286,8 @@ collections { base_scale: 2.6; name: "web_view"; type: SWALLOW; scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.0 0.0; - fixed: 0 0; - min: 0 0; - max: -1 -1; - rel1 { relative: 0.0 1.0; to: "uri_bar_bg"; } - rel2 { relative: 1.0 1.0; to: "bg"; } - } - } - part { - name: "web_view_dummy_button"; - type: SWALLOW; mouse_events: 1; repeat_events: 1; - scale: 1; description { state: "default" 0.0; visible: 1; @@ -310,8 +295,8 @@ collections { base_scale: 2.6; fixed: 0 0; min: 0 0; max: -1 -1; - rel1 { relative: 0.0 0.0; to: "web_view"; } - rel2 { relative: 1.0 1.0; to: "web_view"; } + rel1 { relative: 0.0 1.0; to: "uri_bar_bg"; } + rel2 { relative: 1.0 1.0; to: "bg"; } } } part { name: "progressbar_bg"; |