From 1036ae1e8c389084bfd68e1bb92aee98d0d5e436 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Fri, 12 Jul 2013 20:23:03 +0900 Subject: [PATCH 01/16] fix logic for OnWebPageShowRequested() Change-Id: I0e74b9829d8bdea10989a54d80536c903e0ab17d Signed-off-by: Seongjun Yim --- src/controls/FWebCtrl_WebImpl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index d3f8135..c9661e9 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -3626,7 +3626,8 @@ _WebImpl::SetEventListenerCallback(void) const evas_object_smart_callback_add(pWebNativeNode, "policy,response,decide", OnWebDataReceived, this); - evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this); + evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageShowRequested, this); +// evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this); evas_object_smart_callback_add(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested, this); evas_object_smart_callback_add(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted, this); @@ -3710,7 +3711,8 @@ _WebImpl::RemoveEventListenerCallback(void) const evas_object_smart_callback_del(pWebNativeNode, "policy,response,decide", OnWebDataReceived); - evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested); + evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageShowRequested, this); +// evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested); evas_object_smart_callback_del(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested); evas_object_smart_callback_del(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted); -- 2.7.4 From 022ed492a88e1b6f7c0bafdc703c7dad866b5043 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Fri, 12 Jul 2013 11:27:37 +0000 Subject: [PATCH 02/16] Revert "fix logic for OnWebPageShowRequested()" This reverts commit 1036ae1e8c389084bfd68e1bb92aee98d0d5e436 Change-Id: Ia07fd492f05cd42f3e1ed6d5a78e7ff91eeb910c --- src/controls/FWebCtrl_WebImpl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index c9661e9..d3f8135 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -3626,8 +3626,7 @@ _WebImpl::SetEventListenerCallback(void) const evas_object_smart_callback_add(pWebNativeNode, "policy,response,decide", OnWebDataReceived, this); - evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageShowRequested, this); -// evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this); + evas_object_smart_callback_add(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested, this); evas_object_smart_callback_add(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested, this); evas_object_smart_callback_add(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted, this); @@ -3711,8 +3710,7 @@ _WebImpl::RemoveEventListenerCallback(void) const evas_object_smart_callback_del(pWebNativeNode, "policy,response,decide", OnWebDataReceived); - evas_object_smart_callback_add(pWebNativeNode, "frame,rendered", OnWebPageShowRequested, this); -// evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested); + evas_object_smart_callback_del(pWebNativeNode, "load,nonemptylayout,finished", OnWebPageShowRequested); evas_object_smart_callback_del(pWebNativeNode, "request,certificate,confirm", OnCertificateRequested); evas_object_smart_callback_del(pWebNativeNode, "usermedia,permission,request", OnGetUserMediaPermissionRequsted); -- 2.7.4 From 8c59c7f4225c306cd9e6220d6b5b6cb7c609543e Mon Sep 17 00:00:00 2001 From: Hyunseok Yang Date: Fri, 12 Jul 2013 20:12:12 +0900 Subject: [PATCH 03/16] fixed tc error in GetEvasFromUiApp Change-Id: I89af9a068b0dc342782af2545a4b3c8e2bdc37ac Signed-off-by: Hyunseok Yang --- src/FWeb_BookmarkItemImpl.cpp | 43 +++++++++++++++++++++++---------- src/FWeb_HistoryItemImpl.cpp | 50 +++++++++++++++++++++++++++------------ src/FWeb_WebBookmarkImpl.cpp | 35 +++++++++++++++++++-------- src/controls/FWebCtrl_Utility.cpp | 21 ++++++++-------- src/controls/FWebCtrl_Utility.h | 7 +++++- 5 files changed, 106 insertions(+), 50 deletions(-) diff --git a/src/FWeb_BookmarkItemImpl.cpp b/src/FWeb_BookmarkItemImpl.cpp index 63bca69..3ad4240 100755 --- a/src/FWeb_BookmarkItemImpl.cpp +++ b/src/FWeb_BookmarkItemImpl.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "FWeb_BookmarkItemImpl.h" #include "FWebCtrl_Utility.h" @@ -35,6 +36,7 @@ using namespace Tizen::Base; using namespace Tizen::Graphics; +using namespace Tizen::Ui::Controls; using namespace Tizen::Web::Controls; @@ -87,36 +89,51 @@ Bitmap* _BookmarkItemImpl::GetFaviconN(void) const { result r = E_SUCCESS; + Frame* pFrame = null; + Evas* pEvas = null; + Evas_Object* pIcon = null; + + BufferInfo bufferInfo; + ByteBuffer byteBuffer; - Evas* pEvas = _Utility::GetEvasFromUiApp(); - SysTryReturn(NID_WEB, pEvas, null, E_SYSTEM, "[E_SYSTEM] Propagating."); + std::unique_ptr pImage; + Dimension dimension; + int ret = 0; - Evas_Object* pIcon = null; - int ret = favorites_bookmark_get_favicon(__id, pEvas, &pIcon); - SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, null, E_SYSTEM, "[E_SYSTEM] Propagating."); + pEvas = _Utility::GetEvasFromUiApp(pFrame); + SysTryCatch(NID_WEB, pEvas, , E_SYSTEM, "[E_SYSTEM] Propagating."); + + ret = favorites_bookmark_get_favicon(__id, pEvas, &pIcon); + SysTryCatch(NID_WEB, ret == FAVORITES_ERROR_NONE, , E_SYSTEM, "[E_SYSTEM] Propagating."); if (!pIcon) { return null; } - BufferInfo bufferInfo; r = _Utility::GetPixelBufferFromEvasObject(pIcon, bufferInfo); - SysTryReturn(NID_WEB, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - const Dimension dimension(bufferInfo.width, bufferInfo.height); + dimension.width = bufferInfo.width; + dimension.height = bufferInfo.height; - ByteBuffer byteBuffer; r = byteBuffer.Construct(reinterpret_cast < byte* >(bufferInfo.pPixels), 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 ); - SysTryReturn(NID_WEB, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - std::unique_ptr pImage(new (std::nothrow) Bitmap()); - SysTryReturn(NID_WEB, pImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); + pImage = std::unique_ptr(new (std::nothrow) Bitmap()); + SysTryCatch(NID_WEB, pImage.get(), , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); r = pImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888); - SysTryReturn(NID_WEB, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + delete pFrame; return pImage.release(); + +CATCH: + delete pFrame; + + return null; } diff --git a/src/FWeb_HistoryItemImpl.cpp b/src/FWeb_HistoryItemImpl.cpp index 9315ff6..30b4f2c 100755 --- a/src/FWeb_HistoryItemImpl.cpp +++ b/src/FWeb_HistoryItemImpl.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "FWeb_HistoryItemImpl.h" #include "FWebCtrl_Utility.h" @@ -37,6 +38,7 @@ using namespace Tizen::Base; using namespace Tizen::Graphics; +using namespace Tizen::Ui::Controls; using namespace Tizen::Web::Controls; @@ -84,22 +86,33 @@ Bitmap* _HistoryItemImpl::GetFaviconN(void) const { result r = E_SUCCESS; - - Evas* pEvas = _Utility::GetEvasFromUiApp(); - SysTryReturn(NID_WEB_CTRL, pEvas, null, E_SYSTEM, "[E_SYSTEM] Propagating."); + Frame* pFrame = null; Evas_Object* pIcon = null; + + Ewk_Context* pDefaultContext = null; + std::unique_ptr pUrl; + std::unique_ptr pBitmapImage; + + int ret = 0; + Dimension dimension; + BufferInfo bufferInfo; + ByteBuffer byteBuffer; + + Evas* pEvas = _Utility::GetEvasFromUiApp(pFrame); + SysTryCatch(NID_WEB_CTRL, pEvas, , E_SYSTEM, "[E_SYSTEM] Propagating."); + if( __id == -1) { - Ewk_Context* pDefaultContext = ewk_context_default_get(); + pDefaultContext = ewk_context_default_get(); - const std::unique_ptr pUrl(_StringConverter::CopyToCharArrayN(__url)); + pUrl = std::unique_ptr(_StringConverter::CopyToCharArrayN(__url)); pIcon = ewk_context_icon_database_icon_object_add(pDefaultContext, pUrl.get(), pEvas); } else { - int ret = favorites_history_get_favicon(__id, pEvas, &pIcon); - SysTryReturn(NID_WEB_CTRL, ret == FAVORITES_ERROR_NONE, null, E_SYSTEM, "[E_SYSTEM] Propagating."); + ret = favorites_history_get_favicon(__id, pEvas, &pIcon); + SysTryCatch(NID_WEB_CTRL, ret == FAVORITES_ERROR_NONE, , E_SYSTEM, "[E_SYSTEM] Propagating."); } if (!pIcon) @@ -107,23 +120,30 @@ _HistoryItemImpl::GetFaviconN(void) const return null; } - BufferInfo bufferInfo; r = _Utility::GetPixelBufferFromEvasObject(pIcon, bufferInfo); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - const Dimension dimension(bufferInfo.width, bufferInfo.height); + dimension.width = bufferInfo.width; + dimension.height = bufferInfo.height; - ByteBuffer byteBuffer; r = byteBuffer.Construct(reinterpret_cast < byte* >(bufferInfo.pPixels), 0, dimension.height * dimension.width * 32, dimension.height * dimension.width * 32 ); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); - std::unique_ptr pBitmapImage(new (std::nothrow) Bitmap()); - SysTryReturn(NID_WEB_CTRL, pBitmapImage.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); + pBitmapImage = std::unique_ptr(new (std::nothrow) Bitmap()); + SysTryCatch(NID_WEB_CTRL, pBitmapImage.get(), , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); r = pBitmapImage->Construct(byteBuffer, dimension, BITMAP_PIXEL_FORMAT_ARGB8888); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); + SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); + + + delete pFrame; return pBitmapImage.release(); + +CATCH: + delete pFrame; + + return null; } diff --git a/src/FWeb_WebBookmarkImpl.cpp b/src/FWeb_WebBookmarkImpl.cpp index 2b7632e..caed0aa 100755 --- a/src/FWeb_WebBookmarkImpl.cpp +++ b/src/FWeb_WebBookmarkImpl.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "FWeb_BookmarkItemImpl.h" #include "FWeb_WebBookmarkImpl.h" #include "FWebCtrl_Utility.h" @@ -36,6 +37,7 @@ using namespace Tizen::Base; using namespace Tizen::Graphics; +using namespace Tizen::Ui::Controls; using namespace Tizen::Web::Controls; @@ -144,32 +146,45 @@ _WebBookmarkImpl::SetFavicon(RecordId bookmarkId, const Bitmap& favicon) SysTryReturnResult(NID_WEB, favicon.GetPixelColorFormat() == BITMAP_PIXEL_FORMAT_ARGB8888, E_INVALID_DATA, "The pixel format of a favicon must be ARGB8888"); result r = E_SUCCESS; + Frame* pFrame = null; - Evas* pEvas = _Utility::GetEvasFromUiApp(); - SysTryReturn(NID_WEB, pEvas, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); + BufferInfo bufferInfo; + int ret = 0; + + Evas_Object* pIcon = null; + + Bitmap& temp = const_cast< Bitmap& >(favicon);; + + Evas* pEvas = _Utility::GetEvasFromUiApp(pFrame); + SysTryCatch(NID_WEB, pEvas, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r)); - Evas_Object* pIcon = evas_object_image_filled_add(pEvas); + pIcon = evas_object_image_filled_add(pEvas); evas_object_image_colorspace_set(pIcon, EVAS_COLORSPACE_ARGB8888); evas_object_image_filled_set(pIcon, EINA_TRUE); evas_object_image_alpha_set(pIcon,EINA_TRUE); - Bitmap& temp = const_cast< Bitmap& >(favicon); - - BufferInfo bufferInfo; r = temp.Lock(bufferInfo); - SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", r); + SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", r); evas_object_image_size_set(pIcon, bufferInfo.width, bufferInfo.height); evas_object_image_fill_set(pIcon, 0, 0, bufferInfo.width, bufferInfo.height); evas_object_image_data_set(pIcon, bufferInfo.pPixels); r = temp.Unlock(); - SysTryReturn(NID_WEB, r == E_SUCCESS, r, r, "[%s] Propagating.", r); + SysTryCatch(NID_WEB, r == E_SUCCESS, , r, "[%s] Propagating.", r); - int ret = favorites_bookmark_set_favicon(bookmarkId, pIcon); - SysTryReturn(NID_WEB, ret == FAVORITES_ERROR_NONE, ConvertErrorCode(ret), ConvertErrorCode(ret), "[%s] Propagating.", GetErrorMessage(ConvertErrorCode(ret))); + ret = favorites_bookmark_set_favicon(bookmarkId, pIcon); + SysTryCatch(NID_WEB, ret == FAVORITES_ERROR_NONE, r = ConvertErrorCode(ret), r, "[%s] Propagating.", GetErrorMessage(r)); + + + delete pFrame; return E_SUCCESS; + +CATCH: + delete pFrame; + + return r; } diff --git a/src/controls/FWebCtrl_Utility.cpp b/src/controls/FWebCtrl_Utility.cpp index 78e7b2c..4684712 100755 --- a/src/controls/FWebCtrl_Utility.cpp +++ b/src/controls/FWebCtrl_Utility.cpp @@ -22,7 +22,6 @@ * The file contains the definition of _Utility class. */ -#include #include #include #include @@ -58,24 +57,24 @@ _Utility::~_Utility(void) Evas* -_Utility::GetEvasFromUiApp() +_Utility::GetEvasFromUiApp(Tizen::Ui::Controls::Frame* pTempFrame) { - std::unique_ptr pFrame; - + Frame* pFrame = null; + Evas* pEvas = null; if (_AppInfo::GetAppType() == _APP_TYPE_UI_APP) { IAppFrame* pAppFrame = Application::GetInstance()->GetAppFrame(); SysTryReturn(NID_WEB_CTRL, pAppFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - pFrame = std::unique_ptr(pAppFrame->GetFrame()); - SysTryReturn(NID_WEB_CTRL, pFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - - pFrame.release(); + pFrame = pAppFrame->GetFrame(); + SysTryReturn(NID_WEB_CTRL, pFrame, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); } else { - pFrame = std::unique_ptr(new (std::nothrow) Frame()); - pFrame->Construct(Rectangle(0, 0, SEVICE_APP_FRAME_SIZE, SEVICE_APP_FRAME_SIZE)); + pFrame = new (std::nothrow) Frame(); + pFrame->Construct(Rectangle(0, 0, SEVICE_APP_FRAME_SIZE, SEVICE_APP_FRAME_SIZE)); + + pTempFrame = pFrame; } _ControlImpl* pControlimpl = _ControlImpl::GetInstance(*pFrame); @@ -90,7 +89,7 @@ _Utility::GetEvasFromUiApp() _EflNode* pEflNode = dynamic_cast< _EflNode* >(pWebVisualElementImpl->GetNativeNode()); SysTryReturn(NID_WEB_CTRL, pEflNode, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - Evas* pEvas = pEflNode->GetEvas(); + pEvas = pEflNode->GetEvas(); SysTryReturn(NID_WEB_CTRL, pEvas, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); return pEvas; diff --git a/src/controls/FWebCtrl_Utility.h b/src/controls/FWebCtrl_Utility.h index 65d4986..32955ad 100755 --- a/src/controls/FWebCtrl_Utility.h +++ b/src/controls/FWebCtrl_Utility.h @@ -28,13 +28,18 @@ #include #include +namespace Tizen { namespace Ui { namespace Controls +{ +class Frame; +}}} + namespace Tizen { namespace Web { namespace Controls { class _Utility { public: - static Evas* GetEvasFromUiApp(void); + static Evas* GetEvasFromUiApp(Tizen::Ui::Controls::Frame* pTempFrame); static result GetPixelBufferFromEvasObject(const Evas_Object* source, Tizen::Graphics::BufferInfo& bufferInfo); -- 2.7.4 From 870fbf601bd83f2843c3df854af6e47724f62986 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Mon, 15 Jul 2013 12:14:55 +0900 Subject: [PATCH 04/16] modification for support extension SDK Change-Id: I01b62fb18a1886068358768b8024eeed12c41e93 Signed-off-by: Seongjun Yim --- src/controls/{ => inc}/FWebCtrl_CertificateConfirmPopup.h | 0 src/controls/{ => inc}/FWebCtrl_IWebEventListener.h | 0 src/controls/{ => inc}/FWebCtrl_UserConfirmPopup.h | 0 src/controls/{ => inc}/FWebCtrl_WebPopup.h | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename src/controls/{ => inc}/FWebCtrl_CertificateConfirmPopup.h (100%) rename src/controls/{ => inc}/FWebCtrl_IWebEventListener.h (100%) rename src/controls/{ => inc}/FWebCtrl_UserConfirmPopup.h (100%) rename src/controls/{ => inc}/FWebCtrl_WebPopup.h (100%) diff --git a/src/controls/FWebCtrl_CertificateConfirmPopup.h b/src/controls/inc/FWebCtrl_CertificateConfirmPopup.h similarity index 100% rename from src/controls/FWebCtrl_CertificateConfirmPopup.h rename to src/controls/inc/FWebCtrl_CertificateConfirmPopup.h diff --git a/src/controls/FWebCtrl_IWebEventListener.h b/src/controls/inc/FWebCtrl_IWebEventListener.h similarity index 100% rename from src/controls/FWebCtrl_IWebEventListener.h rename to src/controls/inc/FWebCtrl_IWebEventListener.h diff --git a/src/controls/FWebCtrl_UserConfirmPopup.h b/src/controls/inc/FWebCtrl_UserConfirmPopup.h similarity index 100% rename from src/controls/FWebCtrl_UserConfirmPopup.h rename to src/controls/inc/FWebCtrl_UserConfirmPopup.h diff --git a/src/controls/FWebCtrl_WebPopup.h b/src/controls/inc/FWebCtrl_WebPopup.h similarity index 100% rename from src/controls/FWebCtrl_WebPopup.h rename to src/controls/inc/FWebCtrl_WebPopup.h -- 2.7.4 From f0c4d1756ba89dace277915bf7198f4af60517b6 Mon Sep 17 00:00:00 2001 From: hyun lee Date: Mon, 15 Jul 2013 19:05:48 +0900 Subject: [PATCH 05/16] Fix for issue Change-Id: I283b23ad83f5adfc9f8e09f15a40b2821e0f0030 Signed-off-by: hyun lee --- src/controls/FWebCtrl_WebImpl.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index d3f8135..073b09a 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -1810,15 +1810,15 @@ OnWindowObjectFocusGained(void* pUserData, Evas_Object* pWin, void* pEvent_info) _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData); SysAssertf(pImpl, "Failed to request"); - if (pImpl->IsKeypadOpened() == true && pImpl->IsVisible() == true) + if (pImpl->IsKeypadOpened() == true && pImpl->IsVisible() == true && pImpl->IsFocused() == true) { _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); SysAssertf(pWebCore, "Failed to get Web core object"); evas_object_focus_set(pWebCore->GetWebNativeNode(), EINA_TRUE); - } - pImpl->SetKeypadOpened(false); + pImpl->SetKeypadVisibleState(true); + } } @@ -1830,9 +1830,7 @@ OnWebNativeNodeFocusGained(void* pUserData, Evas* pCanvas, Evas_Object* pView, v if (pImpl->IsKeypadOpened() == true) { - pImpl->SetKeypadOpened(false); - - pImpl->SetFocused(); + pImpl->SetKeypadOpened(false); } } -- 2.7.4 From b41291b99ff6797ff1d8382e0497c8f186a2dee7 Mon Sep 17 00:00:00 2001 From: hyun lee Date: Tue, 16 Jul 2013 10:10:53 +0900 Subject: [PATCH 06/16] Fix for issue about focus ui Change-Id: If919007bffdf2d19442f30f3bcb98b41c46b2f29 Signed-off-by: hyun lee --- src/controls/FWebCtrl_Web.cpp | 58 +++++++++++++++++++++++++++++++++++++++ src/controls/FWebCtrl_Web.h | 9 ++++++ src/controls/FWebCtrl_WebImpl.cpp | 28 +++++++++++++++++++ 3 files changed, 95 insertions(+) diff --git a/src/controls/FWebCtrl_Web.cpp b/src/controls/FWebCtrl_Web.cpp index 74782d2..9d97cb9 100755 --- a/src/controls/FWebCtrl_Web.cpp +++ b/src/controls/FWebCtrl_Web.cpp @@ -340,6 +340,7 @@ _Web::_Web(void) , __pPinchGestureHandler(null) , __gestureType(WEB_GESTURE_TYPE_TAP) , __edgeType(WEB_EDGE_NONE) + , __focus(false) , __pTextElement(null) , __previousTouchedPosition(0.0f, 0.0f) { @@ -691,6 +692,63 @@ _Web::SetEdgeReachedEvent(_WebEdgeType type) } +void +_Web::SetFocusEnd(bool focus) +{ + __focus = focus; +} + + +bool +_Web::IsFocusEnd(void) +{ + return __focus; +} + + +bool +_Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) +{ + _KeyCode keyCode = keyInfo.GetKeyCode(); + Evas* pEvas = evas_object_evas_get(GetWebNativeNode()); + + if (IsFocusEnd() == true) + { + SetFocusEnd(false); + evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); + return false; + } + + switch(keyCode) + { + case _KEY_UP: + case _KEY_DOWN: + evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); + return false; + break; + default: + break; + } + + evas_object_focus_set(GetWebNativeNode(), EINA_TRUE); + + return true; +} + + +bool +_Web::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) +{ + return false; +} + + +void +_Web::OnDrawFocus(void) +{ +} + + bool _Web::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { diff --git a/src/controls/FWebCtrl_Web.h b/src/controls/FWebCtrl_Web.h index a1878ae..bf6fa51 100755 --- a/src/controls/FWebCtrl_Web.h +++ b/src/controls/FWebCtrl_Web.h @@ -115,9 +115,16 @@ public: void SetEdgeReachedEvent(_WebEdgeType type); + void SetFocusEnd(bool focus); + bool IsFocusEnd(void); + virtual result OnAttaching(const _Control* pParent); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual bool OnKeyPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); + virtual bool OnKeyReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); + virtual void OnDrawFocus(void); + virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); @@ -193,6 +200,8 @@ private: int __edgeType; + bool __focus; + Tizen::Ui::_AccessibilityElement* __pTextElement; Tizen::Graphics::FloatPoint __previousTouchedPosition; diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 073b09a..0f7e88e 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -856,6 +856,28 @@ OnFullScreenExited(void* pUserData, Evas_Object* pView, void* pEventInfo) void +OnFocusDownRequested(void* pUserData, Evas_Object* pView, void* pEventInfo) +{ + _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData); + SysAssertf(pImpl, "Failed to request"); + + _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); + //pWebCore->SetFocusEnd(true); +} + + +void +OnFocusUpRequested(void* pUserData, Evas_Object* pView, void* pEventInfo) +{ + _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData); + SysAssertf(pImpl, "Failed to request"); + + _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); + //pWebCore->SetFocusEnd(true); +} + + +void OnVibrationRequested(uint64_t duration, void* pUserData) { result r = E_SUCCESS; @@ -3649,6 +3671,9 @@ _WebImpl::SetEventListenerCallback(void) const evas_object_smart_callback_add(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered, this); evas_object_smart_callback_add(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited, this); + evas_object_smart_callback_add(pWebNativeNode, "keyevent,down,not,handled", OnFocusDownRequested, this); + evas_object_smart_callback_add(pWebNativeNode, "keyevent,up,not,handled", OnFocusUpRequested, this); + ewk_view_open_panel_callback_set(pWebNativeNode, OnSelectUploadFile, const_cast< _WebImpl* >(this)); Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode); SysAssertf(pContext, "Failed to get webkit instance."); @@ -3733,6 +3758,9 @@ _WebImpl::RemoveEventListenerCallback(void) const evas_object_smart_callback_del(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered); evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited); + evas_object_smart_callback_del(pWebNativeNode, "keyevent,down,not,handled", OnFocusDownRequested); + evas_object_smart_callback_del(pWebNativeNode, "keyevent,up,not,handled", OnFocusUpRequested); + ewk_view_open_panel_callback_set(null, null, null); Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode); SysAssertf(pContext, "Failed to get webkit instance."); -- 2.7.4 From e2c6ef9870115e7baa35fa7f58502457537c6c98 Mon Sep 17 00:00:00 2001 From: hyun lee Date: Tue, 16 Jul 2013 16:23:42 +0900 Subject: [PATCH 07/16] Remove focus ui code Change-Id: I5c33f1cf5712aa8d26ead6539aaf6880257fba2c Signed-off-by: hyun lee --- src/controls/FWebCtrl_Web.cpp | 58 ------------------------------------------- src/controls/FWebCtrl_Web.h | 9 ------- 2 files changed, 67 deletions(-) diff --git a/src/controls/FWebCtrl_Web.cpp b/src/controls/FWebCtrl_Web.cpp index 9d97cb9..74782d2 100755 --- a/src/controls/FWebCtrl_Web.cpp +++ b/src/controls/FWebCtrl_Web.cpp @@ -340,7 +340,6 @@ _Web::_Web(void) , __pPinchGestureHandler(null) , __gestureType(WEB_GESTURE_TYPE_TAP) , __edgeType(WEB_EDGE_NONE) - , __focus(false) , __pTextElement(null) , __previousTouchedPosition(0.0f, 0.0f) { @@ -692,63 +691,6 @@ _Web::SetEdgeReachedEvent(_WebEdgeType type) } -void -_Web::SetFocusEnd(bool focus) -{ - __focus = focus; -} - - -bool -_Web::IsFocusEnd(void) -{ - return __focus; -} - - -bool -_Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) -{ - _KeyCode keyCode = keyInfo.GetKeyCode(); - Evas* pEvas = evas_object_evas_get(GetWebNativeNode()); - - if (IsFocusEnd() == true) - { - SetFocusEnd(false); - evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); - return false; - } - - switch(keyCode) - { - case _KEY_UP: - case _KEY_DOWN: - evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); - return false; - break; - default: - break; - } - - evas_object_focus_set(GetWebNativeNode(), EINA_TRUE); - - return true; -} - - -bool -_Web::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) -{ - return false; -} - - -void -_Web::OnDrawFocus(void) -{ -} - - bool _Web::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { diff --git a/src/controls/FWebCtrl_Web.h b/src/controls/FWebCtrl_Web.h index bf6fa51..a1878ae 100755 --- a/src/controls/FWebCtrl_Web.h +++ b/src/controls/FWebCtrl_Web.h @@ -115,16 +115,9 @@ public: void SetEdgeReachedEvent(_WebEdgeType type); - void SetFocusEnd(bool focus); - bool IsFocusEnd(void); - virtual result OnAttaching(const _Control* pParent); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); - virtual bool OnKeyPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); - virtual bool OnKeyReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); - virtual void OnDrawFocus(void); - virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); @@ -200,8 +193,6 @@ private: int __edgeType; - bool __focus; - Tizen::Ui::_AccessibilityElement* __pTextElement; Tizen::Graphics::FloatPoint __previousTouchedPosition; -- 2.7.4 From 542379999dca1f7f04839360909bcf54dc6d13c2 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Tue, 16 Jul 2013 17:57:47 +0900 Subject: [PATCH 08/16] fix once crash issue Change-Id: Ie1b2d5405d10d66de817b97c77d36b20e23acaba Signed-off-by: Seongjun Yim --- CMakeLists.txt | 1 + src/controls/FWebCtrl_Web.cpp | 57 +++++++++ src/controls/FWebCtrl_Web.h | 9 ++ src/controls/FWebCtrl_WebImpl.cpp | 60 ++++----- src/controls/FWebCtrl_WebManager.cpp | 155 ++++++++++++++++++++++++ src/controls/FWebCtrl_WebManager.h | 64 ++++++++++ src/controls/FWebCtrl_WebPresenter.cpp | 21 ++-- src/controls/FWebCtrl_WebPresenter.h | 6 +- src/controls/FWebCtrl_WebStorageManagerImpl.cpp | 50 ++++---- src/controls/inc/FWebCtrl_WebImpl.h | 3 - 10 files changed, 347 insertions(+), 79 deletions(-) create mode 100755 src/controls/FWebCtrl_WebManager.cpp create mode 100755 src/controls/FWebCtrl_WebManager.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7383223..edbe3ef 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,7 @@ SET (${this_target}_SOURCE_FILES src/controls/FWebCtrl_WebNotification.cpp src/controls/FWebCtrl_WebNotificationHandler.cpp src/controls/FWebCtrl_FormDataWindow.cpp + src/controls/FWebCtrl_WebManager.cpp ) ## Add Definitions ADD_DEFINITIONS(${OSP_DEFINITIONS} -D_MODEL_RES_WVGA) diff --git a/src/controls/FWebCtrl_Web.cpp b/src/controls/FWebCtrl_Web.cpp index 74782d2..44a5586 100755 --- a/src/controls/FWebCtrl_Web.cpp +++ b/src/controls/FWebCtrl_Web.cpp @@ -340,6 +340,7 @@ _Web::_Web(void) , __pPinchGestureHandler(null) , __gestureType(WEB_GESTURE_TYPE_TAP) , __edgeType(WEB_EDGE_NONE) + , __focus(false) , __pTextElement(null) , __previousTouchedPosition(0.0f, 0.0f) { @@ -691,6 +692,62 @@ _Web::SetEdgeReachedEvent(_WebEdgeType type) } +void +_Web::SetFocusEnd(bool focus) +{ + __focus = focus; +} + + +bool +_Web::IsFocusEnd(void) +{ + return __focus; +} + + +bool +_Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) +{ + _KeyCode keyCode = keyInfo.GetKeyCode(); + + if (IsFocusEnd() == true) + { + SetFocusEnd(false); + evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); + return false; + } + + switch(keyCode) + { + case _KEY_UP: + case _KEY_DOWN: + evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); + return false; + break; + default: + break; + } + + evas_object_focus_set(GetWebNativeNode(), EINA_TRUE); + + return true; +} + + +bool +_Web::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) +{ + return false; +} + + +void +_Web::OnDrawFocus(void) +{ +} + + bool _Web::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { diff --git a/src/controls/FWebCtrl_Web.h b/src/controls/FWebCtrl_Web.h index a1878ae..bf6fa51 100755 --- a/src/controls/FWebCtrl_Web.h +++ b/src/controls/FWebCtrl_Web.h @@ -115,9 +115,16 @@ public: void SetEdgeReachedEvent(_WebEdgeType type); + void SetFocusEnd(bool focus); + bool IsFocusEnd(void); + virtual result OnAttaching(const _Control* pParent); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); + virtual bool OnKeyPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); + virtual bool OnKeyReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); + virtual void OnDrawFocus(void); + virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); @@ -193,6 +200,8 @@ private: int __edgeType; + bool __focus; + Tizen::Ui::_AccessibilityElement* __pTextElement; Tizen::Graphics::FloatPoint __previousTouchedPosition; diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 0f7e88e..49bd587 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -107,6 +107,7 @@ #include "FWebCtrl_WebEvent.h" #include "FWebCtrl_WebEventArg.h" #include "FWebCtrl_WebImpl.h" +#include "FWebCtrl_WebManager.h" #include "FWebCtrl_WebPresenter.h" #include "FWebCtrl_WebSettingImpl.h" @@ -861,8 +862,8 @@ OnFocusDownRequested(void* pUserData, Evas_Object* pView, void* pEventInfo) _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData); SysAssertf(pImpl, "Failed to request"); - _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); - //pWebCore->SetFocusEnd(true); +// _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); +// pWebCore->SetFocusEnd(true); } @@ -872,8 +873,8 @@ OnFocusUpRequested(void* pUserData, Evas_Object* pView, void* pEventInfo) _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData); SysAssertf(pImpl, "Failed to request"); - _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); - //pWebCore->SetFocusEnd(true); +// _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); +// pWebCore->SetFocusEnd(true); } @@ -2093,7 +2094,8 @@ OnScriptExecuted(Evas_Object* pView, const char* pResult, void* pUserData) SysLog(NID_WEB_CTRL, "result : %ls", result.GetPointer()); _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(evas_object_data_get(pView, WEB_CTRL)); - if (pImpl && pImpl->IsPresenterAlived(pPresenter)) + _WebManager* pWebManager = _WebManager::GetInstance(); + if (pWebManager->IsValidCallback(reinterpret_cast< int >(pImpl), reinterpret_cast< int >(pPresenter))) { pPresenter->EndAsyncProcess(result); } @@ -2255,6 +2257,9 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore) _WebImpl::~_WebImpl() { + _WebManager* pWebManager = _WebManager::GetInstance(); + pWebManager->RemoveWeb(reinterpret_cast< int >(this)); + _DownloadManagerImpl* pManagerImpl = _DownloadManagerImpl::GetInstance(); pManagerImpl->SetDownloadListener(null); @@ -2336,9 +2341,6 @@ _WebImpl::Construct(void) r = __textSearch.__searchQueue.Construct(); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = __callbackList.Construct(); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - r = __webNotificationList.Construct(); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -2356,6 +2358,9 @@ _WebImpl::Construct(void) __pWebCore = dynamic_cast< _Web* >(&(GetCore())); SysTryReturnResult(NID_WEB_CTRL, __pWebCore, E_SYSTEM, "A system error has been occurred. Failed to get web control"); + _WebManager* pWebManager = _WebManager::GetInstance(); + pWebManager->AddWeb(reinterpret_cast< int >(this)); + return E_SUCCESS; } @@ -2663,35 +2668,20 @@ _WebImpl::EvaluateJavascriptN(const String& scriptCode) return null; } - result r = E_SUCCESS; - std::unique_ptr pScript(_StringConverter::CopyToCharArrayN(scriptCode)); SysTryReturn(NID_WEB_CTRL, pScript.get(), null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult())); - std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter()); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); SysTryReturn(NID_WEB_CTRL, pPresenter.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - r = __callbackList.Add(pPresenter.get()); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - ewk_view_script_execute(pView, pScript.get(), OnScriptExecuted, pPresenter.get()); std::unique_ptr pResult(new (std::nothrow) String(L"")); SysTryReturn(NID_WEB_CTRL, pResult.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - pPresenter->WaitAsyncProcess(*pResult.get()); - - r = __callbackList.Remove(*pPresenter.get()); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r)); - pPresenter.release(); - - return pResult.release(); -} + pPresenter->WaitAsyncProcess(*pResult.get()); -bool -_WebImpl::IsPresenterAlived(_WebPresenter* pPresenter) const -{ - return __callbackList.Contains(*pPresenter); + return pResult.release(); } @@ -2811,14 +2801,14 @@ _WebImpl::SearchText(const String& text, bool searchForward) condition = static_cast < Ewk_Find_Options >(condition | EWK_FIND_OPTIONS_BACKWARDS); } - _WebPresenter presenter; - presenter.InitAsyncProcess(); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); + SysTryReturn(NID_WEB_CTRL, pPresenter.get(), false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - r = SynchronizeSearch(SEARCH_SYNC, pView, condition, text, searchForward, false, &presenter); - SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + r = SynchronizeSearch(SEARCH_SYNC, pView, condition, text, searchForward, false, pPresenter.get()); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r)); int result = 0; - presenter.WaitAsyncProcess(result); + pPresenter->WaitAsyncProcess(result); return static_cast < bool >(result); } @@ -3313,13 +3303,13 @@ _WebImpl::IsCookieEnabled(void) const Ewk_Cookie_Manager* pCookieManager = ewk_context_cookie_manager_get(pContext); SysAssertf(pCookieManager, "Failed to get webkit instance."); - _WebPresenter presenter; - presenter.InitAsyncProcess(); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); + SysTryReturn(NID_WEB_CTRL, pPresenter.get(), false, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - ewk_cookie_manager_async_accept_policy_get(pCookieManager, OnCookiesPolicyGot, &presenter); + ewk_cookie_manager_async_accept_policy_get(pCookieManager, OnCookiesPolicyGot, pPresenter.get()); bool result = false; - presenter.WaitAsyncProcess(result); + pPresenter->WaitAsyncProcess(result); return result; } diff --git a/src/controls/FWebCtrl_WebManager.cpp b/src/controls/FWebCtrl_WebManager.cpp new file mode 100755 index 0000000..364ede6 --- /dev/null +++ b/src/controls/FWebCtrl_WebManager.cpp @@ -0,0 +1,155 @@ +// +// Open Service Platform +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FWebCtrl_WebManager.cpp + * @brief The file contains the definition of _WebManager class. + * + * The file contains the definition of _WebManager class. + */ + +#include +#include "FWebCtrl_WebImpl.h" +#include "FWebCtrl_WebManager.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; + +namespace Tizen { namespace Web { namespace Controls +{ + +_WebManager::_WebManager(void) + : __pWebList(null) + , __pCallbackList(null) +{ +} + +_WebManager::~_WebManager(void) +{ +} + +_WebManager* +_WebManager::GetInstance(void) +{ + result r = E_SUCCESS; + static _WebManager* pWebMgr = null; + + if (pWebMgr == null) + { + pWebMgr = new (std::nothrow) _WebManager(); + SysTryReturn(NID_WEB_CTRL, pWebMgr != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] _WebManager allocation failed."); + + r = pWebMgr->Construct(); + SysTryCatch(NID_WEB_CTRL, !IsFailed(r), , r, "[%s] _WebManager construction failed.", GetErrorMessage(r)); + } + + return pWebMgr; + +CATCH: + delete pWebMgr; + pWebMgr = null; + + return null; +} + +result +_WebManager::Construct(void) +{ + result r = E_SUCCESS; + + std::unique_ptr > pWebList(new (std::nothrow) ArrayListT< int >()); + SysTryReturnResult(NID_WEB_CTRL, pWebList.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + r = pWebList->Construct(); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + std::unique_ptr > pCallbackList(new (std::nothrow) MultiHashMapT< int, int >()); + SysTryReturnResult(NID_WEB_CTRL, pCallbackList.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory."); + r = pCallbackList->Construct(); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + __pWebList = std::move(pWebList); + __pCallbackList = std::move(pCallbackList); + + return E_SUCCESS; +} + +result +_WebManager::AddWeb(int webAdress) +{ + result r = E_SUCCESS; + + r = __pWebList->Add(webAdress); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +_WebManager::RemoveWeb(int webAdress) +{ + result r = E_SUCCESS; + + r = __pWebList->Remove(webAdress); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + r = __pCallbackList->Remove(webAdress); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +bool +_WebManager::IsValidWeb(int webAdress) const +{ + return __pWebList->Contains(webAdress); +} + + +result +_WebManager::AddCallback(int callerAdress, int callbackAdress) +{ + result r = E_SUCCESS; + + r = __pCallbackList->Add(callerAdress, callbackAdress); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +result +_WebManager::RemoveCallback(int callerAdress, int callbackAdress) +{ + result r = E_SUCCESS; + + r = __pCallbackList->Remove(callerAdress, callbackAdress); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); + + return E_SUCCESS; +} + +bool +_WebManager::IsValidCallback(int callerAdress, int callbackAdress) const +{ + bool ret = true; + + result r = __pCallbackList->Contains(callerAdress, callbackAdress, ret); + SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, true, r, "[%s] Propagating.", GetErrorMessage(r)); + + return ret; +} + +} } } diff --git a/src/controls/FWebCtrl_WebManager.h b/src/controls/FWebCtrl_WebManager.h new file mode 100755 index 0000000..ed0adca --- /dev/null +++ b/src/controls/FWebCtrl_WebManager.h @@ -0,0 +1,64 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FWebCtrl_WebManager.h + * @brief This is the header file for the %_WebManager class. + * + * This header file contains the declarations of the %_WebManager class. + */ + +#ifndef _FWEB_CTRL_INTERNAL_WEB_MANAGER_H_ +#define _FWEB_CTRL_INTERNAL_WEB_MANAGER_H_ + +#include +#include +#include + +namespace Tizen { namespace Web { namespace Controls +{ +class _WebImpl; + +class _WebManager + : public Tizen::Base::Object +{ +public: + static _WebManager* GetInstance(void); + + result AddWeb(int webAdress); + result RemoveWeb(int webAdress); + bool IsValidWeb(int webAdress) const; + + result AddCallback(int callerAdress, int callbackAdress); + result RemoveCallback(int callerAdress, int callbackAdress); + bool IsValidCallback(int callerAdress, int callbackAdress) const; + +private: + _WebManager(void); + _WebManager(const _WebManager& rhs); + virtual ~_WebManager(void); + result Construct(void); + _WebManager& operator=(const _WebManager& rhs); + +private: + std::unique_ptr > __pWebList; + std::unique_ptr > __pCallbackList; +}; + +} } } +#endif + + \ No newline at end of file diff --git a/src/controls/FWebCtrl_WebPresenter.cpp b/src/controls/FWebCtrl_WebPresenter.cpp index 5511084..becae77 100755 --- a/src/controls/FWebCtrl_WebPresenter.cpp +++ b/src/controls/FWebCtrl_WebPresenter.cpp @@ -23,6 +23,7 @@ */ #include #include +#include "FWebCtrl_WebManager.h" #include "FWebCtrl_WebPresenter.h" @@ -30,32 +31,26 @@ namespace Tizen { namespace Web { namespace Controls { -_WebPresenter::_WebPresenter(void) +_WebPresenter::_WebPresenter(const Object* callerAddress) : __stopState(false) , __boolean(false) , __string(L"") , __integer(0) , __pIList(null) , __longInteger(0) + , __callerAddress(reinterpret_cast< int >(callerAddress)) { - //empty statement + _WebManager* pWebManager = _WebManager::GetInstance(); + pWebManager->AddCallback(__callerAddress, reinterpret_cast< int >(this)); } _WebPresenter::~_WebPresenter(void) { -} - - -void -_WebPresenter::InitAsyncProcess(void) -{ __stopState = false; - __boolean = false; - __string = L""; - __integer = 0; - __pIList = null; - __longInteger = 0; + + _WebManager* pWebManager = _WebManager::GetInstance(); + pWebManager->RemoveCallback(__callerAddress, reinterpret_cast< int >(this)); } diff --git a/src/controls/FWebCtrl_WebPresenter.h b/src/controls/FWebCtrl_WebPresenter.h index a5dde55..74eadb6 100755 --- a/src/controls/FWebCtrl_WebPresenter.h +++ b/src/controls/FWebCtrl_WebPresenter.h @@ -35,14 +35,12 @@ class _WebPresenter { // Lifecycle public: - _WebPresenter(void); + _WebPresenter(const Tizen::Base::Object* callerAddress); virtual ~_WebPresenter(void); // Operations public: - void InitAsyncProcess(void); - void WaitAsyncProcess(bool& result); void WaitAsyncProcess(Tizen::Base::String& result); void WaitAsyncProcess(int& result); @@ -70,6 +68,8 @@ private: int __integer; Eina_List* __pIList; long __longInteger; + + int __callerAddress; }; }}} // Tizen::Web::Controls diff --git a/src/controls/FWebCtrl_WebStorageManagerImpl.cpp b/src/controls/FWebCtrl_WebStorageManagerImpl.cpp index ed386a7..ea17405 100755 --- a/src/controls/FWebCtrl_WebStorageManagerImpl.cpp +++ b/src/controls/FWebCtrl_WebStorageManagerImpl.cpp @@ -81,32 +81,32 @@ _WebStorageManagerImpl::GetOriginListN(WebStorageType storageType) Ewk_Context* pDefaultContext = ewk_context_default_get(); - _WebPresenter presenter; - presenter.InitAsyncProcess(); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); + SysTryReturn(NID_WEB_CTRL, pPresenter.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); switch (storageType) { case WEB_STORAGE_TYPE_APPLICATION_CACHE: - ewk_context_application_cache_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_application_cache_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_WEB_SQL_DATABASE: - ewk_context_web_database_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_web_database_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_WEB_STORAGE: - ewk_context_web_storage_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_web_storage_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_FILE_SYSTEM: - ewk_context_local_file_system_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_local_file_system_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; default: break; } - Eina_List* pOriginEinaList = presenter.WaitAsyncProcess(); + Eina_List* pOriginEinaList = pPresenter->WaitAsyncProcess(); if (!pOriginEinaList) { return null; @@ -172,14 +172,14 @@ _WebStorageManagerImpl::GetQuotaForOrigin(WebStorageType storageType, const Stri SysTryReturn(NID_WEB_CTRL, storageType == WEB_STORAGE_TYPE_WEB_SQL_DATABASE, -1, E_UNSUPPORTED_TYPE, "[%s] This storage type is not supported.", GetErrorMessage(E_UNSUPPORTED_TYPE)); Ewk_Security_Origin* pOrigin = CompareOrigin(storageType, origin); - SysTryReturn(NID_WEB_CTRL, pOrigin, -1, E_INVALID_ARG, "[%s] This origin does not exist.", GetErrorMessage(E_INVALID_ARG)); + SysTryReturn(NID_WEB_CTRL, pOrigin, -1.0, E_INVALID_ARG, "[%s] This origin does not exist.", GetErrorMessage(E_INVALID_ARG)); - _WebPresenter presenter; - presenter.InitAsyncProcess(); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); + SysTryReturn(NID_WEB_CTRL, pPresenter.get(), -1.0, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); - ewk_context_web_database_quota_for_origin_get(pDefaultContext, OnUIntReceived, &presenter, pOrigin); + ewk_context_web_database_quota_for_origin_get(pDefaultContext, OnUIntReceived, pPresenter.get(), pOrigin); - presenter.WaitAsyncProcess(quota); + pPresenter->WaitAsyncProcess(quota); return quota; } @@ -196,28 +196,28 @@ _WebStorageManagerImpl::GetUsageForOrigin(WebStorageType storageType, const Stri Ewk_Security_Origin* pOrigin = CompareOrigin(storageType, origin); SysTryReturn(NID_WEB_CTRL, pOrigin, -1, E_INVALID_ARG, "[%s] This origin does not exist.", GetErrorMessage(E_INVALID_ARG)); - _WebPresenter presenter; - presenter.InitAsyncProcess(); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); + SysTryReturn(NID_WEB_CTRL, pPresenter.get(), -1.0, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); switch (storageType) { case WEB_STORAGE_TYPE_APPLICATION_CACHE: -// ewk_context_application_cache_usage_for_origin_get(pDefaultContext, pOrigin, OnIntReceived, &presenter); +// ewk_context_application_cache_usage_for_origin_get(pDefaultContext, pOrigin, OnIntReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_WEB_SQL_DATABASE: - ewk_context_web_database_usage_for_origin_get(pDefaultContext, OnUIntReceived, &presenter, pOrigin); + ewk_context_web_database_usage_for_origin_get(pDefaultContext, OnUIntReceived, pPresenter.get(), pOrigin); break; case WEB_STORAGE_TYPE_WEB_STORAGE : - ewk_context_web_storage_usage_for_origin_get(pDefaultContext, pOrigin, OnUIntReceived, &presenter); + ewk_context_web_storage_usage_for_origin_get(pDefaultContext, pOrigin, OnUIntReceived, pPresenter.get()); break; default: break; } - presenter.WaitAsyncProcess(usage); + pPresenter->WaitAsyncProcess(usage); return usage; } @@ -298,33 +298,33 @@ Ewk_Security_Origin* _WebStorageManagerImpl::CompareOrigin(WebStorageType storageType, const String& origin) { Ewk_Context* pDefaultContext = ewk_context_default_get(); - _WebPresenter presenter; - presenter.InitAsyncProcess(); + std::unique_ptr<_WebPresenter> pPresenter(new (std::nothrow) _WebPresenter(this)); + SysTryReturn(NID_WEB_CTRL, pPresenter.get(), null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); switch (storageType) { case WEB_STORAGE_TYPE_APPLICATION_CACHE: - ewk_context_application_cache_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_application_cache_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_WEB_SQL_DATABASE: - ewk_context_web_database_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_web_database_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_WEB_STORAGE: - ewk_context_web_storage_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_web_storage_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; case WEB_STORAGE_TYPE_FILE_SYSTEM: - ewk_context_local_file_system_origins_get(pDefaultContext, OnOriginReceived, &presenter); + ewk_context_local_file_system_origins_get(pDefaultContext, OnOriginReceived, pPresenter.get()); break; default: break; } - Eina_List* pOriginList = presenter.WaitAsyncProcess(); + Eina_List* pOriginList = pPresenter->WaitAsyncProcess(); if (!pOriginList) { return null; diff --git a/src/controls/inc/FWebCtrl_WebImpl.h b/src/controls/inc/FWebCtrl_WebImpl.h index 930ed7e..316bda2 100755 --- a/src/controls/inc/FWebCtrl_WebImpl.h +++ b/src/controls/inc/FWebCtrl_WebImpl.h @@ -347,7 +347,6 @@ public: void SetKeypadOpened(bool isKeypadOpened); - bool IsPresenterAlived(_WebPresenter* pPresenter) const; Tizen::Graphics::Rectangle GetPreviousKeypadBounds(void) const; void SetPreviousKeypadBounds(Tizen::Graphics::Rectangle& bounds); @@ -506,8 +505,6 @@ private: _TextSearch __textSearch; - Tizen::Base::Collection::ArrayList __callbackList; - Tizen::Base::Collection::ArrayList __webNotificationList; DecisionPolicy __policy; -- 2.7.4 From 50b311aac606bb8896caf6f70cd2c5cb6109f9ff Mon Sep 17 00:00:00 2001 From: hyun lee Date: Tue, 16 Jul 2013 18:05:06 +0900 Subject: [PATCH 09/16] remove SetOwner() for popup Change-Id: Ibbae783012f473f5def4a9acf6897d57e2f5bf1c Signed-off-by: hyun lee --- src/controls/FWebCtrl_CertificateConfirmPopup.cpp | 2 - src/controls/FWebCtrl_InputPickerPopup.cpp | 2 - src/controls/FWebCtrl_Web.cpp | 57 ----------------------- src/controls/FWebCtrl_Web.h | 9 ---- src/controls/FWebCtrl_WebImpl.cpp | 44 ----------------- 5 files changed, 114 deletions(-) diff --git a/src/controls/FWebCtrl_CertificateConfirmPopup.cpp b/src/controls/FWebCtrl_CertificateConfirmPopup.cpp index 8c8a6dd..b76bba3 100755 --- a/src/controls/FWebCtrl_CertificateConfirmPopup.cpp +++ b/src/controls/FWebCtrl_CertificateConfirmPopup.cpp @@ -225,8 +225,6 @@ _CertificateConfirmPopup::OnActionPerformed(const Control& source, int actionId) r = pCertificatePopup->Construct(CERTIFICATE_POPUP_MODE_VIEW, __pCertificatePolicyData); SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - pCertificatePopup->SetOwner(this); - r = pCertificatePopup->ShowPopup(); SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/controls/FWebCtrl_InputPickerPopup.cpp b/src/controls/FWebCtrl_InputPickerPopup.cpp index e6fc7be..c652f10 100755 --- a/src/controls/FWebCtrl_InputPickerPopup.cpp +++ b/src/controls/FWebCtrl_InputPickerPopup.cpp @@ -200,7 +200,6 @@ _InputPickerPopup::Construct(const String& strDate, Ewk_Input_Type inputType, Ti r = AddButton(ID_BUTTON_INPUT_DATE_SELECTION); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - __pPopup->SetOwner(&pImpl->GetPublic()); __pPopup->SetPropagatedKeyEventListener(this); std::unique_ptr pLayout(dynamic_cast< VerticalBoxLayout* >(__pPopup->GetLayoutN())); @@ -249,7 +248,6 @@ _InputPickerPopup::Construct(const Color& color, Tizen::Web::Controls::_WebImpl* pColorPicker->SetColor(color); - __pPopup->SetOwner(&pImpl->GetPublic()); __pPopup->SetPropagatedKeyEventListener(this); r = __pPopup->AddControl(*pColorPicker); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/controls/FWebCtrl_Web.cpp b/src/controls/FWebCtrl_Web.cpp index 44a5586..74782d2 100755 --- a/src/controls/FWebCtrl_Web.cpp +++ b/src/controls/FWebCtrl_Web.cpp @@ -340,7 +340,6 @@ _Web::_Web(void) , __pPinchGestureHandler(null) , __gestureType(WEB_GESTURE_TYPE_TAP) , __edgeType(WEB_EDGE_NONE) - , __focus(false) , __pTextElement(null) , __previousTouchedPosition(0.0f, 0.0f) { @@ -692,62 +691,6 @@ _Web::SetEdgeReachedEvent(_WebEdgeType type) } -void -_Web::SetFocusEnd(bool focus) -{ - __focus = focus; -} - - -bool -_Web::IsFocusEnd(void) -{ - return __focus; -} - - -bool -_Web::OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) -{ - _KeyCode keyCode = keyInfo.GetKeyCode(); - - if (IsFocusEnd() == true) - { - SetFocusEnd(false); - evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); - return false; - } - - switch(keyCode) - { - case _KEY_UP: - case _KEY_DOWN: - evas_object_focus_set(GetWebNativeNode(), EINA_FALSE); - return false; - break; - default: - break; - } - - evas_object_focus_set(GetWebNativeNode(), EINA_TRUE); - - return true; -} - - -bool -_Web::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) -{ - return false; -} - - -void -_Web::OnDrawFocus(void) -{ -} - - bool _Web::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { diff --git a/src/controls/FWebCtrl_Web.h b/src/controls/FWebCtrl_Web.h index bf6fa51..a1878ae 100755 --- a/src/controls/FWebCtrl_Web.h +++ b/src/controls/FWebCtrl_Web.h @@ -115,16 +115,9 @@ public: void SetEdgeReachedEvent(_WebEdgeType type); - void SetFocusEnd(bool focus); - bool IsFocusEnd(void); - virtual result OnAttaching(const _Control* pParent); virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds); - virtual bool OnKeyPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); - virtual bool OnKeyReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_KeyInfo& keyInfo); - virtual void OnDrawFocus(void); - virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchInfo); @@ -200,8 +193,6 @@ private: int __edgeType; - bool __focus; - Tizen::Ui::_AccessibilityElement* __pTextElement; Tizen::Graphics::FloatPoint __previousTouchedPosition; diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 49bd587..13ba096 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -371,8 +371,6 @@ OnScriptConfirmRequested(Evas_Object* pView, const char* pMessage, void* pUserDa int modalResult = 0; - messageBox.SetOwner(&pImpl->GetPublic()); - r = messageBox.ShowAndWait(modalResult); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, EINA_FALSE, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -857,28 +855,6 @@ OnFullScreenExited(void* pUserData, Evas_Object* pView, void* pEventInfo) void -OnFocusDownRequested(void* pUserData, Evas_Object* pView, void* pEventInfo) -{ - _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData); - SysAssertf(pImpl, "Failed to request"); - -// _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); -// pWebCore->SetFocusEnd(true); -} - - -void -OnFocusUpRequested(void* pUserData, Evas_Object* pView, void* pEventInfo) -{ - _WebImpl* pImpl = reinterpret_cast<_WebImpl*>(pUserData); - SysAssertf(pImpl, "Failed to request"); - -// _Web* pWebCore = dynamic_cast< _Web* >(&(pImpl->GetCore())); -// pWebCore->SetFocusEnd(true); -} - - -void OnVibrationRequested(uint64_t duration, void* pUserData) { result r = E_SUCCESS; @@ -1166,8 +1142,6 @@ OnWebDataReceived(void* pUserData, Evas_Object* pView, void* pEventInfo) r = selectBox.Construct(false, L"Select application", 1); //+1 for Downloader SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - selectBox.SetOwner(&pImpl->GetPublic()); - selectBox.AddListItem(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DOWNLOAD"), _SelectBox::LIST_ITEM_TYPE_NORMAL, false); r = selectBox.ShowAndWait(selectedIndex); SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -2553,8 +2527,6 @@ _WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List* __pSelectBox = std::move(pSelectBox); - __pSelectBox->SetOwner(&GetPublic()); - return __pSelectBox->ShowPopup(); } @@ -3661,9 +3633,6 @@ _WebImpl::SetEventListenerCallback(void) const evas_object_smart_callback_add(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered, this); evas_object_smart_callback_add(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited, this); - evas_object_smart_callback_add(pWebNativeNode, "keyevent,down,not,handled", OnFocusDownRequested, this); - evas_object_smart_callback_add(pWebNativeNode, "keyevent,up,not,handled", OnFocusUpRequested, this); - ewk_view_open_panel_callback_set(pWebNativeNode, OnSelectUploadFile, const_cast< _WebImpl* >(this)); Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode); SysAssertf(pContext, "Failed to get webkit instance."); @@ -3748,9 +3717,6 @@ _WebImpl::RemoveEventListenerCallback(void) const evas_object_smart_callback_del(pWebNativeNode, "fullscreen,enterfullscreen", OnFullScreenEntered); evas_object_smart_callback_del(pWebNativeNode, "fullscreen,exitfullscreen", OnFullScreenExited); - evas_object_smart_callback_del(pWebNativeNode, "keyevent,down,not,handled", OnFocusDownRequested); - evas_object_smart_callback_del(pWebNativeNode, "keyevent,up,not,handled", OnFocusUpRequested); - ewk_view_open_panel_callback_set(null, null, null); Ewk_Context* pContext = ewk_view_context_get(pWebNativeNode); SysAssertf(pContext, "Failed to get webkit instance."); @@ -4580,8 +4546,6 @@ _WebImpl::ShowAuthenticationPopup(const String& host, const String& realm, Authe int modalResult = 0; - __pAuthPopup->SetOwner(&GetPublic()); - r = __pAuthPopup->ShowAndWait(modalResult); SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -4610,8 +4574,6 @@ _WebImpl::ShowCertificateConfirmPopup(_CertificatePopupMode userConfirmMode, Ewk int modalResult = 0; - __pCertConfirmPopup->SetOwner(&GetPublic()); - r = __pCertConfirmPopup->ShowAndWait(modalResult); SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -4643,8 +4605,6 @@ _WebImpl::ShowPromptPopup(String msg, String defVal) __pPromptPopup = std::move(pPromptPopup); - __pPromptPopup->SetOwner(&GetPublic()); - r = __pPromptPopup->ShowPopup(); SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r)); @@ -4669,8 +4629,6 @@ _WebImpl::ShowUserConfirmPopup(_UserConfirmMode userConfirmMode, void* pPolicy, r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, true, msg); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - pUserConfirmPopup->SetOwner(&GetPublic()); - int modalResult = 0; switch(userConfirmMode) @@ -4754,8 +4712,6 @@ _WebImpl::ShowUserConfirmPopupAsync(_UserConfirmMode userConfirmMode, void* pPol r = pUserConfirmPopup->Construct(userConfirmMode, pPolicy, false, msg); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - pUserConfirmPopup->SetOwner(&GetPublic()); - switch(userConfirmMode) { case USER_CONFIRM_USERMEDIA: -- 2.7.4 From d9bbaf21fdee118bceb2f2052e5d09ce00373c20 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Tue, 16 Jul 2013 18:50:36 +0900 Subject: [PATCH 10/16] fix lockup issue for certificate popup Change-Id: I2461c151ab1d20ea9c27179063c78bd4aab2ae69 Signed-off-by: Seongjun Yim --- src/controls/FWebCtrl_CertificateConfirmPopup.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controls/FWebCtrl_CertificateConfirmPopup.cpp b/src/controls/FWebCtrl_CertificateConfirmPopup.cpp index b76bba3..e49cb4b 100755 --- a/src/controls/FWebCtrl_CertificateConfirmPopup.cpp +++ b/src/controls/FWebCtrl_CertificateConfirmPopup.cpp @@ -267,7 +267,10 @@ _CertificateConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& key result r = E_SUCCESS; if ((keyEventInfo.GetKeyCode() == KEY_ESC || keyEventInfo.GetKeyCode() == KEY_BACK) && source.GetShowState() == true) { - HandleUserAction(false); + if (__certPopupMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM) + { + HandleUserAction(false); + } r = HidePopup(); if (IsFailed(r)) { -- 2.7.4 From 70860a85e6229edff7e95349f0a3329c73e6d9fb Mon Sep 17 00:00:00 2001 From: hyun lee Date: Tue, 16 Jul 2013 20:02:20 +0900 Subject: [PATCH 11/16] Fix for memoryleak Change-Id: Ie64f385a16d3a4b92c98e7a860123ef8bc960df7 Signed-off-by: hyun lee --- src/controls/FWebCtrl_PromptPopup.cpp | 8 +++++--- src/controls/FWebCtrl_PromptPopup.h | 8 +++++++- src/controls/FWebCtrl_WebImpl.cpp | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/controls/FWebCtrl_PromptPopup.cpp b/src/controls/FWebCtrl_PromptPopup.cpp index 7937488..d59c671 100755 --- a/src/controls/FWebCtrl_PromptPopup.cpp +++ b/src/controls/FWebCtrl_PromptPopup.cpp @@ -61,6 +61,7 @@ static const int EDIT_TEXT_SIZE = 35; _PromptPopup::_PromptPopup(void) : __pEditField(null) , __pWebView(null) + , __pImpl(null) { } @@ -72,13 +73,14 @@ _PromptPopup::~_PromptPopup(void) // Prompt popup result -_PromptPopup::Construct(const String& message, const String& defaultVale, Evas_Object* pView) +_PromptPopup::Construct(const String& message, const String& defaultVale, Evas_Object* pView, _WebImpl* pImpl) { result r = E_SUCCESS; Rectangle rect(0, 0, 0, 0); int popupHeight = 0; + __pImpl = pImpl; __pWebView = pView; _WebPopupData* pPopupData = _WebPopup::GetPopupData(); @@ -197,7 +199,7 @@ _PromptPopup::OnActionPerformed(const Control& source, int actionId) SysAssertf(false, "unknown action ID used"); break; } - GetOwner()->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); + __pImpl->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); } bool @@ -213,7 +215,7 @@ _PromptPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo) { HidePopup(ID_BUTTON_PROMPT_CANCEL); ewk_view_javascript_prompt_reply(__pWebView, null); - GetOwner()->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); + __pImpl->SendUserEvent(ID_PROMPT_POPUP_CLOSE, null); } return true; diff --git a/src/controls/FWebCtrl_PromptPopup.h b/src/controls/FWebCtrl_PromptPopup.h index ce672f9..ec161ee 100755 --- a/src/controls/FWebCtrl_PromptPopup.h +++ b/src/controls/FWebCtrl_PromptPopup.h @@ -34,6 +34,11 @@ class EditField; namespace Tizen { namespace Web { namespace Controls { +class _WebImpl; +}}} // Tizen::Web::Controls + +namespace Tizen { namespace Web { namespace Controls +{ enum _PromptPopupButtonId { @@ -58,7 +63,7 @@ public: */ virtual ~_PromptPopup(void); - result Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultValue, Evas_Object* pView); + result Construct(const Tizen::Base::String& message, const Tizen::Base::String& defaultValue, Evas_Object* pView, _WebImpl* pImpl); const Tizen::Base::String GetPromptText(void); @@ -80,6 +85,7 @@ private: Tizen::Ui::Controls::EditField* __pEditField; Evas_Object* __pWebView; + _WebImpl* __pImpl; }; // _PromptPopup }}} // Tizen::Web::Controls diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 13ba096..49e19bd 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -4600,7 +4600,7 @@ _WebImpl::ShowPromptPopup(String msg, String defVal) std::unique_ptr< _PromptPopup > pPromptPopup(new (std::nothrow) _PromptPopup()); SysTryReturnResult(NID_WEB_CTRL, pPromptPopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed."); - r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode()); + r = pPromptPopup->Construct(msg, defVal, __pWebCore->GetWebNativeNode(), this); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); __pPromptPopup = std::move(pPromptPopup); -- 2.7.4 From 4aa8504e8c7f5d6456674bf494e3eb75414ce8c0 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Thu, 4 Jul 2013 17:11:44 +0800 Subject: [PATCH 12/16] fix gbs/obs build failure Change-Id: I64755de0a73f569d2dc63f60d8b6afc8956e49ac --- packaging/osp-web.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/packaging/osp-web.spec b/packaging/osp-web.spec index cf9b7e7..8ae7b4f 100755 --- a/packaging/osp-web.spec +++ b/packaging/osp-web.spec @@ -1,4 +1,3 @@ -%define debug_package %{nil} %define __strip /bin/true Name: osp-web -- 2.7.4 From 86daf9e9f4a4ec7fffd9b80556243f16ff1239ee Mon Sep 17 00:00:00 2001 From: Jinkun Jang Date: Fri, 16 Aug 2013 11:02:19 +0900 Subject: [PATCH 13/16] add patch --- inc/FWebCtrlWeb.h | 69 +++- packaging/osp-web.spec | 1 + src/FWeb_WebBookmarkImpl.cpp | 3 +- .../FWebCtrlGeolocationPermissionManager.cpp | 1 + src/controls/FWebCtrlWebStorageManager.cpp | 1 + src/controls/FWebCtrl_AppControlListener.cpp | 6 +- src/controls/FWebCtrl_AuthConfirmPopup.cpp | 14 +- src/controls/FWebCtrl_CertificateConfirmPopup.cpp | 79 +++-- src/controls/FWebCtrl_GestureState.cpp | 4 +- src/controls/FWebCtrl_InputPickerPopup.cpp | 6 +- src/controls/FWebCtrl_PromptPopup.cpp | 8 +- src/controls/FWebCtrl_SelectBox.cpp | 104 +++--- src/controls/FWebCtrl_SelectBox.h | 4 +- src/controls/FWebCtrl_UserConfirmPopup.cpp | 50 ++- src/controls/FWebCtrl_Web.cpp | 40 +++ src/controls/FWebCtrl_Web.h | 6 + src/controls/FWebCtrl_WebImpl.cpp | 368 ++++++++++----------- src/controls/FWebCtrl_WebManager.cpp | 67 ++++ src/controls/FWebCtrl_WebManager.h | 11 +- src/controls/FWebCtrl_WebPopup.cpp | 22 +- .../inc/FWebCtrl_CertificateConfirmPopup.h | 8 +- src/controls/inc/FWebCtrl_UserConfirmPopup.h | 5 +- src/controls/inc/FWebCtrl_WebImpl.h | 18 +- src/controls/inc/FWebCtrl_WebPopup.h | 2 + 24 files changed, 594 insertions(+), 303 deletions(-) mode change 100644 => 100755 src/controls/FWebCtrl_WebPopup.cpp diff --git a/inc/FWebCtrlWeb.h b/inc/FWebCtrlWeb.h index fa22d82..e2ff11e 100755 --- a/inc/FWebCtrlWeb.h +++ b/inc/FWebCtrlWeb.h @@ -72,7 +72,7 @@ namespace Tizen { namespace Web { namespace Controls * * The following example demonstrates how to use the %Web class. * @code -// Sample code for WebSample.h +// Sample code using Form for WebSample.h #include #include @@ -93,7 +93,7 @@ public: virtual result OnInitializing(void); }; -// Sample code for WebSample.cpp +// Sample code using Form for WebSample.cpp #include "WebSample.h" using namespace Tizen::Ui; @@ -105,9 +105,13 @@ WebSample::OnInitializing(void) { result r = E_SUCCESS; + // Constucts a Form + ... + __pWeb = new Web(); __pWeb->Construct(GetClientAreaBounds()); AddControl(__pWeb); + LoadUrl(); return r; @@ -123,6 +127,67 @@ WebSample::LoadUrl(void) } * @endcode * + * @code +// Sample code using Window for WebSample.h +#include +#include +#include + +class WebSample : + public Tizen::Ui::Window +{ +public: + WebSample(void) {}; + virtual ~WebSample(void) {}; + +protected: + void LoadUrl(void); + +private: + Tizen::Web::Controls::Web *__pWeb; + +public: + virtual result OnInitializing(void); +}; + +// Sample code using Window for WebSample.cpp +#include "WebSample.h" + +using namespace Tizen::App; +using namespace Tizen::Ui; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Web::Controls; + +result +WebSample::OnInitializing(void) +{ + result r = E_SUCCESS; + + // Constucts a Window + ... + + Frame *pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame(); + SetOwner(pFrame->GetCurrentForm()); + + __pWeb = new Web(); + __pWeb->Construct(GetClientAreaBounds()); + AddControl(__pWeb); + + Show(); + LoadUrl(); + + return r; +} + +// Calls LoadUrl() with the URL of the Web content to display it on the Web control +void +WebSample::LoadUrl(void) +{ + Tizen::Base::String url(L"http://www.tizen.org"); + + __pWeb->LoadUrl(url); +} + * @endcode */ class _OSP_EXPORT_ Web : public Tizen::Ui::Container diff --git a/packaging/osp-web.spec b/packaging/osp-web.spec index 8ae7b4f..cf9b7e7 100755 --- a/packaging/osp-web.spec +++ b/packaging/osp-web.spec @@ -1,3 +1,4 @@ +%define debug_package %{nil} %define __strip /bin/true Name: osp-web diff --git a/src/FWeb_WebBookmarkImpl.cpp b/src/FWeb_WebBookmarkImpl.cpp index caed0aa..f456449 100755 --- a/src/FWeb_WebBookmarkImpl.cpp +++ b/src/FWeb_WebBookmarkImpl.cpp @@ -72,6 +72,7 @@ _WebBookmarkImpl::_WebBookmarkImpl(void) _WebBookmarkImpl::~_WebBookmarkImpl(void) { + __bookmarkList.RemoveAll(true); } @@ -153,7 +154,7 @@ _WebBookmarkImpl::SetFavicon(RecordId bookmarkId, const Bitmap& favicon) Evas_Object* pIcon = null; - Bitmap& temp = const_cast< Bitmap& >(favicon);; + Bitmap& temp = const_cast< Bitmap& >(favicon); Evas* pEvas = _Utility::GetEvasFromUiApp(pFrame); SysTryCatch(NID_WEB, pEvas, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r)); diff --git a/src/controls/FWebCtrlGeolocationPermissionManager.cpp b/src/controls/FWebCtrlGeolocationPermissionManager.cpp index d30dc34..d85ced9 100755 --- a/src/controls/FWebCtrlGeolocationPermissionManager.cpp +++ b/src/controls/FWebCtrlGeolocationPermissionManager.cpp @@ -21,6 +21,7 @@ * * The file contains the definition of GeolocationPermissionManager class. */ +#include #include #include #include diff --git a/src/controls/FWebCtrlWebStorageManager.cpp b/src/controls/FWebCtrlWebStorageManager.cpp index c0d43af..518f66e 100755 --- a/src/controls/FWebCtrlWebStorageManager.cpp +++ b/src/controls/FWebCtrlWebStorageManager.cpp @@ -21,6 +21,7 @@ * * The file contains the definition of FWebCtrlWebStorageManager class. */ +#include #include #include #include diff --git a/src/controls/FWebCtrl_AppControlListener.cpp b/src/controls/FWebCtrl_AppControlListener.cpp index 995f0ca..5b2929e 100755 --- a/src/controls/FWebCtrl_AppControlListener.cpp +++ b/src/controls/FWebCtrl_AppControlListener.cpp @@ -122,12 +122,12 @@ _MediaSelectionListener::~_MediaSelectionListener(void) void _MediaSelectionListener::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& providerId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pAppData) { - SysTryReturnVoidResult(NID_WEB_CTRL, pAppData, E_INVALID_ARG, "[E_INVALID_ARG] Invalid arguments to _MediaSelectionListener::OnAppControlCompleted"); - Eina_List* pSelectedFileNames = null; + ArrayList* pSelectedFiles = null; int fileCount = 0; - ArrayList *pSelectedFiles = dynamic_cast< ArrayList* >(const_cast< Object* >(pAppData->GetValue(String("http://tizen.org/appcontrol/data/selected")))); + SysTryCatch(NID_WEB_CTRL, pAppData, , E_INVALID_ARG, "[E_INVALID_ARG] Invalid arguments to _MediaSelectionListener::OnAppControlCompleted"); + pSelectedFiles = dynamic_cast< ArrayList* >(const_cast< Object* >(pAppData->GetValue(String("http://tizen.org/appcontrol/data/selected")))); SysTryCatch(NID_WEB_CTRL, pSelectedFiles, , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); fileCount = pSelectedFiles->GetCount(); diff --git a/src/controls/FWebCtrl_AuthConfirmPopup.cpp b/src/controls/FWebCtrl_AuthConfirmPopup.cpp index 271c78b..de447c4 100755 --- a/src/controls/FWebCtrl_AuthConfirmPopup.cpp +++ b/src/controls/FWebCtrl_AuthConfirmPopup.cpp @@ -93,7 +93,7 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica r = _WebPopup::Construct(true, Dimension(rect.width, rect.height)); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - SetTitleText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_DESTINATIONS_AUTHENTICATION_REQUIRED")); + SetTitleText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_ENTER_CREDENTIALS_ABB")); //host realm label rect.height = 2*pPopupData->labelDim.height; @@ -127,7 +127,7 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica r = pIdEditField->Construct(rect, EDIT_FIELD_STYLE_NORMAL); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - pIdEditField->SetGuideText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_AUTHUSERNAME")); + pIdEditField->SetGuideText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_WIFI_BODY_ENTER_YOUR_ID")); pIdEditField->SetGuideTextColor(Color::GetColor(COLOR_ID_GREY)); pIdEditField->SetTextSize(EDIT_TEXT_SIZE);; @@ -142,7 +142,7 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica r = pPwdEditField->Construct(rect, EDIT_FIELD_STYLE_PASSWORD); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - pPwdEditField->SetGuideText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_AUTHPASSWORD")); + pPwdEditField->SetGuideText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ENTER_YOUR_PASSWORD_ABB")); pPwdEditField->SetGuideTextColor(Color::GetColor(COLOR_ID_GREY)); pPwdEditField->SetTextSize(EDIT_TEXT_SIZE);; @@ -165,8 +165,8 @@ _AuthConfirmPopup::Construct(const String& host, const String& realm, Authentica ArrayList titleList; r = titleList.Construct(); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); - titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_COM_SK_CANCEL")))); - titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_COM_BUTTON_LOGIN")))); + titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB")))); + titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB")))); r = CreateAndAddButtons(idList, titleList, pButtonPanel); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -214,7 +214,7 @@ _AuthConfirmPopup::OnActionPerformed(const Control& source, int actionId) bool _AuthConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo) { - return true; + return false; } bool @@ -231,7 +231,7 @@ _AuthConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventIn } } - return true; + return false; } bool diff --git a/src/controls/FWebCtrl_CertificateConfirmPopup.cpp b/src/controls/FWebCtrl_CertificateConfirmPopup.cpp index e49cb4b..52d9ba9 100755 --- a/src/controls/FWebCtrl_CertificateConfirmPopup.cpp +++ b/src/controls/FWebCtrl_CertificateConfirmPopup.cpp @@ -66,6 +66,8 @@ _CertificateConfirmPopup::_CertificateConfirmPopup(void) : __certPopupMode(CERTIFICATE_POPUP_MODE_USER_CONFIRM) , __confirm(false) , __pCertificatePolicyData(null) + , __pParent(null) + , __pCertificatePopup(null) { } @@ -80,7 +82,7 @@ _CertificateConfirmPopup::~_CertificateConfirmPopup(void) result -_CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Certificate_Policy_Decision* pPolicy) +_CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Certificate_Policy_Decision* pPolicy, Tizen::Web::Controls::_CertificateConfirmPopup* pParent) { SysTryReturnResult(NID_WEB_CTRL, pPolicy, E_INVALID_ARG, "Certificate Policy pointer is null."); result r = E_SUCCESS; @@ -97,6 +99,8 @@ _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Cer int popupMaxHeight = 0; Rectangle rect(0, 0, 0, 0); + __pParent = pParent; + ArrayList idList; r = idList.Construct(); SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); @@ -107,18 +111,18 @@ _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Cer if( __certPopupMode == CERTIFICATE_POPUP_MODE_VIEW ) { - titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_CERTIFICATES"); + titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_CERTIFICATE_ABB"); popupMaxHeight = 4*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin; rect.height = 4*pPopupData->labelDim.height; rect.width = pPopupData->labelDim.width; idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_CLOSE))); - titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_COM_BODY_DONE")))); + titleList.Add(*(new String(pSysResource->GetString("sys_string", "IDS_TPLATFORM_BUTTON_OK")))); } else // CERTIFICATE_POPUP_MODE_CONFIRM { - titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_SECURITY_WARNING"); + titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_WARNING_ABB"); popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin; rect.height = 2*pPopupData->labelDim.height; @@ -128,9 +132,9 @@ _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Cer idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_VIEW))); idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_ALLOW))); - titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_OPT_CANCEL")))); - titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_OPT_VIEW")))); - titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_OPT_ALLOW")))); + titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB")))); + titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON2_VIEW_CERTIFICATE")))); + titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB")))); } r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupMaxHeight)); @@ -174,7 +178,7 @@ _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Cer SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed."); String message = L""; - message = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_SECURITY_CERTIFICATE_PROBLEM_MSG"); + message = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_THERE_ARE_PROBLEMS_WITH_THE_SECURITY_CERTIFICATE_FOR_THIS_SITE_C"); message.Append(L"\n"); message.Append(ewk_certificate_policy_decision_url_get(__pCertificatePolicyData)); @@ -222,13 +226,14 @@ _CertificateConfirmPopup::OnActionPerformed(const Control& source, int actionId) std::unique_ptr<_CertificateConfirmPopup> pCertificatePopup(new (std::nothrow) _CertificateConfirmPopup()); SysTryReturnVoidResult(NID_WEB_CTRL, pCertificatePopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed."); - r = pCertificatePopup->Construct(CERTIFICATE_POPUP_MODE_VIEW, __pCertificatePolicyData); + r = pCertificatePopup->Construct(CERTIFICATE_POPUP_MODE_VIEW, __pCertificatePolicyData, this); SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); - r = pCertificatePopup->ShowPopup(); - SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + __pCertificatePopup = std::move(pCertificatePopup); - pCertificatePopup.release(); + r = __pCertificatePopup->ShowPopup(); + SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r)); + __pCertificatePopup.release(); return; } @@ -249,16 +254,32 @@ _CertificateConfirmPopup::OnActionPerformed(const Control& source, int actionId) { SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r)); } - if (__certPopupMode == CERTIFICATE_POPUP_MODE_VIEW ) + if (__certPopupMode == CERTIFICATE_POPUP_MODE_VIEW) { - GetOwner()->SendUserEvent(ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, null); + __pParent->SendUserEvent(ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, null); } } + +void +_CertificateConfirmPopup::OnUserEventReceivedN(RequestId requestId, IList* pArgs) +{ + switch (requestId) + { + case ID_CERTIFICATE_CONFIRM_POPUP_CLOSE: + __pCertificatePopup.reset(); + break; + default: + break; + } + +} + + bool _CertificateConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo) { - return true; + return false; } bool @@ -276,13 +297,13 @@ _CertificateConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& key { SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r)); } - if (__certPopupMode == CERTIFICATE_POPUP_MODE_VIEW ) + if (__certPopupMode == CERTIFICATE_POPUP_MODE_VIEW) { - GetOwner()->SendUserEvent(ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, null); + __pParent->SendUserEvent(ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, null); } } - return true; + return false; } bool @@ -364,45 +385,45 @@ _CertificateConfirmPopup::GenerateCertifiate(String& certString) SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r)); //Issued to - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_ISSUED_TO_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ISSUED_TO_C")); certString.Append(L"\n\n"); String subject = certificate.GetSubject(); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_COMMON_NAME_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_COMMON_NAME_C")); certString.Append(L"\n"); certString.Append(GetStringOfToken(subject, L"/CN=") + L"\n"); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_ORGANIZATION_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ORGANISATION_C")); certString.Append(L"\n"); certString.Append(GetStringOfToken(subject, L"/O=") + L"\n"); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP ,"IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP ,"IDS_TPLATFORM_BODY_ORGANISATIONAL_UNIT_C")); certString.Append(L"\n"); certString.Append(GetStringOfToken(subject, L"/OU=") + L"\n"); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_CERTIFICATE_SERIAL_NUMBER")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_SERIAL_NUMBER_C")); certString.Append(L":\n"); certString.Append(certificate.GetSerialNumber() + L"\n\n\n"); //Issued by - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_ISSUED_BY_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ISSUED_BY_C")); certString.Append(L"\n\n"); String issuer = certificate.GetIssuer(); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_COMMON_NAME_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_COMMON_NAME_C")); certString.Append(L"\n"); certString.Append(GetStringOfToken(issuer, L"/CN=") + L"\n"); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_ORGANIZATION_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ORGANISATION_C")); certString.Append(L"\n"); certString.Append(GetStringOfToken(issuer, L"/O=") + L"\n"); - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_ORGANIZATIONAL_UNIT_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ORGANISATIONAL_UNIT_C")); certString.Append(L"\n"); certString.Append(GetStringOfToken(issuer, L"/OU=") + L"\n\n"); //Validity - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_HEADER_VALIDITY_C")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_VALIDITY_C")); certString.Append(L"\n\n"); certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_POP_CERTI_VALID_FROM_C")); certString.Append(L"\n"); @@ -413,7 +434,7 @@ _CertificateConfirmPopup::GenerateCertifiate(String& certString) certString.Append(certificate.GetNotAfter() + L"\n\n\n"); //FingerPrints - certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_ROOTCERTIFICATES_FINGER_PRINT")); + certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_FINGERPRINTS_C")); certString.Append(L":\n\n"); certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_SIGNATURE_ALGORITHM_VODA")); certString.Append(L":\n"); diff --git a/src/controls/FWebCtrl_GestureState.cpp b/src/controls/FWebCtrl_GestureState.cpp index c17df52..93419bd 100755 --- a/src/controls/FWebCtrl_GestureState.cpp +++ b/src/controls/FWebCtrl_GestureState.cpp @@ -100,12 +100,12 @@ _TapGestureState::OnLongPressGestureDetected(_TouchLongPressGestureDetector& ges pPoint->id = 0; pPoint->x = absPoint.x; pPoint->y = absPoint.y; - pPoint->state = EVAS_TOUCH_POINT_UP; + pPoint->state = EVAS_TOUCH_POINT_CANCEL; Eina_List* pPointList = null; pPointList = eina_list_append(pPointList, pPoint); - ewk_view_feed_touch_event(__pWebCore->GetWebNativeNode(), EWK_TOUCH_END, pPointList, null); + ewk_view_feed_touch_event(__pWebCore->GetWebNativeNode(), EWK_TOUCH_CANCEL, pPointList, null); void* pData = null; EINA_LIST_FREE(pPointList, pData) diff --git a/src/controls/FWebCtrl_InputPickerPopup.cpp b/src/controls/FWebCtrl_InputPickerPopup.cpp index c652f10..0826358 100755 --- a/src/controls/FWebCtrl_InputPickerPopup.cpp +++ b/src/controls/FWebCtrl_InputPickerPopup.cpp @@ -323,7 +323,7 @@ _InputPickerPopup::AddButton(_InputPickerButtonId buttonId) _SystemResource* pSysResource = _SystemResource::GetInstance(); SysAssertf(pSysResource != null, "Failed to get _SystemResource instance"); - buttonStr = pSysResource->GetString("sys_string", "IDS_COM_SK_OK"); + buttonStr = pSysResource->GetString("sys_string", "IDS_TPLATFORM_BUTTON_OK"); std::unique_ptr