apply save password confirm popup
authorSeongjun Yim <se201.yim@samsung.com>
Tue, 17 Sep 2013 11:23:29 +0000 (20:23 +0900)
committerSeongjun Yim <se201.yim@samsung.com>
Tue, 17 Sep 2013 11:28:33 +0000 (20:28 +0900)
Change-Id: I90df9f8b11b4d8c287a1f0ac624c16c05a1dfdec
Signed-off-by: Seongjun Yim <se201.yim@samsung.com>
src/controls/FWebCtrl_UserConfirmPopup.cpp
src/controls/FWebCtrl_WebImpl.cpp
src/controls/inc/FWebCtrl_UserConfirmPopup.h
src/controls/inc/FWebCtrl_WebImpl.h

index ef242a3..ee89051 100755 (executable)
@@ -349,6 +349,11 @@ _UserConfirmPopup::OnActionPerformed(const Control& source, int actionId)
                        __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
                        break;
                }
+               case USER_CONFIRM_SAVE_PASSWORD:
+               {
+                       __pImpl->SendUserEvent(ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE, null);
+                       break;
+               }
                default:
                        SysAssert(false);
                }
@@ -469,6 +474,19 @@ CATCH:
                ewk_view_javascript_confirm_reply(pView, allow);
                break;
        }
+       case USER_CONFIRM_SAVE_PASSWORD:
+       {
+               Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
+               if (allow)
+               {
+                       ewk_view_password_confirm_popup_reply(pView, EWK_PASSWORD_POPUP_OK);
+               }
+               else
+               {
+                       ewk_view_password_confirm_popup_reply(pView, EWK_PASSWORD_POPUP_CANCEL);
+               }
+               break;
+       }
        case USER_CONFIRM_APP_CACHE:
        {
                Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
@@ -642,6 +660,11 @@ _UserConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventIn
                        __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
                        break;
                }
+               case USER_CONFIRM_SAVE_PASSWORD:
+               {
+                       __pImpl->SendUserEvent(ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE, null);
+                       break;
+               }
                case USER_PROTOCOL_HANDLER:
                case USER_CONTENT_HANDLER:
                case USER_CONFIRM_APP_CACHE:
index f3492e8..7180a49 100755 (executable)
@@ -375,7 +375,28 @@ OnScriptPromptRequested(Evas_Object* pView, const char* pMessage, const char* pD
 CATCH:
        ewk_view_javascript_prompt_reply(pView, null);
 
-       return EINA_FALSE;
+       return EINA_TRUE;
+}
+
+
+Eina_Bool
+OnSavePasswordConfirmRequested(Evas_Object* pWebview, const char* pMessage, void* pUserData)
+{
+       SysLog(NID_WEB_CTRL, "The current value of message is %s", pMessage);
+
+       result r = E_SUCCESS;
+       _WebImpl* pImpl = reinterpret_cast< _WebImpl* >(pUserData);
+
+       String msg(pMessage);
+
+       r = pImpl->ShowUserConfirmPopupAsync(USER_CONFIRM_SAVE_PASSWORD, pWebview, msg);
+       SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+       return EINA_TRUE;
+
+CATCH:
+       ewk_view_password_confirm_popup_reply(pWebview, EWK_PASSWORD_POPUP_CANCEL);
+
+       return EINA_TRUE;
 }
 
 
@@ -2197,6 +2218,7 @@ _WebImpl::_WebImpl(Web* pWeb, Tizen::Ui::_Control* pCore)
        , __pDbQuotaConfirmPopup(null)
        , __pLocalFsQuotaConfirmPopup(null)
        , __pIndexedDbQuotaConfirmPopup(null)
+       , __pSavePasswordConfirmPopup(null)
        , __pPromptPopup(null)
        , __pCertConfirmPopup(null)
        , __pSelectBox(null)
@@ -3634,6 +3656,8 @@ _WebImpl::SetEventListenerCallback(void) const
                ewk_view_exceeded_database_quota_callback_set(pWebNativeNode, OnDatabaseQuotaExceeded, const_cast< _WebImpl* >(this));
                ewk_view_exceeded_local_file_system_quota_callback_set(pWebNativeNode, OnLocalFileSystemQuotaExceeded, const_cast< _WebImpl* >(this));
 
+               ewk_view_password_confirm_popup_callback_set(pWebNativeNode, OnSavePasswordConfirmRequested, const_cast< _WebImpl* >(this));
+
                evas_object_event_callback_add(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained, this);
                evas_object_event_callback_add(pWebNativeNode, EVAS_CALLBACK_FOCUS_OUT, OnWebNativeNodeFocusLost, this);
        }
@@ -3722,6 +3746,8 @@ _WebImpl::RemoveEventListenerCallback(void) const
                ewk_view_exceeded_database_quota_callback_set(pWebNativeNode, null, null);
                ewk_view_exceeded_local_file_system_quota_callback_set(pWebNativeNode, null, null);
 
+               ewk_view_password_confirm_popup_callback_set(pWebNativeNode, null, null);
+
                evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_IN, OnWebNativeNodeFocusGained);
                evas_object_event_callback_del(pWebNativeNode, EVAS_CALLBACK_FOCUS_OUT, OnWebNativeNodeFocusLost);
        }
@@ -5044,6 +5070,9 @@ _WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::ILi
        case ID_USER_SCRIPT_CONFIRM_CLOSE:
                __pScriptConfirmPopup.reset();
                break;
+       case ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE:
+               __pSavePasswordConfirmPopup.reset();
+               break;
        default:
                break;
        }
index d6065e2..d8faef8 100755 (executable)
@@ -41,7 +41,7 @@ enum _UserConfirmPopupButtonId
 {
        ID_BUTTON_USER_ALLOW,
        ID_BUTTON_USER_CANCEL,
-       ID_BUTTON_USER_CERT_VIEW
+       ID_BUTTON_USER_NEVER
 };
 
 enum _UserConfirmMode
@@ -53,6 +53,7 @@ enum _UserConfirmMode
        USER_CONFIRM_NOTIFICATION,
        USER_SCRIPT_ALERT,
        USER_SCRIPT_CONFIRM,
+       USER_CONFIRM_SAVE_PASSWORD,
        USER_CONFIRM_APP_CACHE,
        USER_CONFIRM_DB_QUOTA_EXCEDED,
        USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED,
index 828cd19..7b5f131 100755 (executable)
@@ -137,7 +137,8 @@ enum _WebPopupCloseId
        ID_USER_CONFIRM_GEOLOCATION_CLOSE,
        ID_USER_CONFIRM_NOTIFICATION_CLOSE,
        ID_USER_SCRIPT_ALERT_CLOSE,
-       ID_USER_SCRIPT_CONFIRM_CLOSE
+       ID_USER_SCRIPT_CONFIRM_CLOSE,
+       ID_USER_CONFIRM_SAVE_PASSWORD_CLOSE
 };
 
 class _OSP_EXPORT_ _WebImpl
@@ -495,6 +496,7 @@ private:
        std::unique_ptr<_UserConfirmPopup> __pDbQuotaConfirmPopup;
        std::unique_ptr<_UserConfirmPopup> __pLocalFsQuotaConfirmPopup;
        std::unique_ptr<_UserConfirmPopup> __pIndexedDbQuotaConfirmPopup;
+       std::unique_ptr<_UserConfirmPopup> __pSavePasswordConfirmPopup;
        
        std::unique_ptr< _PromptPopup > __pPromptPopup;
        std::unique_ptr<_CertificateConfirmPopup>  __pCertConfirmPopup;