summaryrefslogtreecommitdiff
path: root/src/browser-view/browser-view.cpp
diff options
context:
space:
mode:
authorJunghwan <junghwan.kang@samsung.com>2012-08-24 19:53:21 +0900
committerJunghwan <junghwan.kang@samsung.com>2012-08-24 19:59:26 +0900
commit60a82f640268dcfa442d0a971123d917f2dc8913 (patch)
tree731b78e7e82cb39dcadefc1527c5ec3a2f35c8e4 /src/browser-view/browser-view.cpp
parent2190375684e767245067effc53ed12fda55bad36 (diff)
downloadbrowser-60a82f640268dcfa442d0a971123d917f2dc8913.tar.gz
browser-60a82f640268dcfa442d0a971123d917f2dc8913.tar.bz2
browser-60a82f640268dcfa442d0a971123d917f2dc8913.zip
Add share message/email function
[Title] Add share message/email function [Issue#] N/A [Problem] N/A [Cause] Policy for TIZEN has been changed [Solution] Add share message/email function [Team] Browser UI [Developer] Junghwan kang [Request] N/A Change-Id: I32604c8c0b6a8977518cefb4e5d58f9c18318337
Diffstat (limited to 'src/browser-view/browser-view.cpp')
-rwxr-xr-xsrc/browser-view/browser-view.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/browser-view/browser-view.cpp b/src/browser-view/browser-view.cpp
index 4dab52d1..cbfa592e 100755
--- a/src/browser-view/browser-view.cpp
+++ b/src/browser-view/browser-view.cpp
@@ -1961,6 +1961,19 @@ void Browser_View::__web_app_icon_url_get_cb(const char* icon_url, void* user_da
}
#endif
+void Browser_View::__url_editfield_share_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_View *browser_view = (Browser_View *)data;
+ const char *selected_text = elm_entry_selection_get(br_elm_editfield_entry_get(browser_view->m_option_header_url_edit_field));
+
+ if (browser_view->_show_share_popup(selected_text))
+ BROWSER_LOGE("_show_share_popup failed");
+}
+
Eina_Bool Browser_View::__show_scissorbox_view_idler_cb(void *data)
{
if (!data)
@@ -2032,6 +2045,18 @@ void Browser_View::_destroy_scissorbox_view(void)
evas_object_show(m_control_bar);
}
+void Browser_View::__share_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ BROWSER_LOGD("[%s]", __func__);
+ if (!data)
+ return;
+
+ Browser_View *browser_view = (Browser_View *)data;
+ browser_view->_destroy_more_context_popup();
+ browser_view->_show_share_popup(browser_view->get_url().c_str());
+}
+
+
void Browser_View::__private_cb(void *data, Evas_Object *obj, void *event_info)
{
BROWSER_LOGD("[%s]", __func__);
@@ -2535,6 +2560,9 @@ Eina_Bool Browser_View::_show_more_context_popup(void)
|| _get_edit_mode() == BR_FIND_WORD_MODE)
elm_object_item_disabled_set(sub_menu, EINA_TRUE);
+ sub_menu = elm_ctxpopup_item_append(m_more_context_popup, BR_STRING_SHARE, NULL,
+ __share_cb, this);
+
m_bookmark_on_off_icon = elm_icon_add(m_more_context_popup);
if(m_data_manager->get_history_db()->is_in_bookmark(get_url().c_str(), NULL)) {
@@ -2748,6 +2776,8 @@ Evas_Object *Browser_View::_create_option_header_url_layout(void)
BROWSER_LOGE("elm_editfield_add failed");
return NULL;
}
+ elm_entry_context_menu_item_add(br_elm_editfield_entry_get(m_option_header_url_edit_field),
+ BR_STRING_CTXMENU_SHARE, NULL, ELM_ICON_NONE, __url_editfield_share_clicked_cb, this);
elm_object_part_content_set(m_option_header_url_entry_layout, "elm.swallow.entry", m_option_header_url_edit_field);
// br_elm_editfield_entry_single_line_set(m_option_header_url_edit_field, EINA_TRUE);