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_EflWebkit.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->btnDim.height + 2*pPopupData->sideMargin;
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)
125 popupMaxHeight -= 2*pPopupData->sideMargin;
129 r = _WebPopup::Construct(hasTitle, Dimension(pPopupData->popupDim.width, popupMaxHeight));
130 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
132 if (userConfirmMode != USER_SCRIPT_ALERT)
134 SetTitleText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_WARNING_ABB"));
137 String message = L"";
138 if (userConfirmMode >= USER_SCRIPT_ALERT && userConfirmMode <= USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED)
144 message = GetMessageFromPolicy();
147 Rectangle rect(0, 0, 0, 0);
150 rect.height = 2*pPopupData->labelDim.height;
151 rect.width = pPopupData->labelDim.width;
153 //With the font of label and width of label, required height is calculated
154 // using textobject. TEXT_SIZE_ADJUST is used to increase font size and get bigger height
155 // as the accurate height is not fitting text in some cases.
157 r = font.Construct(FONT_STYLE_PLAIN, pPopupData->labelFontSize + TEXT_SIZE_ADJUST);
158 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
160 std::unique_ptr<TextObject> pTextObject(new (std::nothrow) TextObject());
161 SysTryReturnResult(NID_WEB_CTRL, pTextObject.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
163 r = pTextObject->Construct();
164 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
166 std::unique_ptr<TextSimple> pSimpleText(new (std::nothrow) TextSimple(message.GetPointer(), message.GetLength(), TEXT_ELEMENT_SOURCE_TYPE_EXTERNAL, &font));
167 SysTryReturnResult(NID_WEB_CTRL, pSimpleText.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
169 r = pTextObject->AppendElement(*pSimpleText);
170 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
172 pSimpleText.release();
174 r = pTextObject->SetWrap(TEXT_OBJECT_WRAP_TYPE_WORD);
175 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
177 r = pTextObject->SetBounds(rect);
178 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
180 r = pTextObject->SetFont(&font, 0, message.GetLength());
181 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
183 r = pTextObject->Compose();
184 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
186 int labelHeight = pTextObject->GetTotalHeight();
188 std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
189 SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
191 r = pLabel->Construct(rect, message);
192 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
194 pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
196 Control* pInfoLabel = null;
198 if (rect.height < labelHeight)
200 //message text is bigger than label, scroll is created to accomodate it.
201 std::unique_ptr<ScrollPanel> pScrollPanel(new (std::nothrow) ScrollPanel());
202 SysTryReturnResult(NID_WEB_CTRL, pScrollPanel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
204 r = pScrollPanel->Construct(rect);
205 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
207 r = AddControl(*pScrollPanel);
208 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
210 ScrollPanel* pSPanel = pScrollPanel.release();
212 r = pLabel->SetSize(Dimension(rect.width, labelHeight));
213 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
215 r = pSPanel->AddControl(*pLabel);
216 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
219 pInfoLabel = pSPanel;
223 r = AddControl(*pLabel);
224 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
226 pInfoLabel = pLabel.release();
230 if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
233 rect.height = pPopupData->checkDim.height;
235 std::unique_ptr<CheckButton> pCheckButton (new (std::nothrow) CheckButton());
236 SysTryReturnResult(NID_WEB_CTRL, pCheckButton.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
238 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"));
239 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
241 r = AddControl(*pCheckButton);
242 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
244 __pCheckButton = pCheckButton.release();
247 Panel* pButtonPanel = CreateAndAddPanel();
248 SysTryReturn(NID_WEB_CTRL, pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
251 r = idList.Construct();
252 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
255 r = titleList.Construct();
256 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
258 if (userConfirmMode == USER_SCRIPT_ALERT)
260 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
261 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
265 idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
266 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
267 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB"))));
268 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB"))));
271 r = CreateAndAddButtons(idList, titleList, pButtonPanel);
272 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
274 std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
275 SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
277 pLayout->SetHorizontalAlignment(*pInfoLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
278 if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
280 pLayout->SetHorizontalAlignment(*__pCheckButton, LAYOUT_HORIZONTAL_ALIGN_CENTER);
282 pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
284 if ( __userConfirmMode == USER_SCRIPT_ALERT )
286 pLayout->SetSpacing(*pButtonPanel, pPopupData->sideMargin);
290 pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
293 SetPropagatedKeyEventListener(this);
299 _UserConfirmPopup::OnActionPerformed(const Control& source, int actionId)
301 result r = E_SUCCESS;
305 case ID_BUTTON_USER_ALLOW:
306 HandleUserAction(EINA_TRUE);
309 case ID_BUTTON_USER_CANCEL:
310 HandleUserAction(EINA_FALSE);
320 SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
325 switch(__userConfirmMode)
327 case USER_CONFIRM_USERMEDIA:
329 __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null);
332 case USER_CONFIRM_GEOLOCATION:
334 __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null);
337 case USER_CONFIRM_NOTIFICATION:
339 __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null);
342 case USER_SCRIPT_ALERT:
344 __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null);
347 case USER_SCRIPT_CONFIRM:
349 __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
360 _UserConfirmPopup::GetMessageFromPolicy(void)
362 _SystemResource* pSysResource = _SystemResource::GetInstance();
363 SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
367 switch(__userConfirmMode)
369 case USER_CONFIRM_USERMEDIA:
371 message = L"Do you want to allow acccess to media?\n";
374 case USER_PROTOCOL_HANDLER:
376 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
377 SysAssertf(pHandlerData, "Failed to request");
379 String target(ewk_custom_handlers_data_target_get(pHandlerData));
380 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
382 message = baseUri + String(L" is asking to register ") + target + String(L" protocol handler.");
385 case USER_CONTENT_HANDLER:
387 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
388 SysAssertf(pHandlerData, "Failed to request");
390 String target(ewk_custom_handlers_data_target_get(pHandlerData));
391 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
393 message = String(baseUri) + String(L" is asking to register ") + String(target) + String(L" content handler.");
396 case USER_CONFIRM_GEOLOCATION:
398 Ewk_Geolocation_Permission_Request* pGeoLocPermReq = reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
399 const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pGeoLocPermReq);
401 message = _Utility::CreateOrigin(pSecurityOrigin);
402 message.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_PS_REQUESTS_YOUR_LOCATION"));
405 case USER_CONFIRM_NOTIFICATION:
407 Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(__pUserPolicyData);
408 const Ewk_Security_Origin* pSecurityOrigin = ewk_notification_permission_request_origin_get(pPermissionRequest);
409 message = _Utility::CreateOrigin(pSecurityOrigin);
410 message.Append(L" wants to display notifications");
422 _UserConfirmPopup::HandleUserAction(Eina_Bool allow)
424 switch (__userConfirmMode)
426 case USER_CONFIRM_USERMEDIA:
428 Ewk_User_Media_Permission_Request* pPolicy = reinterpret_cast< Ewk_User_Media_Permission_Request* >(__pUserPolicyData);
429 ewk_user_media_permission_request_set(pPolicy, allow);
432 case USER_PROTOCOL_HANDLER:
434 RegisterHandler(false, allow);
437 case USER_CONTENT_HANDLER:
439 RegisterHandler(true, allow);
442 case USER_CONFIRM_GEOLOCATION:
444 Ewk_Geolocation_Permission_Request* pPolicy = reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
445 if (__pCheckButton->IsSelected())
447 result r = AddGeolocationDb(pPolicy, static_cast < bool >(allow));
448 SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
451 ewk_geolocation_permission_request_set(pPolicy, allow);
454 case USER_CONFIRM_NOTIFICATION:
456 Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(__pUserPolicyData);
457 ewk_notification_permission_request_set(pPermissionRequest, allow);
460 case USER_SCRIPT_ALERT:
462 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
463 ewk_view_javascript_alert_reply(pView);
466 case USER_SCRIPT_CONFIRM:
468 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
469 ewk_view_javascript_confirm_reply(pView, allow);
472 case USER_CONFIRM_APP_CACHE:
474 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
475 ewk_view_application_cache_permission_reply(pObj, allow);
478 case USER_CONFIRM_DB_QUOTA_EXCEDED:
480 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
481 ewk_view_exceeded_database_quota_reply(pObj, allow);
484 case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
486 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
487 ewk_view_exceeded_local_file_system_quota_reply(pObj, allow);
490 case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
492 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
493 ewk_view_exceeded_indexed_database_quota_reply(pObj, allow);
499 __isUserActionNeeded = false;
504 _UserConfirmPopup::AddGeolocationDb(Ewk_Geolocation_Permission_Request* pPolicy, bool enable)
507 String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
508 String table(GEOLOCATION_TABLE_NAME);
510 const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pPolicy);
511 String origin = _Utility::CreateOrigin(pSecurityOrigin);
513 result r = db.Construct(geolocationPath, "r+", null);
514 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
516 std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (origin, permission) Values (?, ?)"));
517 SysTryReturn(NID_WEB_CTRL, pStmt.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
519 SysLog(NID_WEB_CTRL, "The current value of stmt is %u, host is %ls", pStmt.get(), origin.GetPointer());
521 pStmt->BindString(0, origin);
522 pStmt->BindInt(1, static_cast < int >(enable));
524 db.BeginTransaction();
526 std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pStmt));
528 db.CommitTransaction();
535 _UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow)
538 String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
542 if(checkHandler == true)
544 table = CUSTOM_CONTENT_TABLE_NAME;
548 table = CUSTOM_PROTOCOL_TABLE_NAME;
550 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
551 SysAssertf(pHandlerData, "Failed to request");
553 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
554 String uri = ewk_custom_handlers_data_url_get(pHandlerData);
555 String target = ewk_custom_handlers_data_target_get(pHandlerData);
557 result r = db.Construct(handlerPath, "r+", null);
558 SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
560 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"'"));
565 pEnum->GetIntAt(0, checkId);
567 std::unique_ptr<DbStatement> pUpdateStmt(db.CreateStatementN(L"Update " + table + L" Set allow = (?) Where id = (?)"));
568 SysTryReturnVoidResult(NID_WEB_CTRL, pUpdateStmt.get(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
570 pUpdateStmt->BindInt(0, static_cast < int >(allow));
571 pUpdateStmt->BindInt(1, checkId);
573 db.BeginTransaction();
575 std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pUpdateStmt));
577 db.CommitTransaction();
582 std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (baseUrl, url, mime, allow) Values (?, ?, ?, ?)"));
583 SysTryReturnVoidResult(NID_WEB_CTRL, pStmt.get(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
585 pStmt->BindString(0, baseUri);
586 pStmt->BindString(1, uri);
587 pStmt->BindString(2, target);
588 pStmt->BindInt(3, static_cast < int >(allow));
590 db.BeginTransaction();
592 std::unique_ptr<DbEnumerator> pRegisterEnum(db.ExecuteStatementN(*pStmt));
594 db.CommitTransaction();
599 _UserConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
605 _UserConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
607 result r = E_SUCCESS;
608 if ((keyEventInfo.GetKeyCode() == KEY_ESC || keyEventInfo.GetKeyCode() == KEY_BACK) && source.GetShowState() == true)
610 HandleUserAction(EINA_FALSE);
615 SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
618 switch (__userConfirmMode)
620 case USER_CONFIRM_USERMEDIA:
622 __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null);
625 case USER_CONFIRM_GEOLOCATION:
627 __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null);
630 case USER_CONFIRM_NOTIFICATION:
632 __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null);
635 case USER_SCRIPT_ALERT:
637 __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null);
640 case USER_SCRIPT_CONFIRM:
642 __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
645 case USER_PROTOCOL_HANDLER:
646 case USER_CONTENT_HANDLER:
647 case USER_CONFIRM_APP_CACHE:
648 case USER_CONFIRM_DB_QUOTA_EXCEDED:
649 case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
650 case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
660 _UserConfirmPopup::OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
666 _UserConfirmPopup::OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
672 _UserConfirmPopup::TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo)
678 }}} // Tizen::Web::Controls