#include <FUiKeyEventInfo.h>
#include <FUiLayout.h>
#include <FUiVerticalBoxLayout.h>
+#include <FWebCtrlAuthenticationChallenge.h>
#include <FSys_SystemResource.h>
#include <FSys_VibratorImpl.h>
#include <FUi_ControlManager.h>
_AuthConfirmPopup::_AuthConfirmPopup(void)
: __pIdEditField(null)
, __pPwdEditField(null)
- , __pImpl(null)
+ , __pAuthHandler(null)
{
}
_AuthConfirmPopup::~_AuthConfirmPopup(void)
{
+ if (IsModalPopup())
+ {
+ __pAuthHandler->Cancel();
+ }
}
// Authentication popup
result
-_AuthConfirmPopup::Construct(const String& host, const String& realm, _WebImpl* pImpl)
+_AuthConfirmPopup::Construct(const String& host, const String& realm, AuthenticationChallenge* pAuth)
{
- __pImpl = pImpl;
- SysAssertf(__pImpl != null, "Failed to get _WebImpl");
+ SysTryReturnResult(NID_WEB_CTRL, pAuth != null, E_INVALID_ARG, "invalid argument(s) is used. The AuthenticationChallenge is null.");
+
+ __pAuthHandler = pAuth;
_SystemResource* pSysResource = _SystemResource::GetInstance();
SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pPwdEditField = pPwdEditField.release();
-
__pIdEditField->SetFocus();
Panel* pButtonPanel = CreateAndAddPanel();
SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
//Add Buttons
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ idList.Add(*(new Integer(ID_BUTTON_AUTH_CANCEL)));
+ idList.Add(*(new Integer(ID_BUTTON_AUTH_PROCESS)));
- idList.Add(new Integer(ID_BUTTON_AUTH_CANCEL));
- idList.Add(new Integer(ID_BUTTON_AUTH_PROCESS));
-
-
- ArrayList titleList(SingleObjectDeleter);
+ 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_TPLATFORM_BUTTON_CANCEL_ABB")));
- titleList.Add(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB")));
+ 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));
r = HidePopup();
SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- ArrayList* pAuthValueList = null;
-
switch (actionId)
{
case ID_BUTTON_AUTH_PROCESS:
-
- pAuthValueList = new (std::nothrow) ArrayList();
- pAuthValueList->Construct();
- pAuthValueList->Add(new String(__pIdEditField->GetText()));
- pAuthValueList->Add(new String(__pPwdEditField->GetText()));
- __pImpl->SendUserEvent(ID_AUTHENTICATION_CONFIRM_POPUP_PROCESS, pAuthValueList);
+ __pAuthHandler->Process(__pIdEditField->GetText(), __pPwdEditField->GetText());
break;
case ID_BUTTON_AUTH_CANCEL:
- __pImpl->SendUserEvent(ID_AUTHENTICATION_CONFIRM_POPUP_CANCEL, null);
+ __pAuthHandler->Cancel();
break;
default:
result r = E_SUCCESS;
if ((keyEventInfo.GetKeyCode() == KEY_ESC || keyEventInfo.GetKeyCode() == KEY_BACK) && source.GetShowState() == true)
{
+ __pAuthHandler->Cancel();
r = HidePopup();
if (IsFailed(r))
{
SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
}
-
- __pImpl->SendUserEvent(ID_AUTHENTICATION_CONFIRM_POPUP_CANCEL, null);
}
return false;
namespace Tizen { namespace Web { namespace Controls
{
-class _WebImpl;
+class AuthenticationChallenge;
enum _AuthPopupButtonId
*/
virtual ~_AuthConfirmPopup(void);
- result Construct(const Tizen::Base::String& host, const Tizen::Base::String& realm, _WebImpl* pImpl);
+ result Construct(const Tizen::Base::String& host, const Tizen::Base::String& realm, AuthenticationChallenge* pAuth);
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
private:
Tizen::Ui::Controls::EditField* __pIdEditField;
Tizen::Ui::Controls::EditField* __pPwdEditField;
- _WebImpl* __pImpl;
-
+ AuthenticationChallenge* __pAuthHandler;
}; // _AuthConfirmPopup
}}} // Tizen::Web::Controls
__pParent = pParent;
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- ArrayList titleList(SingleObjectDeleter);
+ ArrayList titleList;
r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pButtonPanel = CreateAndAddPanel();
SysTryReturn(NID_WEB_CTRL, __pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- ArrayList titleList(SingleObjectDeleter);
+ ArrayList titleList;
r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
__pButtonPanel = CreateAndAddPanel();
SysTryReturn(NID_WEB_CTRL, __pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- ArrayList titleList(SingleObjectDeleter);
+ ArrayList titleList;
r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
_SystemResource* pSysResource = _SystemResource::GetInstance();
SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
idList.Add(*(new Integer(ID_BUTTON_PROMPT_CANCEL)));
idList.Add(*(new Integer(ID_BUTTON_PROMPT_OK)));
- ArrayList titleList(SingleObjectDeleter);
+ 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_TPLATFORM_BUTTON_CANCEL_ABB"))));
, __multiSelection(false)
, __SelectedIndex(-1)
, __prevIndex(-1)
- , __panelHeight(0)
, __orientation(_CONTROL_ORIENTATION_PORTRAIT)
, __pWebView(null)
, __pToggledArray(null)
Panel* pButtonPanel = CreateAndAddPanel();
SysTryReturn(NID_WEB_CTRL, pButtonPanel, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
- __panelHeight = pButtonPanel->GetHeight();
-
_SystemResource* pSysResource = _SystemResource::GetInstance();
SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
idList.Add(*(new Integer(ID_BUTTON_SELECTION)));
- ArrayList titleList(SingleObjectDeleter);
+ ArrayList titleList;
r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
r = CreateAndAddButtons(idList, titleList, pButtonPanel);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
-
- SetSize(GetSize().width,GetSize().height + __panelHeight);
}
SetPropagatedKeyEventListener(this);
}
}
- int listItemHeight = 0;
- GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, __orientation, listItemHeight);
- int prevCount = (__pListView->GetSize()).height / listItemHeight;
- int defaultCount = __multiSelection ? DEFAULT_LIST_ITEM_COUNT -1 : DEFAULT_LIST_ITEM_COUNT;
-
- if ((prevCount != itemCount)
- && ((prevCount < defaultCount && itemCount < defaultCount)
- || (prevCount < defaultCount && itemCount >= defaultCount)
- || (prevCount >= defaultCount && itemCount < defaultCount)))
- {
- int listViewNewHeight = ((itemCount < defaultCount) ? itemCount : defaultCount) * listItemHeight;
- int popupHeight = __multiSelection ? (listViewNewHeight + __panelHeight) : listViewNewHeight;
-
- __pListView->SetSize((__pListView->GetSize()).width, listViewNewHeight);
- SetSize(GetSize().width, popupHeight);
- }
-
__pListView->UpdateList();
return E_SUCCESS;
static const int LIST_ITEM_TYPE_GROUP = 2;
static const int LIST_ITEM_TYPE_NORMAL = 1;
static const int LIST_ITEM_TYPE_SUB = 0;
- static const int DEFAULT_LIST_ITEM_COUNT = 5;
private:
Tizen::Base::Collection::ArrayList __listElementArray;
bool __multiSelection;
int __SelectedIndex;
int __prevIndex;
- int __panelHeight;
Tizen::Ui::_ControlOrientation __orientation;
Evas_Object* __pWebView;
Eina_Inarray* __pToggledArray;
Panel* pButtonPanel = CreateAndAddPanel();
SysTryReturn(NID_WEB_CTRL, pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- ArrayList idList(SingleObjectDeleter);
+ ArrayList idList;
r = idList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
- ArrayList titleList(SingleObjectDeleter);
+ ArrayList titleList;
r = titleList.Construct();
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
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);
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.");
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();
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;
#include <FBaseSysLog.h>\r
#include <FIoDbEnumerator.h>\r
#include <FUiControl.h>\r
-#include <FIo_DirectoryImpl.h>\r
-#include <FIo_DatabaseImpl.h>\r
+#include <FIo_DirectoryImpl.h>
+#include <FIo_DatabaseImpl.h>
#include <FIo_FileImpl.h>\r
#include <FUiCtrl_FormImpl.h>\r
-#include <FIo_DirectoryImpl.h>\r
-#include <FIo_DatabaseImpl.h>\r
-#include <FIo_FileImpl.h>\r
+#include <FIo_DirectoryImpl.h>
+#include <FIo_DatabaseImpl.h>
+#include <FIo_FileImpl.h>
#include "FWebCtrl_EflWebkit.h"\r
#include "FWebCtrl_Web.h"\r
#include "FWebCtrl_WebImpl.h"\r
_WebManager* _WebManager::__pInstance = null;\r
\r
\r
-extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[] = L"data/.webkit/customDatabase/";\r
-extern const wchar_t USER_CONFIRM_DB_NAME[] = L"userConfirm.db";\r
-extern const wchar_t GEOLOCATION_TABLE_NAME[] = L"geolocationPermission";\r
-extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[] = L"customProtocol";\r
-extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[] = L"customContent";\r
-extern const wchar_t CERTIFICATE_TABLE_NAME[] = L"certificate";\r
-\r
-\r
+extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[] = L"data/.webkit/customDatabase/";
+extern const wchar_t USER_CONFIRM_DB_NAME[] = L"userConfirm.db";
+extern const wchar_t GEOLOCATION_TABLE_NAME[] = L"geolocationPermission";
+extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[] = L"customProtocol";
+extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[] = L"customContent";
+extern const wchar_t CERTIFICATE_TABLE_NAME[] = L"certificate";
+
+
static const int CUSTOM_DB_TABLE_COUNT= 4;\r
\r
\r
_WebManager::_WebManager(void)\r
: __pWebList(null)\r
, __pCallbackList(null)\r
- , __pActivePopupList(null)\r
, __pActiveWeb(null)\r
+ , __pActivePopup(null)\r
, __pProxy(null)\r
{\r
}\r
r = pCallbackList->Construct();\r
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
\r
- std::unique_ptr<ArrayListT< int> > pActivePopupList(new (std::nothrow) ArrayListT< int >());\r
- SysTryReturnResult(NID_WEB_CTRL, pActivePopupList.get(), E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Insufficient memory.");\r
- r = pActivePopupList->Construct();\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
r = InitializeProxyAddress();\r
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
\r
\r
__pWebList = std::move(pWebList);\r
__pCallbackList = std::move(pCallbackList);\r
- __pActivePopupList = std::move(pActivePopupList);\r
\r
return E_SUCCESS;\r
}\r
\r
\r
-void\r
+void
_WebManager::ClearCertificateDb(void)\r
-{\r
- result r = E_SUCCESS;\r
-\r
- String certificatePath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);\r
- String table(CERTIFICATE_TABLE_NAME);\r
- _DatabaseImpl db;\r
-\r
- r = db.Construct(certificatePath, "r+", null);\r
- SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- db.BeginTransaction();\r
-\r
- r = db.ExecuteSql(L"Delete From " + table, true);\r
- SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- db.CommitTransaction();\r
-\r
- return;\r
-\r
-CATCH:\r
- db.RollbackTransaction();\r
+{
+ result r = E_SUCCESS;
+
+ String certificatePath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+ String table(CERTIFICATE_TABLE_NAME);
+ _DatabaseImpl db;
+
+ r = db.Construct(certificatePath, "r+", null);
+ SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ db.BeginTransaction();
+
+ r = db.ExecuteSql(L"Delete From " + table, true);
+ SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
+
+ db.CommitTransaction();
+
+ return;
+
+CATCH:
+ db.RollbackTransaction();
}\r
\r
\r
connection_h handle = null;\r
char* pProxy = null;\r
\r
- ret = connection_create(&handle);\r
- SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to create connection.");\r
-\r
- connection_address_family_e family = CONNECTION_ADDRESS_FAMILY_IPV4;\r
+ ret = connection_create(&handle);
+ SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to create connection.");
\r
- ret = connection_get_proxy(handle, family, &pProxy);\r
+ connection_address_family_e family = CONNECTION_ADDRESS_FAMILY_IPV4;
+
+ ret = connection_get_proxy(handle, family, &pProxy);
SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to get proxy address.");\r
\r
- ret = connection_destroy(handle);\r
+ ret = connection_destroy(handle);
SysTryReturnResult(NID_WEB_CTRL, ret == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has been occurred. Failed to destroy connection.");\r
\r
__pProxy = pProxy;\r
}\r
\r
\r
-result\r
+result
_WebManager::CreateResourceDirectory(void) const\r
-{\r
- String html5FeaturesPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH);\r
-\r
- if (!_FileImpl::IsFileExist(html5FeaturesPath))\r
- {\r
- result r = E_SUCCESS;\r
-\r
- r = _DirectoryImpl::Create(html5FeaturesPath, true);\r
- SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. create html5 features directory.");\r
- }\r
-\r
- return E_SUCCESS;\r
-}\r
-\r
-\r
-result\r
+{
+ String html5FeaturesPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH);
+
+ if (!_FileImpl::IsFileExist(html5FeaturesPath))
+ {
+ result r = E_SUCCESS;
+
+ r = _DirectoryImpl::Create(html5FeaturesPath, true);
+ SysTryReturnResult(NID_WEB_CTRL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. create html5 features directory.");
+ }
+
+ return E_SUCCESS;
+}
+
+
+result
_WebManager::InitializeCustomDb(void) const\r
-{\r
- result r = E_SUCCESS;\r
-\r
- _DatabaseImpl db;\r
- String path(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);\r
- String geolocationTable(GEOLOCATION_TABLE_NAME);\r
- String protocolTable(CUSTOM_PROTOCOL_TABLE_NAME);\r
- String contentTable(CUSTOM_CONTENT_TABLE_NAME);\r
- String certificateTable(CERTIFICATE_TABLE_NAME);\r
-\r
- r = db.Construct(path, "a+", null);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select count(name) from sqlite_master Where type='table' And name in ('" + geolocationTable + L"', '" + protocolTable + L"', '" + contentTable + L"', '" + certificateTable + L"')"));\r
- if (pEnum.get())\r
- {\r
- int count = 0;\r
-\r
- r = pEnum->MoveNext();\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- r = pEnum->GetIntAt(0, count);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- if (count == CUSTOM_DB_TABLE_COUNT)\r
- {\r
- return E_SUCCESS;\r
- }\r
- }\r
-\r
- pEnum.reset();\r
- pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + geolocationTable + L"'"));\r
- if (!pEnum.get())\r
- {\r
- r = db.ExecuteSql(\r
- L"CREATE TABLE IF NOT EXISTS " + geolocationTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, origin TEXT, permission INTEGER)",\r
- true);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
- }\r
-\r
- pEnum.reset();\r
- pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + protocolTable + L"'"));\r
- if (!pEnum.get())\r
- {\r
- r = db.ExecuteSql(\r
- L"CREATE TABLE IF NOT EXISTS " + protocolTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, baseUrl TEXT, url TEXT, mime TEXT, allow INTEGER)",\r
- true);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
- }\r
-\r
- pEnum.reset();\r
- pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + contentTable + L"'"));\r
- if (!pEnum.get())\r
- {\r
- r = db.ExecuteSql(\r
- L"CREATE TABLE IF NOT EXISTS " + contentTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, baseUrl TEXT, url TEXT, mime TEXT, allow INTEGER)",\r
- true);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
- }\r
-\r
- pEnum.reset();\r
- pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + certificateTable + L"'"));\r
- if (!pEnum.get())\r
- {\r
- r = db.ExecuteSql(\r
- L"CREATE TABLE IF NOT EXISTS " + certificateTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, pem TEXT, allow INTEGER)",\r
- true);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
- }\r
-\r
- return E_SUCCESS;\r
-}\r
+{
+ result r = E_SUCCESS;
+
+ _DatabaseImpl db;
+ String path(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
+ String geolocationTable(GEOLOCATION_TABLE_NAME);
+ String protocolTable(CUSTOM_PROTOCOL_TABLE_NAME);
+ String contentTable(CUSTOM_CONTENT_TABLE_NAME);
+ String certificateTable(CERTIFICATE_TABLE_NAME);
+
+ r = db.Construct(path, "a+", null);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select count(name) from sqlite_master Where type='table' And name in ('" + geolocationTable + L"', '" + protocolTable + L"', '" + contentTable + L"', '" + certificateTable + L"')"));
+ if (pEnum.get())
+ {
+ int count = 0;
+
+ r = pEnum->MoveNext();
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ r = pEnum->GetIntAt(0, count);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, false, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ if (count == CUSTOM_DB_TABLE_COUNT)
+ {
+ return E_SUCCESS;
+ }
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + geolocationTable + L"'"));
+ if (!pEnum.get())
+ {
+ r = db.ExecuteSql(
+ L"CREATE TABLE IF NOT EXISTS " + geolocationTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, origin TEXT, permission INTEGER)",
+ true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + protocolTable + L"'"));
+ if (!pEnum.get())
+ {
+ r = db.ExecuteSql(
+ L"CREATE TABLE IF NOT EXISTS " + protocolTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, baseUrl TEXT, url TEXT, mime TEXT, allow INTEGER)",
+ true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + contentTable + L"'"));
+ if (!pEnum.get())
+ {
+ r = db.ExecuteSql(
+ L"CREATE TABLE IF NOT EXISTS " + contentTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, baseUrl TEXT, url TEXT, mime TEXT, allow INTEGER)",
+ true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ pEnum.reset();
+ pEnum = std::unique_ptr<DbEnumerator>(db.QueryN(L"Select name from sqlite_master Where type='table' And name = '" + certificateTable + L"'"));
+ if (!pEnum.get())
+ {
+ r = db.ExecuteSql(
+ L"CREATE TABLE IF NOT EXISTS " + certificateTable + L"(id INTEGER PRIMARY KEY AUTOINCREMENT, pem TEXT, allow INTEGER)",
+ true);
+ SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+
+ return E_SUCCESS;
+}
\r
\r
result\r
__pActiveWeb = pWebAddress;\r
}\r
\r
- for (int i = 0; i < __pActivePopupList->GetCount(); i++)\r
+ if (__pActivePopup != null)\r
{\r
- int activePopupAddr = 0;\r
- __pActivePopupList->GetAt(i, activePopupAddr);\r
- _WebPopup* pActivePopup = reinterpret_cast< _WebPopup* >(activePopupAddr);\r
-\r
- if (pActivePopup != null)\r
- {\r
- pActivePopup->SetShowState(false);\r
+ __pActivePopup->SetShowState(false);\r
\r
- _FormImpl* pFormImpl = __pActiveWeb->GetParentFormImpl(__pActiveWeb);\r
+ _FormImpl* pFormImpl = __pActiveWeb->GetParentFormImpl(__pActiveWeb);\r
\r
- if (pFormImpl != null)\r
- {\r
- pActivePopup->SetOwner(&pFormImpl->GetPublic());\r
- }\r
- else\r
- {\r
- pActivePopup->SetOwner(&__pActiveWeb->GetPublic());\r
- }\r
-\r
- pActivePopup->SetShowState(true);\r
- pActivePopup->Show();\r
+ if (pFormImpl != null)\r
+ {\r
+ __pActivePopup->SetOwner(&pFormImpl->GetPublic());\r
}\r
+ else\r
+ {\r
+ __pActivePopup->SetOwner(&__pActiveWeb->GetPublic());\r
+ }\r
+\r
+ __pActivePopup->SetShowState(true);\r
+ __pActivePopup->Show();\r
}\r
}\r
\r
}\r
\r
\r
-result\r
-_WebManager::SetActivePopup(int popupAddress)\r
+void\r
+_WebManager::SetActivePopup(Tizen::Web::Controls::_WebPopup* pPopupAddress)\r
{\r
- result r = E_SUCCESS;\r
-\r
- r = __pActivePopupList->Add(popupAddress);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- return r;\r
+ __pActivePopup = pPopupAddress;\r
}\r
\r
\r
-result\r
-_WebManager::RemoveActivePopup(int popupAddress)\r
+void\r
+_WebManager::RemoveActivePopup(Tizen::Web::Controls::_WebPopup* pPopupAddress)\r
{\r
- result r = E_SUCCESS;\r
-\r
- r = __pActivePopupList->Remove(popupAddress);\r
- SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));\r
-\r
- return r;\r
+ if (__pActivePopup == pPopupAddress)\r
+ {\r
+ __pActivePopup = null;\r
+ }\r
}\r
\r
\r
namespace Tizen { namespace Web { namespace Controls\r
{\r
\r
-_OSP_EXPORT_ extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[];\r
-_OSP_EXPORT_ extern const wchar_t USER_CONFIRM_DB_NAME[];\r
-_OSP_EXPORT_ extern const wchar_t GEOLOCATION_TABLE_NAME[];\r
-_OSP_EXPORT_ extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[];\r
-_OSP_EXPORT_ extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[];\r
+_OSP_EXPORT_ extern const wchar_t CUSTOM_DB_DIRECTORY_PATH[];
+_OSP_EXPORT_ extern const wchar_t USER_CONFIRM_DB_NAME[];
+_OSP_EXPORT_ extern const wchar_t GEOLOCATION_TABLE_NAME[];
+_OSP_EXPORT_ extern const wchar_t CUSTOM_PROTOCOL_TABLE_NAME[];
+_OSP_EXPORT_ extern const wchar_t CUSTOM_CONTENT_TABLE_NAME[];
_OSP_EXPORT_ extern const wchar_t CERTIFICATE_TABLE_NAME[];\r
\r
class _WebImpl;\r
\r
void SetActiveWeb(Tizen::Web::Controls::_WebImpl* pWebAddress);\r
void RemoveActiveWeb(Tizen::Web::Controls::_WebImpl* pWebAddress);\r
- result SetActivePopup(int popupAddress);\r
- result RemoveActivePopup(int popupAddress);\r
+ void SetActivePopup(Tizen::Web::Controls::_WebPopup* pPopupAddress);\r
+ void RemoveActivePopup(Tizen::Web::Controls::_WebPopup* pPopupAddress);\r
\r
static _WebManager* GetInstance(void);\r
\r
\r
void ClearCertificateDb(void);\r
result InitializeProxyAddress(void);\r
- result CreateResourceDirectory(void) const;\r
+ result CreateResourceDirectory(void) const;
result InitializeCustomDb(void) const;\r
\r
_WebManager& operator=(const _WebManager& rhs);\r
private:\r
std::unique_ptr<Tizen::Base::Collection::ArrayListT< int > > __pWebList;\r
std::unique_ptr<Tizen::Base::Collection::MultiHashMapT< int, int > > __pCallbackList;\r
- std::unique_ptr<Tizen::Base::Collection::ArrayListT< int > > __pActivePopupList;\r
\r
_WebImpl* __pActiveWeb;\r
+ _WebPopup* __pActivePopup;\r
char* __pProxy;\r
\r
static _WebManager* __pInstance;\r
_WebPopup::~_WebPopup(void)
{
_WebManager* pWebManager = _WebManager::GetInstance();
- pWebManager->RemoveActivePopup(reinterpret_cast< int >(this));
+ pWebManager->RemoveActivePopup(this);
if (IsModalPopup())
{
result r = E_SUCCESS;
_WebManager* pWebManager = _WebManager::GetInstance();
- pWebManager->SetActivePopup(reinterpret_cast< int >(this));
+ pWebManager->SetActivePopup(this);
r = SetShowState(true);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
_WebPopup::ShowAndWait(int& modalResult)
{
_WebManager* pWebManager = _WebManager::GetInstance();
- pWebManager->SetActivePopup(reinterpret_cast< int >(this));
+ pWebManager->SetActivePopup(this);
__isModal = true;
enum _WebPopupCloseId
{
- ID_AUTHENTICATION_CONFIRM_POPUP_CANCEL,
- ID_AUTHENTICATION_CONFIRM_POPUP_PROCESS,
ID_CERTIFICATE_CONFIRM_POPUP_CLOSE,
ID_PROMPT_POPUP_CLOSE,
ID_USER_CONFIRM_USERMEDIA_CLOSE,