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