patch for rc20
[framework/osp/web.git] / src / controls / FWebCtrl_CertificateConfirmPopup.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_CertificateConfirmPopup.cpp
20  * @brief               The file contains the definition of _CertificateConfirmPopup class.
21  */
22 #include <FAppApp.h>
23 #include <FBaseColArrayList.h>
24 #include <FBaseSysLog.h>
25 #include <FBaseUtilUri.h>
26 #include <FGrpDimension.h>
27 #include <FGrpRectangle.h>
28 #include <FIoDbEnumerator.h>
29 #include <FIoDbStatement.h>
30 #include <FSecCertX509Certificate.h>
31 #include <FUiCtrlButton.h>
32 #include <FUiCtrlLabel.h>
33 #include <FUiCtrlPanel.h>
34 #include <FUiKeyEventInfo.h>
35 #include <FUiLayout.h>
36 #include <FUiVerticalBoxLayout.h>
37 #include <FIo_DatabaseImpl.h>
38 #include <FSys_SystemResource.h>
39 #include <FUi_ControlManager.h>
40 #include <FUi_ResourceManager.h>
41 #include "FWebCtrl_CertificateConfirmPopup.h"
42 #include "FWebCtrl_WebManager.h"
43 #include "FWebCtrl_Utility.h"
44 #include "FWebCtrl_WebImpl.h"
45
46
47 using namespace Tizen::Base;
48 using namespace Tizen::Base::Collection;
49 using namespace Tizen::Base::Utility;
50 using namespace Tizen::Graphics;
51 using namespace Tizen::Io;
52 using namespace Tizen::Security::Cert;
53 using namespace Tizen::System;
54 using namespace Tizen::Ui;
55 using namespace Tizen::Ui::Controls;
56
57
58 namespace Tizen { namespace Web { namespace Controls
59 {
60
61
62 static const int EDIT_TEXT_SIZE = 30;
63
64
65 _CertificateConfirmPopup::_CertificateConfirmPopup(void)
66                                                 : __certPopupMode(CERTIFICATE_POPUP_MODE_USER_CONFIRM)
67                                                 , __confirm(false)
68                                                 , __pCertificatePolicyData(null)
69                                                 , __pParent(null)
70                                                 , __pCertificatePopup(null)
71                                                 , __reaction(false)
72 {
73 }
74
75
76 _CertificateConfirmPopup::~_CertificateConfirmPopup(void)
77 {
78         if (IsModalPopup() == true)
79         {
80                 HandleUserAction(false);
81         }
82         if (__pCertificatePopup.get())
83         {
84                 __pCertificatePopup.reset();
85         }
86 }
87
88
89 result
90 _CertificateConfirmPopup::Construct(_CertificatePopupMode certPopupMode, Ewk_Certificate_Policy_Decision* pPolicy, Tizen::Web::Controls::_CertificateConfirmPopup* pParent)
91 {
92         SysTryReturnResult(NID_WEB_CTRL, pPolicy, E_INVALID_ARG, "Certificate Policy pointer is null.");
93         result r = E_SUCCESS;
94
95         _SystemResource* pSysResource = _SystemResource::GetInstance();
96         SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
97
98         _WebPopupData* pPopupData = _WebPopup::GetPopupData();
99         SysTryReturn(NID_WEB_CTRL, pPopupData, r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
100
101         __pCertificatePolicyData = pPolicy;
102         __certPopupMode = certPopupMode;
103         String titleText = L"";
104         int popupMaxHeight = 0;
105         Rectangle rect(0, 0, 0, 0);
106
107         __pParent = pParent;
108
109         ArrayList idList(SingleObjectDeleter);
110         r = idList.Construct();
111         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
112
113         ArrayList titleList(SingleObjectDeleter);
114         r = titleList.Construct();
115         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
116
117         if( __certPopupMode == CERTIFICATE_POPUP_MODE_VIEW )
118         {
119                 titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_CERTIFICATE_ABB");
120                 popupMaxHeight = 4*pPopupData->labelDim.height + pPopupData->panelHeight;
121
122                 rect.height = 4*pPopupData->labelDim.height;
123                 rect.width = pPopupData->labelDim.width;
124
125                 idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_CLOSE)));
126                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_OK"))));
127         }
128         else    // CERTIFICATE_POPUP_MODE_CONFIRM
129         {
130                 titleText = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_HEADER_SECURITY_WARNING_ABB");
131                 popupMaxHeight = 2*pPopupData->labelDim.height + pPopupData->panelHeight;
132
133                 rect.height = 2*pPopupData->labelDim.height;
134                 rect.width = pPopupData->labelDim.width;
135
136                 idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_CANCEL)));
137                 idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_VIEW)));
138                 idList.Add(*(new Integer(ID_BUTTON_CERTIFICATE_ALLOW)));
139
140                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CANCEL_ABB"))));
141                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON2_VIEW_CERTIFICATE"))));
142                 titleList.Add(*(new String(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BUTTON_CONTINUE_ABB"))));
143         }
144
145         r = _WebPopup::Construct(true, Dimension(pPopupData->popupDim.width, popupMaxHeight));
146         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
147
148         SetTitleText(titleText);
149
150         std::unique_ptr<VerticalBoxLayout> pLayout(dynamic_cast< VerticalBoxLayout* >(GetLayoutN()));
151         SysTryReturn(NID_WEB_CTRL, pLayout.get(), r = GetLastResult(), r, "[%s] Propagating.", GetErrorMessage(r));
152
153         if( certPopupMode == CERTIFICATE_POPUP_MODE_VIEW )
154         {
155                 String certString;
156                 result r = GenerateCertifiate(certString);
157                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
158
159                 std::unique_ptr<TextBox> pTextBox(new (std::nothrow) TextBox());
160                 SysTryReturnResult(NID_WEB_CTRL, pTextBox.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
161
162                 r = pTextBox->Construct(rect, TEXT_BOX_BORDER_ROUNDED);
163                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
164
165                 r = pTextBox->SetTextSize(EDIT_TEXT_SIZE);
166                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
167
168                 r = pTextBox->SetAutoLinkMask(LINK_TYPE_NONE);
169                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
170
171                 r = pTextBox->SetText(certString);
172                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
173
174                 r = AddControl(*pTextBox);
175                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
176
177                 TextBox* pCertBox = pTextBox.release();
178                 pLayout->SetHorizontalAlignment(*pCertBox, LAYOUT_HORIZONTAL_ALIGN_CENTER);
179         }
180         else    // CERTIFICATE_POPUP_MODE_CONFIRM
181         {
182                 std::unique_ptr<Label> pLabel(new (std::nothrow) Label());
183                 SysTryReturnResult(NID_WEB_CTRL, pLabel.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
184
185                 String message = L"";
186                 message = pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_THERE_ARE_PROBLEMS_WITH_THE_SECURITY_CERTIFICATE_FOR_THIS_SITE_C");
187                 message.Append(L"\n");
188                 message.Append(ewk_certificate_policy_decision_url_get(__pCertificatePolicyData));
189
190                 r = pLabel->Construct(rect, message);
191                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
192
193                 pLabel->SetTextConfig(pPopupData->labelFontSize, LABEL_TEXT_STYLE_NORMAL);
194
195                 r = AddControl(*pLabel);
196                 SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
197
198                 Label* pInfoLabel = pLabel.release();
199                 pLayout->SetHorizontalFitPolicy(*pInfoLabel, FIT_POLICY_PARENT);
200         }
201         Panel* pButtonPanel = CreateAndAddPanel();
202         SysTryReturn(NID_WEB_CTRL, pButtonPanel, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
203
204         r = CreateAndAddButtons(idList, titleList, pButtonPanel);
205         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
206
207         SetPropagatedKeyEventListener(this);
208
209         return E_SUCCESS;
210 }
211
212
213 void
214 _CertificateConfirmPopup::OnActionPerformed(const Control& source, int actionId)
215 {
216         result r = E_SUCCESS;
217
218         switch (actionId)
219         {
220         case ID_BUTTON_CERTIFICATE_ALLOW:
221         {
222                 if (__reaction)
223                 {
224                         return;
225                 }
226
227                 HandleUserAction(true);
228                 break;
229         }
230
231         case ID_BUTTON_CERTIFICATE_VIEW:
232         {
233                 if (__reaction)
234                 {
235                         return;
236                 }
237
238                 __reaction = true;
239                 std::unique_ptr<_CertificateConfirmPopup> pCertificatePopup(new (std::nothrow) _CertificateConfirmPopup());
240                 SysTryReturnVoidResult(NID_WEB_CTRL, pCertificatePopup.get(), E_OUT_OF_MEMORY, "Memory Allocation failed.");
241
242                 r = pCertificatePopup->Construct(CERTIFICATE_POPUP_MODE_VIEW, __pCertificatePolicyData, this);
243                 SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
244
245                 __pCertificatePopup = std::move(pCertificatePopup);
246
247                 r = __pCertificatePopup->ShowPopup();
248                 SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
249                 return;
250         }
251
252         case ID_BUTTON_CERTIFICATE_CANCEL:
253         {
254                 if (__reaction)
255                 {
256                         return;
257                 }
258
259                 HandleUserAction(false);
260                 break;
261         }
262
263         case ID_BUTTON_CERTIFICATE_CLOSE:
264         {
265                 if (__reaction)
266                 {
267                         return;
268                 }
269
270                 break;
271         }
272
273         default:
274                 SysAssert(false);
275                 break;
276         }
277
278         r = HidePopup();
279         if (IsFailed(r))
280         {
281                 SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
282         }
283         if (__certPopupMode == CERTIFICATE_POPUP_MODE_VIEW)
284         {
285                 __pParent->SendUserEvent(ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, null);
286         }
287 }
288
289
290 void
291 _CertificateConfirmPopup::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
292 {
293         switch (requestId)
294         {
295         case ID_CERTIFICATE_CONFIRM_POPUP_CLOSE:
296         {
297                 __pCertificatePopup.reset();
298
299                 if (__reaction)
300                 {
301                         __reaction = false;
302                 }
303
304                 break;
305         }
306         default:
307                 break;
308         }
309
310 }
311
312
313 bool
314 _CertificateConfirmPopup::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
315 {
316         return false;
317 }
318
319 bool
320 _CertificateConfirmPopup::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
321 {
322         result r = E_SUCCESS;
323         if ((keyEventInfo.GetKeyCode() == KEY_ESC || keyEventInfo.GetKeyCode() == KEY_BACK) && source.GetShowState() == true)
324         {
325                 if (__certPopupMode == CERTIFICATE_POPUP_MODE_USER_CONFIRM)
326                 {
327                         HandleUserAction(false);
328                 }
329                 r = HidePopup();
330                 if (IsFailed(r))
331                 {
332                         SysLogException(NID_WEB_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
333                 }
334                 if (__certPopupMode == CERTIFICATE_POPUP_MODE_VIEW)
335                 {
336                         __pParent->SendUserEvent(ID_CERTIFICATE_CONFIRM_POPUP_CLOSE, null);
337                 }
338         }
339
340         return false;
341 }
342
343 bool
344 _CertificateConfirmPopup::OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
345 {
346         return false;
347 }
348
349 bool
350 _CertificateConfirmPopup::OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
351 {
352         return false;
353 }
354
355 bool
356 _CertificateConfirmPopup::TranslateKeyEventInfo(Control& source, KeyEventInfo& keyEventInfo)
357 {
358         return false;
359 }
360
361 bool
362 _CertificateConfirmPopup::GetConfirmResult() const
363 {
364         return __confirm;
365 }
366
367
368 void
369 _CertificateConfirmPopup::HandleUserAction(bool allow)
370 {
371         __confirm = allow;
372
373         String pem(ewk_certificate_policy_decision_certificate_pem_get(__pCertificatePolicyData));
374         ewk_certificate_policy_decision_allowed_set(__pCertificatePolicyData, static_cast< Eina_Bool >(allow));
375         AddCertificateDb(pem, allow);
376 }
377
378
379 void
380 _CertificateConfirmPopup::AddCertificateDb(const String& pem, bool allow)
381 {
382         _DatabaseImpl db;
383         String certificatePath(Tizen::App::App::GetInstance()->GetAppRootPath() + CUSTOM_DB_DIRECTORY_PATH + USER_CONFIRM_DB_NAME);
384         String table(CERTIFICATE_TABLE_NAME);
385
386         result r = db.Construct(certificatePath, "r+", null);
387         SysTryReturnVoidResult(NID_WEB_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
388
389         std::unique_ptr<DbStatement> pStmt(db.CreateStatementN(L"Insert Into " + table + L" (pem, allow) Values (?, ?)"));
390         SysTryReturnVoidResult(NID_WEB_CTRL, pStmt.get(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
391
392         SysLog(NID_WEB_CTRL, "The current value of pem is %ls, allow is %d", pem.GetPointer(), allow);
393
394         pStmt->BindString(0, pem);
395         pStmt->BindInt(1, static_cast < int >(allow));
396
397         db.BeginTransaction();
398
399         std::unique_ptr<DbEnumerator> pEnum(db.ExecuteStatementN(*pStmt));
400
401         db.CommitTransaction();
402 }
403
404
405 result
406 _CertificateConfirmPopup::GenerateCertifiate(String& certString)
407 {
408         SysTryReturnResult(NID_WEB_CTRL, __pCertificatePolicyData, E_INVALID_ARG, "Certificate Policy pointer is null.");
409
410         _SystemResource* pSysResource = _SystemResource::GetInstance();
411         SysAssertf(pSysResource != null, "Failed to get _SystemResource instance");
412
413         String pemString(ewk_certificate_policy_decision_certificate_pem_get(__pCertificatePolicyData));
414         std::unique_ptr<ByteBuffer> pByteBuf(StringUtil::StringToUtf8N(pemString));
415         SysTryReturnResult(NID_WEB_CTRL, pByteBuf.get(), E_INVALID_DATA, "Certificate pem information is Empty.");
416
417         X509Certificate certificate;
418         result r = certificate.Construct(*pByteBuf);
419         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
420
421         //Issued to
422         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ISSUED_TO_C"));
423         certString.Append(L"\n\n");
424         String subject = certificate.GetSubject();
425
426         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_COMMON_NAME_C"));
427         certString.Append(L"\n");
428         certString.Append(GetStringOfToken(subject, L"/CN=") + L"\n");
429
430         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ORGANISATION_C"));
431         certString.Append(L"\n");
432         certString.Append(GetStringOfToken(subject, L"/O=") + L"\n");
433
434         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP ,"IDS_TPLATFORM_BODY_ORGANISATIONAL_UNIT_C"));
435         certString.Append(L"\n");
436         certString.Append(GetStringOfToken(subject, L"/OU=") + L"\n");
437
438         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_SERIAL_NUMBER_C"));
439         certString.Append(L"\n");
440         certString.Append(certificate.GetSerialNumber() + L"\n\n\n");
441
442         //Issued by
443         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ISSUED_BY_C"));
444         certString.Append(L"\n\n");
445         String issuer = certificate.GetIssuer();
446
447         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_COMMON_NAME_C"));
448         certString.Append(L"\n");
449         certString.Append(GetStringOfToken(issuer, L"/CN=") + L"\n");
450
451         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ORGANISATION_C"));
452         certString.Append(L"\n");
453         certString.Append(GetStringOfToken(issuer, L"/O=") + L"\n");
454
455         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_ORGANISATIONAL_UNIT_C"));
456         certString.Append(L"\n");
457         certString.Append(GetStringOfToken(issuer, L"/OU=") + L"\n\n");
458
459         //Validity
460         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_VALIDITY_C"));
461         certString.Append(L"\n\n");
462         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_POP_CERTI_VALID_FROM_C"));
463         certString.Append(L"\n");
464         certString.Append(certificate.GetNotBefore() + L"\n\n");
465
466         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_CERTIFICATE_VALID_TILL"));
467         certString.Append(L":\n");
468         certString.Append(certificate.GetNotAfter() + L"\n\n\n");
469
470         //FingerPrints
471         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_TPLATFORM_BODY_FINGERPRINTS_C"));
472         certString.Append(L"\n\n");
473         certString.Append(pSysResource->GetString(_RESOURCE_DOMAIN_ID_OSP, "IDS_BR_BODY_SIGNATURE_ALGORITHM_VODA"));
474         certString.Append(L":\n");
475         certString.Append(certificate.GetSignatureAlgorithm() + L"\n\n");
476
477         std::unique_ptr<ByteBuffer> pFingerPrint(certificate.GetFingerprintN());
478         if (pFingerPrint.get() && pFingerPrint->GetPointer())
479         {
480                 String fingerPrint;
481                 StringUtil::Utf8ToString((const char*)pFingerPrint->GetPointer(), fingerPrint);
482                 fingerPrint.SetLength(pFingerPrint->GetLimit());
483                 certString.Append(fingerPrint + L"\n\n");
484         }
485
486         return E_SUCCESS;
487 }
488
489
490 String
491 _CertificateConfirmPopup::GetStringOfToken(const String& parseString, const String& parseToken)
492 {
493         String inString(parseString);
494         int index = 0;
495
496         String outString;
497         outString.Append(L"\n");
498
499         result r = inString.IndexOf(parseToken, 0, index);
500         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, outString, r, "[%s] Propagating.", GetErrorMessage(r));
501
502         int prsTokLen = parseToken.GetLength();
503         r = inString.Remove(0, index + prsTokLen);
504         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, outString, r, "[%s] Propagating.", GetErrorMessage(r));
505
506         while (true)
507         {
508                 r = inString.IndexOf(parseToken, 0, index);
509
510                 switch (r)
511                 {
512                 case E_SUCCESS:
513                         r = inString.Remove(index, prsTokLen);
514                         SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, outString, r, "[%s] Propagating.", GetErrorMessage(r));
515
516                         inString.Insert(L"\n", index);
517                         continue;
518
519                 case E_OBJ_NOT_FOUND:
520                         r = inString.IndexOf('=', 0, index);
521                         if (r == E_SUCCESS)
522                         {
523                                 int slashIndex = 0;
524                                 r = inString.LastIndexOf('/', index - 3, slashIndex);
525
526                                 if (!IsFailed(r) && (slashIndex == index - 2 || slashIndex == index - 3))
527                                 {
528                                         inString.Remove(slashIndex, inString.GetLength() - slashIndex);
529                                 }
530                         }
531                         inString.Append(L"\n");
532                         outString = inString;
533                         return outString;
534
535                 default:
536                         return outString;
537                 }
538         }
539 }
540
541
542 }}} // Tizen::Web::Controls