Apply focus ui, fix for issue
[framework/osp/web.git] / src / controls / FWebCtrl_UserConfirmPopup.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file                FWebCtrl_UserConfirmPopup.cpp
20  * @brief               The file contains the definition of _UserConfirmPopup class.
21  */
22 #include <EWebKit2.h>
23 #include <FAppApp.h>
24 #include <FBaseColArrayList.h>
25 #include <FBaseSysLog.h>
26 #include <FBaseUtilUri.h>
27 #include <FGrpDimension.h>
28 #include <FGrpRectangle.h>
29 #include <FIoDbEnumerator.h>
30 #include <FIoDbStatement.h>
31 #include <FSecCertX509Certificate.h>
32 #include <FUiCtrlButton.h>
33 #include <FUiCtrlLabel.h>
34 #include <FUiCtrlPanel.h>
35 #include <FUiKeyEventInfo.h>
36 #include <FUiLayout.h>
37 #include <FUiVerticalBoxLayout.h>
38 #include <FIo_DatabaseImpl.h>
39 #include <FSys_SystemResource.h>
40 #include <FUi_ControlManager.h>
41 #include <FUi_ResourceManager.h>
42 #include "FWebCtrl_EflWebkit.h"
43 #include "FWebCtrl_UserConfirmPopup.h"
44 #include "FWebCtrl_Utility.h"
45 #include "FWebCtrl_WebImpl.h"
46
47
48 using namespace Tizen::Base;
49 using namespace Tizen::Base::Collection;
50 using namespace Tizen::Base::Utility;
51 using namespace Tizen::Graphics;
52 using namespace Tizen::Io;
53 using namespace Tizen::Security::Cert;
54 using namespace Tizen::System;
55 using namespace Tizen::Ui;
56 using namespace Tizen::Ui::Controls;
57
58
59 namespace Tizen { namespace Web { namespace Controls
60 {
61
62
63 _UserConfirmPopup::_UserConfirmPopup(void)
64         : __pUserPolicyData(null)
65         , __userConfirmMode(USER_CONFIRM_USERMEDIA)
66         , __pCheckButton(null)
67         , __isUserActionNeeded(false)
68         , __sync(false)
69         , __pImpl(null)
70 {
71 }
72
73
74 _UserConfirmPopup::~_UserConfirmPopup(void)
75 {
76         if (__isUserActionNeeded == true)
77         {
78                 HandleUserAction(EINA_FALSE);
79                 __isUserActionNeeded = false;
80         }
81 }
82
83
84 result
85 _UserConfirmPopup::Construct(_UserConfirmMode userConfirmMode, void* pEventInfo, Tizen::Web::Controls::_WebImpl* pImpl, bool sync, String msg)
86 {
87         result r = E_SUCCESS;
88         SysTryReturnResult(NID_WEB_CTRL, pEventInfo, E_INVALID_ARG, "Invalid argument(s) is used. pPolicy is null.");
89         SysTryReturnResult(NID_WEB_CTRL, userConfirmMode >= USER_CONFIRM_USERMEDIA && userConfirmMode <= USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED, E_INVALID_ARG,
90                                         "Invalid userConfirmMode is used. [%d]", userConfirmMode);
91
92         _SystemResource* pSysResource = _SystemResource::GetInstance();
93         SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
94
95         _WebPopupData* pPopupData = _WebPopup::GetPopupData();
96         SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
97
98         __pUserPolicyData = pEventInfo;
99         __userConfirmMode = userConfirmMode;
100         __sync = sync;
101
102         __isUserActionNeeded = true;
103
104         bool hasTitle = true;
105         int popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->btnDim.height + 2*pPopupData->sideMargin;
106
107         __pImpl = pImpl;
108         SysAssertf(__pImpl != null, "Failed to get _WebImpl");
109
110         if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
111         {
112                 popupMaxHeight +=  pPopupData->checkDim.height;
113         }
114
115         if (__userConfirmMode == USER_SCRIPT_ALERT)
116         {
117                 popupMaxHeight -=  2*pPopupData->sideMargin;
118                 hasTitle = false;
119         }
120
121         r = _WebPopup::Construct(hasTitle, Dimension(pPopupData->popupDim.width, popupMaxHeight));
122         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
123
124         if (userConfirmMode != USER_SCRIPT_ALERT)
125         {
126                 SetTitleText(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_WARNING_ABB"));
127         }
128
129         Rectangle rect(0, 0, 0, 0);
130
131         //label
132         rect.height = 2*pPopupData->labelDim.height;
133         rect.width = pPopupData->labelDim.width;
134
135         std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
136         SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
137
138         String message = L"";
139         if (userConfirmMode >= USER_SCRIPT_ALERT && userConfirmMode <= USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED)
140         {
141                 message = msg;
142         }
143         else
144         {
145                 message = GetMessageFromPolicy();
146         }
147         r = pLabel->Construct(rect, message);
148         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
149
150         pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
151
152         r = AddControl(*pLabel);
153         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
154
155         Label* pInfoLabel = pLabel.release();
156         //checkbutton
157         if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
158         {
159                 rect.y = 0;
160                 rect.height = pPopupData->checkDim.height;
161
162                 std::unique_ptr<CheckButton> pCheckButton (new (std::nothrow) CheckButton());
163                 SysTryReturnResult(NID_WEB_CTRL, pCheckButton.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
164
165                 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"));
166                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
167
168                 r = AddControl(*pCheckButton);
169                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
170
171                 __pCheckButton = pCheckButton.release();
172         }
173
174         Panel* pButtonPanel = CreateAndAddPanel();
175         SysTryReturn(NID_WEB_CTRL, pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
176
177         ArrayList idList;
178         r = idList.Construct();
179         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
180
181         ArrayList titleList;
182         r = titleList.Construct();
183         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
184
185         if (userConfirmMode == USER_SCRIPT_ALERT)
186         {
187                 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
188                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
189         }
190         else
191         {
192                 idList.Add(*(new Integer(ID_BUTTON_USER_CANCEL)));
193                 idList.Add(*(new Integer(ID_BUTTON_USER_ALLOW)));
194                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB"))));
195                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB"))));
196         }
197
198         r = CreateAndAddButtons(idList, titleList, pButtonPanel);
199         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
200
201         std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
202         SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
203
204         pLayout->SetHorizontalAlignment(*pInfoLabel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
205         if (__userConfirmMode == USER_CONFIRM_GEOLOCATION)
206         {
207                 pLayout->SetHorizontalAlignment(*__pCheckButton, LAYOUT_HORIZONTAL_ALIGN_CENTER);
208         }
209         pLayout->SetHorizontalAlignment(*pButtonPanel, LAYOUT_HORIZONTAL_ALIGN_CENTER);
210
211         if ( __userConfirmMode != USER_SCRIPT_ALERT )
212         {
213                 pLayout->SetSpacing(*pButtonPanel, 2*pPopupData->sideMargin);
214         }
215
216         SetPropagatedKeyEventListener(this);
217         return E_SUCCESS;
218 }
219
220
221 void
222 _UserConfirmPopup::OnActionPerformed(const Control& source, int actionId)
223 {
224         result r = E_SUCCESS;
225
226         switch (actionId)
227         {
228         case ID_BUTTON_USER_ALLOW:
229                 HandleUserAction(EINA_TRUE);
230                 break;
231
232         case ID_BUTTON_USER_CANCEL:
233                 HandleUserAction(EINA_FALSE);
234                 break;
235
236         default:
237                 break;
238         }
239
240         r = HidePopup();
241         if (IsFailed(r))
242         {
243                 SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
244         }
245
246         if (!__sync)
247         {
248                 switch(__userConfirmMode)
249                 {
250                 case USER_CONFIRM_USERMEDIA:
251                 {
252                         __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null);
253                         break;
254                 }
255                 case USER_CONFIRM_GEOLOCATION:
256                 {
257                         __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null);
258                         break;
259                 }
260                 case USER_CONFIRM_NOTIFICATION:
261                 {
262                         __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null);
263                         break;
264                 }
265                 case USER_SCRIPT_ALERT:
266                 {
267                         __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null);
268                         break;
269                 }
270                 case USER_SCRIPT_CONFIRM:
271                 {
272                         __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
273                         break;
274                 }
275                 default:
276                         SysAssert(false);
277                 }
278         }
279 }
280
281
282 String
283 _UserConfirmPopup::GetMessageFromPolicy(void)
284 {
285         _SystemResource* pSysResource = _SystemResource::GetInstance();
286         SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
287
288         String message;
289
290         switch(__userConfirmMode)
291         {
292         case USER_CONFIRM_USERMEDIA:
293         {
294                 message = L"Do you want to allow acccess to media?\n";
295                 break;
296         }
297         case USER_PROTOCOL_HANDLER:
298         {
299                 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
300                 SysAssertf(pHandlerData, "Failed to request");
301
302                 String target(ewk_custom_handlers_data_target_get(pHandlerData));
303                 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
304
305                 message = baseUri + String(L" is asking to register ") + target + String(L" protocol handler.");
306                 break;
307         }
308         case USER_CONTENT_HANDLER:
309         {
310                 Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
311                 SysAssertf(pHandlerData, "Failed to request");
312
313                 String target(ewk_custom_handlers_data_target_get(pHandlerData));
314                 String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
315
316                 message = String(baseUri) + String(L" is asking to register ") + String(target) + String(L" content handler.");
317                 break;
318         }
319         case USER_CONFIRM_GEOLOCATION:
320         {
321                 Ewk_Geolocation_Permission_Request* pGeoLocPermReq = reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
322                 const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pGeoLocPermReq);
323
324                 message = _Utility::CreateOrigin(pSecurityOrigin);
325                 message.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_PS_REQUESTS_YOUR_LOCATION"));
326                 break;
327         }
328         case USER_CONFIRM_NOTIFICATION:
329         {
330                 Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(__pUserPolicyData);
331                 const Ewk_Security_Origin* pSecurityOrigin = ewk_notification_permission_request_origin_get(pPermissionRequest);
332                 message = _Utility::CreateOrigin(pSecurityOrigin);
333                 message.Append(L" wants to display notifications");
334                 break;
335         }
336         default:
337                 SysAssert(false);
338         }
339
340         return message;
341 }
342
343
344 void
345 _UserConfirmPopup::HandleUserAction(Eina_Bool allow)
346 {
347         switch (__userConfirmMode)
348         {
349         case USER_CONFIRM_USERMEDIA:
350         {
351                 Ewk_User_Media_Permission_Request* pPolicy = reinterpret_cast< Ewk_User_Media_Permission_Request* >(__pUserPolicyData);
352                 ewk_user_media_permission_request_set(pPolicy, allow);
353                 break;
354         }
355         case USER_PROTOCOL_HANDLER:
356         {
357                 RegisterHandler(false, allow);
358                 break;
359         }
360         case USER_CONTENT_HANDLER:
361         {
362                 RegisterHandler(true, allow);
363                 break;
364         }
365         case USER_CONFIRM_GEOLOCATION:
366         {
367                 Ewk_Geolocation_Permission_Request* pPolicy =  reinterpret_cast< Ewk_Geolocation_Permission_Request* >(__pUserPolicyData);
368                 if (__pCheckButton->IsSelected())
369                 {
370                         result r = AddGeolocationDb(pPolicy, static_cast < bool >(allow));
371                         SysTryCatch(NID_WEB_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
372                 }
373 CATCH:
374                 ewk_geolocation_permission_request_set(pPolicy, allow);
375                 break;
376         }
377         case USER_CONFIRM_NOTIFICATION:
378         {
379                 Ewk_Notification_Permission_Request* pPermissionRequest = reinterpret_cast< Ewk_Notification_Permission_Request* >(__pUserPolicyData);
380                 ewk_notification_permission_request_set(pPermissionRequest, allow);
381                 break;
382         }
383         case USER_SCRIPT_ALERT:
384         {
385                 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
386                 ewk_view_javascript_alert_reply(pView);
387                 break;
388         }
389         case USER_SCRIPT_CONFIRM:
390         {
391                 Evas_Object* pView = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
392                 ewk_view_javascript_confirm_reply(pView, allow);
393                 break;
394         }
395         case USER_CONFIRM_APP_CACHE:
396         {
397                 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
398                 ewk_view_application_cache_permission_reply(pObj, allow);
399                 break;
400         }
401         case USER_CONFIRM_DB_QUOTA_EXCEDED:
402         {
403                 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
404                 ewk_view_exceeded_database_quota_reply(pObj, allow);
405                 break;
406         }
407         case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
408         {
409                 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
410                 ewk_view_exceeded_local_file_system_quota_reply(pObj, allow);
411                 break;
412         }
413         case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
414         {
415                 Evas_Object *pObj = reinterpret_cast< Evas_Object* >(__pUserPolicyData);
416                 ewk_view_exceeded_indexed_database_quota_reply(pObj, allow);
417                 break;
418         }
419         default:
420                 SysAssert(false);
421         }
422         __isUserActionNeeded = false;
423 }
424
425
426 result
427 _UserConfirmPopup::AddGeolocationDb(Ewk_Geolocation_Permission_Request* pPolicy, bool enable)
428 {
429         _DatabaseImpl db;
430         String geolocationPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
431         String table(GEOLOCATION_TABLE_NAME);
432
433         const Ewk_Security_Origin* pSecurityOrigin = ewk_geolocation_permission_request_origin_get(pPolicy);
434         String origin = _Utility::CreateOrigin(pSecurityOrigin);
435
436         result r = db.Construct(geolocationPath, "r+", null);
437         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
438
439         std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (origin, permission) Values (?, ?)"));
440         SysTryReturn(NID_WEB_CTRL, pStmt.get(), GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
441
442         SysLog(NID_WEB_CTRL, "The current value of stmt is %u, host is %ls", pStmt.get(), origin.GetPointer());
443
444         pStmt->BindString(0, origin);
445         pStmt->BindInt(1, static_cast < int >(enable));
446
447         db.BeginTransaction();
448
449         std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pStmt));
450
451         db.CommitTransaction();
452
453         return E_SUCCESS;
454 }
455
456
457 void
458 _UserConfirmPopup::RegisterHandler(bool checkHandler, Eina_Bool allow)
459 {
460         _DatabaseImpl db;
461         String handlerPath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
462         String table;
463         int checkId = 0;
464
465         if(checkHandler == true)
466         {
467                 table = CUSTOM_CONTENT_TABLE_NAME;
468         }
469         else
470         {
471                 table = CUSTOM_PROTOCOL_TABLE_NAME;
472         }
473         Ewk_Custom_Handlers_Data* pHandlerData = reinterpret_cast< Ewk_Custom_Handlers_Data* >(__pUserPolicyData);
474         SysAssertf(pHandlerData, "Failed to request");
475
476         String baseUri(ewk_custom_handlers_data_base_url_get(pHandlerData));
477         String uri = ewk_custom_handlers_data_url_get(pHandlerData);
478         String target = ewk_custom_handlers_data_target_get(pHandlerData);
479
480         result r = db.Construct(handlerPath, "r+", null);
481         SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
482
483         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"'"));
484
485         if(pEnum.get())
486         {
487                 pEnum->MoveNext();
488                 pEnum->GetIntAt(0, checkId);
489
490                 std::unique_ptr<DbStatement> pUpdateStmt(db.CreateStatementN(L"Update " + table + L" Set allow = (?) Where id = (?)"));
491                 SysTryReturnVoidResult(NID_WEB_CTRL, pUpdateStmt.get(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
492
493                 pUpdateStmt->BindInt(0, static_cast < int >(allow));
494                 pUpdateStmt->BindInt(1, checkId);
495
496                 db.BeginTransaction();
497
498                 std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pUpdateStmt));
499
500                 db.CommitTransaction();
501
502         }
503         else
504         {
505                 std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (baseUrl, url, mime, allow) Values (?, ?, ?, ?)"));
506                 SysTryReturnVoidResult(NID_WEB_CTRL, pStmt.get(),  GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
507
508                 pStmt->BindString(0, baseUri);
509                 pStmt->BindString(1, uri);
510                 pStmt->BindString(2, target);
511                 pStmt->BindInt(3, static_cast < int >(allow));
512
513                 db.BeginTransaction();
514
515                 std::unique_ptr<DbEnumerator> pRegisterEnum(db.ExecuteStatementN(*pStmt));
516
517                 db.CommitTransaction();
518         }
519 }
520
521 bool
522 _UserConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
523 {
524         return false;
525 }
526
527 bool
528 _UserConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
529 {
530         result r = E_SUCCESS;
531         if ((keyEventInfo.GetKeyCode() == KEY_ESC || keyEventInfo.GetKeyCode() == KEY_BACK) && source.GetShowState() == true)
532         {
533                 HandleUserAction(EINA_FALSE);
534                 r = HidePopup();
535
536                 if (IsFailed(r))
537                 {
538                         SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
539                 }
540                 
541                 switch (__userConfirmMode)
542                 {
543                 case USER_CONFIRM_USERMEDIA:
544                 {
545                         __pImpl->SendUserEvent(ID_USER_CONFIRM_USERMEDIA_CLOSE, null);
546                         break;
547                 }
548                 case USER_CONFIRM_GEOLOCATION:
549                 {
550                         __pImpl->SendUserEvent(ID_USER_CONFIRM_GEOLOCATION_CLOSE, null);
551                         break;
552                 }
553                 case USER_CONFIRM_NOTIFICATION:
554                 {
555                         __pImpl->SendUserEvent(ID_USER_CONFIRM_NOTIFICATION_CLOSE, null);
556                         break;
557                 }
558                 case USER_SCRIPT_ALERT:
559                 {
560                         __pImpl->SendUserEvent(ID_USER_SCRIPT_ALERT_CLOSE, null);
561                         break;
562                 }
563                 case USER_SCRIPT_CONFIRM:
564                 {
565                         __pImpl->SendUserEvent(ID_USER_SCRIPT_CONFIRM_CLOSE, null);
566                         break;
567                 }
568                 case USER_PROTOCOL_HANDLER:
569                 case USER_CONTENT_HANDLER:
570                 case USER_CONFIRM_APP_CACHE:
571                 case USER_CONFIRM_DB_QUOTA_EXCEDED:
572                 case USER_CONFIRM_LOCAL_FS_QUOTA_EXCEDED:
573                 case USER_CONFIRM_INDEXED_DB_QUOTA_EXCEDED:
574                         break;
575                 default:
576                         SysAssert(false);
577                 }
578         }
579         return false;
580 }
581
582 bool
583 _UserConfirmPopup::OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
584 {
585         return false;
586 }
587
588 bool
589 _UserConfirmPopup::OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
590 {
591         return false;
592 }
593
594 bool
595 _UserConfirmPopup::TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo)
596 {
597         return false;
598 }
599
600
601 }}} // Tizen::Web::Controls