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