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
void SimpleUI::resume()
{
m_webEngine->preinitializeWebViewCache();
- m_webPageUI->createDummyButton();
m_webEngine->resume();
#if PROFILE_MOBILE
if (m_findOnPageUI && m_findOnPageUI->isVisible())
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__);
virtual std::string getName();
Evas_Object * getLayout();
+ Evas_Object * getWidget();
void init(void * guiParent);
void preinitializeWebViewCache();
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());
std::map<std::string, std::vector<std::string> > parse_uri(const char *uriToParse);
Evas_Object * getLayout();
+ Evas_Object * getWidget();
void confirmationResult(WebConfirmationPtr);
WebPageUI::WebPageUI()
: m_parent(nullptr)
, m_mainLayout(nullptr)
- , m_dummy_button(nullptr)
, m_errorLayout(nullptr)
, m_privateLayout(nullptr)
, m_bookmarkManagerButton(nullptr)
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)
#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__);
UrlHistoryPtr getUrlHistoryList();
virtual void showUI();
virtual void hideUI();
- void createDummyButton();
#if PROFILE_MOBILE
virtual void orientationChanged() override;
void fullscreenModeSet(bool state);
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 *);
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;
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;
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";