Tizen 2.2.1
[framework/osp/web.git] / src / controls / FWebCtrl_WebImpl.cpp
index 13673d9..4e0d109 100755 (executable)
@@ -2603,10 +2603,14 @@ _WebImpl::ShowSelectBoxPopup(bool isMultiSelect, const String& title, Eina_List*
        std::unique_ptr<_SelectBox> pSelectBox(new (std::nothrow) _SelectBox());
        SysTryReturnResult(NID_WEB_CTRL, pSelectBox.get(), E_OUT_OF_MEMORY, "Memory allocation failed.");
 
-       int itemCount = eina_list_count(pItems);
-       int defaultCount = (itemCount < DEFAULT_LIST_ITEM_COUNT) ? itemCount : (isMultiSelect ? (DEFAULT_LIST_ITEM_COUNT - 1) : DEFAULT_LIST_ITEM_COUNT);
-       r = pSelectBox->Construct(this, isMultiSelect, title, defaultCount, pWebView);
-
+       if (isMultiSelect)
+       {
+               r = pSelectBox->Construct(this, isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT - 1, pWebView);
+       }
+       else
+       {
+               r = pSelectBox->Construct(this, isMultiSelect, title, DEFAULT_LIST_ITEM_COUNT, pWebView);
+       }
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
        r = pSelectBox->UpdateList(pItems, selectedIndex, false, false);
@@ -4761,6 +4765,8 @@ _WebImpl::HttpAuthenticationRequested(Ewk_Auth_Challenge* pChallenge)
        String host(ewk_auth_challenge_url_get(pChallenge));
        String realm(ewk_auth_challenge_realm_get(pChallenge));
 
+       __pAuthChallenge.reset();
+
        std::unique_ptr<AuthenticationChallenge> pAuthChallenge(new (std::nothrow) AuthenticationChallenge());
        SysTryReturnResult(NID_WEB_CTRL, pAuthChallenge, E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
@@ -4795,9 +4801,10 @@ _WebImpl::ShowAuthenticationPopup(const String& host, const String& realm, Authe
        std::unique_ptr<_AuthConfirmPopup> pAuthPopup(new (std::nothrow) _AuthConfirmPopup());
        SysTryReturnResult(NID_WEB_CTRL, pAuthPopup, E_OUT_OF_MEMORY, "Memory Allocation failed.");
 
-       r = pAuthPopup->Construct(host, realm, this);
+       r = pAuthPopup->Construct(host, realm, pAuthChallenge);
        SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
 
+       __pAuthPopup.reset();
        __pAuthPopup = std::move(pAuthPopup);
 
        r = __pAuthPopup->ShowPopup();
@@ -5295,22 +5302,6 @@ _WebImpl::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::ILi
        
        switch (requestId)
        {
-       case ID_AUTHENTICATION_CONFIRM_POPUP_CANCEL:
-               __pAuthPopup->RemoveAllControls();
-               __pAuthPopup.reset();
-               __pAuthChallenge->Cancel();
-               __pAuthChallenge.reset();
-               break;
-       case ID_AUTHENTICATION_CONFIRM_POPUP_PROCESS:
-               __pAuthPopup->RemoveAllControls();
-               __pAuthPopup.reset();
-               if (pArgs)
-               {
-                       std::unique_ptr<ArrayList, AllElementsDeleter> pAuthValue(reinterpret_cast< ArrayList* >(pArgs));
-                       __pAuthChallenge->Process(*reinterpret_cast< String* >(pAuthValue->GetAt(0)),*reinterpret_cast< String* >(pAuthValue->GetAt(1)));
-               }
-               __pAuthChallenge.reset();
-               break;
        case ID_CERTIFICATE_CONFIRM_POPUP_CLOSE:
                __pCertConfirmPopup.reset();
                break;