2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FWebCtrl_UserConfirmPopup.cpp
20 * @brief The file contains the definition of _UserConfirmPopup class.
24 #include <FBaseColArrayList.h>
25 #include <FBaseSysLog.h>
26 #include <FBaseUtilUri.h>
27 #include <FGrpDimension.h>
29 #include <FGrpRectangle.h>
30 #include <FIoDbEnumerator.h>
31 #include <FIoDbStatement.h>
32 #include <FSecCertX509Certificate.h>
33 #include <FUiCtrlButton.h>
34 #include <FUiCtrlLabel.h>
35 #include <FUiCtrlPanel.h>
36 #include <FUiCtrlScrollPanel.h>
37 #include <FUiKeyEventInfo.h>
38 #include <FUiLayout.h>
39 #include <FUiVerticalBoxLayout.h>
40 #include <FGrp_TextTextObject.h>
41 #include <FGrp_TextTextSimple.h>
42 #include <FIo_DatabaseImpl.h>
43 #include <FSys_SystemResource.h>
44 #include <FUi_ControlManager.h>
45 #include <FUi_ResourceManager.h>
46 #include "FWebCtrl_WebManager.h"
47 #include "FWebCtrl_UserConfirmPopup.h"
48 #include "FWebCtrl_Utility.h"
49 #include "FWebCtrl_WebImpl.h"
52 using namespace Tizen::Base;
53 using namespace Tizen::Base::Collection;
54 using namespace Tizen::Base::Utility;
55 using namespace Tizen::Graphics;
56 using namespace Tizen::Graphics::_Text;
57 using namespace Tizen::Io;
58 using namespace Tizen::Security::Cert;
59 using namespace Tizen::System;
60 using namespace Tizen::Ui;
61 using namespace Tizen::Ui::Controls;
64 namespace Tizen { namespace Web { namespace Controls
68 static const int TEXT_SIZE_ADJUST = 1;
71 _UserConfirmPopup::_UserConfirmPopup(void)
72 : __pUserPolicyData(null)
73 , __userConfirmMode(USER_CONFIRM_USERMEDIA)
74 , __pCheckButton(null)
75 , __isUserActionNeeded(false)
82 _UserConfirmPopup::~_UserConfirmPopup(void)
84 if (__isUserActionNeeded == true)
86 HandleUserAction(EINA_FALSE);
87 __isUserActionNeeded = false;
93 _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, Tizen::Web::Controls::_WebImpl* pImpl, bool sync, String msg)
96 SysTryReturnResult(NID_WEB_CTRL, pEventInfo, E_INVALID_ARG, "Invalid argument(s) is used. pPolicy is null.");
97 SysTryReturnResult(NID_WEB_CTRL, userConfirmMode >= USER_CONFIRM_USERMEDIA && userConfirmMode <= USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED, E_INVALID_ARG,
98 "Invalid userConfirmMode is used. [%d]", userConfirmMode);
100 _SystemResource* pSysResource = _SystemResource::GetInstance();
101 SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
103 _WebPopupData* pPopupData = _WebPopup::GetPopupData();
104 SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
106 __pUserPolicyData = pEventInfo;
107 __userConfirmMode = userConfirmMode;
110 __isUserActionNeeded = true;
112 bool hasTitle = true;
113 int popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->panelHeight;
116 SysAssertf(__pImpl != null, "Failed to get _WebImpl");
118 if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
120 popupMaxHeight += pPopupData->checkDim.height;
123 if (__userConfirmMode == USER_SCRIPT_ALERT)
128 r = _WebPopup::Construct(hasTitle, Dimension(pPopupData->popupDim.width, popupMaxHeight));
129 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
131 if (userConfirmMode != USER_SCRIPT_ALERT)
133 SetTitleText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_WARNING_ABB"));
136 String message = L"";
137 if (userConfirmMode >= USER_SCRIPT_ALERT && userConfirmMode <= USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED)
143 message = GetMessageFromPolicy();
146 Rectangle rect(0, 0, 0, 0);
149 rect.height = 2*pPopupData->labelDim.height;
150 rect.width = pPopupData->labelDim.width;
152 //With the font of label and width of label, required height is calculated
153 // using textobject. TEXT_SIZE_ADJUST is used to increase font size and get bigger height
154 // as the accurate height is not fitting text in some cases.
156 r = font.Construct(FONT_STYLE_PLAIN, pPopupData->labelFontSize + TEXT_SIZE_ADJUST);
157 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
159 std::unique_ptr<TextObject> pTextObject(new (std::nothrow) TextObject());
160 SysTryReturnResult(NID_WEB_CTRL, pTextObject.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
162 r = pTextObject->Construct();
163 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
165 std::unique_ptr<TextSimple> pSimpleText(new (std::nothrow) TextSimple(message.GetPointer(), message.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, &font));
166 SysTryReturnResult(NID_WEB_CTRL, pSimpleText.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
168 r = pTextObject->AppendElement(*pSimpleText);
169 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
171 pSimpleText.release();
173 r = pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
174 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
176 r = pTextObject->SetBounds(rect);
177 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
179 r = pTextObject->SetFont(&font, 0, message.GetLength());
180 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
182 r = pTextObject->Compose();
183 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
185 int labelHeight = pTextObject->GetTotalHeight();
187 std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
188 SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
190 r = pLabel->Construct(rect, message);
191 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
193 pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
195 Control* pInfoLabel = null;
197 if (rect.height < labelHeight)
199 //message text is bigger than label, scroll is created to accomodate it.
200 std::unique_ptr<ScrollPanel> pScrollPanel(new (std::nothrow) ScrollPanel());
201 SysTryReturnResult(NID_WEB_CTRL, pScrollPanel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
203 r = pScrollPanel->Construct(rect);
204 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
206 r = AddControl(*pScrollPanel);
207 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
209 ScrollPanel* pSPanel = pScrollPanel.release();
211 r = pLabel->SetSize(Dimension(rect.width, labelHeight));
212 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
214 r = pSPanel->AddControl(*pLabel);
215 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
218 pInfoLabel = pSPanel;
222 r = AddControl(*pLabel);
223 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
225 pInfoLabel = pLabel.release();
229 if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
232 rect.height = pPopupData->checkDim.height;
234 std::unique_ptr<CheckButton> pCheckButton (new (std::nothrow) CheckButton());
235 SysTryReturnResult(NID_WEB_CTRL, pCheckButton.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
237 r = pCheckButton->Construct(Rectangle(0, 0, rect.width, rect.height), CHECK_BUTTON_STYLE_MARK, BACKGROUND_STYLE_NONE, false, pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_REMEMBER_PREFERENCE"));
238 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
240 r = AddControl(*pCheckButton);
241 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
243 __pCheckButton = pCheckButton.release();
246 Panel* pButtonPanel = CreateAndAddPanel();
247 SysTryReturn(NID_WEB_CTRL, pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
250 r = idList.Construct();
251 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
254 r = titleList.Construct();
255 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
257 if (userConfirmMode == USER_SCRIPT_ALERT)
259 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
260 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
262 else if (userConfirmMode == USER_BEFORE_UNLOAD_CONFIRM)
264 idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
265 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
266 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_LEAVE"))));
267 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_STAY"))));
271 idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
272 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
273 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB"))));
274 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB"))));
277 r = CreateAndAddButtons(idList, titleList, pButtonPanel);
278 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
280 std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
281 SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
283 pLayout->SetHorizontalAlignment(*pInfoLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
284 if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
286 pLayout->SetHorizontalAlignment(*__pCheckButton, LAYOUT_HORIZONTAL_ALIGN_CENTER);
289 SetPropagatedKeyEventListener(this);
295 _UserConfirmPopup::OnActionPerformed(const Control& source, int actionId)
297 result r = E_SUCCESS;
301 case ID_BUTTON_USER_ALLOW:
302 HandleUserAction(EINA_TRUE);
305 case ID_BUTTON_USER_CANCEL:
306 HandleUserAction(EINA_FALSE);
316 SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
321 switch(__userConfirmMode)
323 case USER_CONFIRM_USERMEDIA:
325 __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null);
328 case USER_CONFIRM_GEOLOCATION:
330 __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null);
333 case USER_CONFIRM_NOTIFICATION:
335 __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null);
338 case USER_SCRIPT_ALERT:
340 __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null);
343 case USER_SCRIPT_CONFIRM:
345 __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
348 case USER_BEFORE_UNLOAD_CONFIRM:
350 __pImpl->SendUserEvent(ID_USER_BEFORE_UNLOAD_CONFIRM_CLOSE, null);
361 _UserConfirmPopup::GetMessageFromPolicy(void)
363 _SystemResource* pSysResource = _SystemResource::GetInstance();
364 SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
368 switch(__userConfirmMode)
370 case USER_CONFIRM_USERMEDIA:
372 message = L"Do you want to allow acccess to media?\n";
375 case USER_PROTOCOL_HANDLER:
377 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
378 SysAssertf(pHandlerData, "Failed to request");
380 String target(ewk_custom_handlers_data_target_get(pHandlerData));
381 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
383 message = baseUri + String(L" is asking to register ") + target + String(L" protocol handler.");
386 case USER_CONTENT_HANDLER:
388 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
389 SysAssertf(pHandlerData, "Failed to request");
391 String target(ewk_custom_handlers_data_target_get(pHandlerData));
392 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
394 message = String(baseUri) + String(L" is asking to register ") + String(target) + String(L" content handler.");
397 case USER_CONFIRM_GEOLOCATION:
399 Ewk_Geolocation_Permission_Request* pGeoLocPermReq = reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
400 const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pGeoLocPermReq);
402 message = _Utility::CreateOrigin(pSecurityOrigin);
403 message.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_PS_REQUESTS_YOUR_LOCATION"));
406 case USER_CONFIRM_NOTIFICATION:
408 Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(__pUserPolicyData);
409 const Ewk_Security_Origin* pSecurityOrigin = ewk_notification_permission_request_origin_get(pPermissionRequest);
410 message = _Utility::CreateOrigin(pSecurityOrigin);
411 message.Append(L" wants to display notifications");
423 _UserConfirmPopup::HandleUserAction(Eina_Bool allow)
425 switch (__userConfirmMode)
427 case USER_CONFIRM_USERMEDIA:
429 Ewk_User_Media_Permission_Request* pPolicy = reinterpret_cast< Ewk_User_Media_Permission_Request* >(__pUserPolicyData);
430 ewk_user_media_permission_request_set(pPolicy, allow);
433 case USER_PROTOCOL_HANDLER:
435 RegisterHandler(false, allow);
438 case USER_CONTENT_HANDLER:
440 RegisterHandler(true, allow);
443 case USER_CONFIRM_GEOLOCATION:
445 Ewk_Geolocation_Permission_Request* pPolicy = reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
446 if (__pCheckButton->IsSelected())
448 result r = AddGeolocationDb(pPolicy, static_cast < bool >(allow));
449 SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
452 ewk_geolocation_permission_request_set(pPolicy, allow);
455 case USER_CONFIRM_NOTIFICATION:
457 Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(__pUserPolicyData);
458 ewk_notification_permission_request_set(pPermissionRequest, allow);
461 case USER_SCRIPT_ALERT:
463 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
464 ewk_view_javascript_alert_reply(pView);
467 case USER_SCRIPT_CONFIRM:
469 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
470 ewk_view_javascript_confirm_reply(pView, allow);
473 case USER_BEFORE_UNLOAD_CONFIRM:
475 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
476 ewk_view_before_unload_confirm_panel_reply(pView, !allow);
479 case USER_CONFIRM_APP_CACHE:
481 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
482 ewk_view_application_cache_permission_reply(pObj, allow);
485 case USER_CONFIRM_DB_QUOTA_EXCEDED:
487 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
488 ewk_view_exceeded_database_quota_reply(pObj, allow);
491 case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
493 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
494 ewk_view_exceeded_local_file_system_quota_reply(pObj, allow);
497 case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
499 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
500 ewk_view_exceeded_indexed_database_quota_reply(pObj, allow);
506 __isUserActionNeeded = false;
511 _UserConfirmPopup::AddGeolocationDb(Ewk_Geolocation_Permission_Request* pPolicy, bool enable)
514 String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
515 String table(GEOLOCATION_TABLE_NAME);
517 const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pPolicy);
518 String origin = _Utility::CreateOrigin(pSecurityOrigin);
520 result r = db.Construct(geolocationPath, "r+", null);
521 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
523 std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (origin, permission) Values (?, ?)"));
524 SysTryReturn(NID_WEB_CTRL, pStmt.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
526 SysLog(NID_WEB_CTRL, "The current value of stmt is %u, host is %ls", pStmt.get(), origin.GetPointer());
528 pStmt->BindString(0, origin);
529 pStmt->BindInt(1, static_cast < int >(enable));
531 db.BeginTransaction();
533 std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pStmt));
535 db.CommitTransaction();
542 _UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow)
545 String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
549 if(checkHandler == true)
551 table = CUSTOM_CONTENT_TABLE_NAME;
555 table = CUSTOM_PROTOCOL_TABLE_NAME;
557 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
558 SysAssertf(pHandlerData, "Failed to request");
560 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
561 String uri = ewk_custom_handlers_data_url_get(pHandlerData);
562 String target = ewk_custom_handlers_data_target_get(pHandlerData);
564 result r = db.Construct(handlerPath, "r+", null);
565 SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
567 std::unique_ptr<DbEnumerator> pEnum(db.QueryN(L"Select id From " + table + L" Where baseUrl = '" + baseUri + L"' AND url = '" + uri + L"' AND mime = '" + target + L"'"));
572 pEnum->GetIntAt(0, checkId);
574 std::unique_ptr<DbStatement> pUpdateStmt(db.CreateStatementN(L"Update " + table + L" Set allow = (?) Where id = (?)"));
575 SysTryReturnVoidResult(NID_WEB_CTRL, pUpdateStmt.get(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
577 pUpdateStmt->BindInt(0, static_cast < int >(allow));
578 pUpdateStmt->BindInt(1, checkId);
580 db.BeginTransaction();
582 std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pUpdateStmt));
584 db.CommitTransaction();
589 std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (baseUrl, url, mime, allow) Values (?, ?, ?, ?)"));
590 SysTryReturnVoidResult(NID_WEB_CTRL, pStmt.get(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
592 pStmt->BindString(0, baseUri);
593 pStmt->BindString(1, uri);
594 pStmt->BindString(2, target);
595 pStmt->BindInt(3, static_cast < int >(allow));
597 db.BeginTransaction();
599 std::unique_ptr<DbEnumerator> pRegisterEnum(db.ExecuteStatementN(*pStmt));
601 db.CommitTransaction();
606 _UserConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
612 _UserConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
614 result r = E_SUCCESS;
615 if ((keyEventInfo.GetKeyCode() == KEY_ESC || keyEventInfo.GetKeyCode() == KEY_BACK) && source.GetShowState() == true)
617 HandleUserAction(EINA_FALSE);
622 SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
625 switch (__userConfirmMode)
627 case USER_CONFIRM_USERMEDIA:
629 __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null);
632 case USER_CONFIRM_GEOLOCATION:
634 __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null);
637 case USER_CONFIRM_NOTIFICATION:
639 __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null);
642 case USER_SCRIPT_ALERT:
644 __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null);
647 case USER_SCRIPT_CONFIRM:
649 __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
652 case USER_BEFORE_UNLOAD_CONFIRM:
654 __pImpl->SendUserEvent(ID_USER_BEFORE_UNLOAD_CONFIRM_CLOSE, null);
657 case USER_PROTOCOL_HANDLER:
658 case USER_CONTENT_HANDLER:
659 case USER_CONFIRM_APP_CACHE:
660 case USER_CONFIRM_DB_QUOTA_EXCEDED:
661 case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
662 case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
672 _UserConfirmPopup::OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
678 _UserConfirmPopup::OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
684 _UserConfirmPopup::TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo)
690 }}} // Tizen::Web::Controls