Fixed Nabi Issues and poppup alignment changes
[apps/osp/Internet.git] / src / IntSettingForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 //!Internet SettingForm class
18 /*@file:        IntSettingForm.cpp
19  *@brief:       The SettingForm
20  */
21
22 #include <FApp.h>
23 #include <FGraphics.h>
24 #include <FUi.h>
25
26 #include "IntCommonLib.h"
27 #include "IntConfirmationPopup.h"
28 #include "IntDefaultCustomItem.h"
29 #include "IntDropDownCustomItem.h"
30 #include "IntHistoryPresentationModel.h"
31 #include "IntMultipleWindowPresentationModel.h"
32 #include "IntNotificationPanel.h"
33 #include "IntRadioCustomItem.h"
34 #include "IntSceneRegister.h"
35 #include "IntSettingForm.h"
36 #include "IntSettingPresentationModel.h"
37 #include "IntSettingToggleCustomItem.h"
38
39
40 using namespace Tizen::App;
41 using namespace Tizen::Base;
42 using namespace Tizen::Base::Collection;
43 using namespace Tizen::Graphics;
44 using namespace Tizen::Ui;
45 using namespace Tizen::Ui::Controls;
46 using namespace Tizen::Ui::Scenes;
47
48
49 SettingForm::SettingForm(void)
50 : __fontValue(0),__pResetPopup(null),__pWindowInfo(null) , __pConfirmationPopup(null)
51 {
52         __currentURL = L"";
53         __pList = null;
54         InitializeSettingValues();
55 }
56
57 SettingForm::~SettingForm(void)
58 {
59         if (pGroupItemCount)
60         {
61                 delete[] pGroupItemCount;
62                 pGroupItemCount = null;
63         }
64 }
65
66 void
67 SettingForm::InitializeSettingValues(void)
68 {
69         AppLog("SettingForm::InitializeSettingValues homepage %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
70         groupCount = 5;
71         pGroupItemCount = new(std::nothrow) int[5];
72         pGroupItemCount[0] = 5;  //Homepage
73         pGroupItemCount[1] = 6;  //Page content settings
74         pGroupItemCount[2] = 5;  //Private and Security
75         pGroupItemCount[3] = 4;  //Search
76         pGroupItemCount[4] = 1;  //Website settings and Reset
77
78         for (int iter = (int) SETTING_INVALID + 1; iter < (int) SETTING_MAX; iter++)
79         {
80                 settingInfo[iter].isSelected = false;
81         }
82
83         AppLogDebug("image display %d", (int) SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled());
84         settingInfo[SETTING_HOMEPAGE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE");
85         settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
86         settingInfo[SETTING_HOMEPAGE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
87
88         settingInfo[SETTING_CURRENT_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CURRENT_PAGE");
89         settingInfo[SETTING_CURRENT_PAGE].subText = L"";
90         settingInfo[SETTING_CURRENT_PAGE].itemType = ITEM_TYPE_RADIO;
91
92         settingInfo[SETTING_BLANK_PAGE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLANK_PAGE");
93         settingInfo[SETTING_BLANK_PAGE].subText = L"";
94         settingInfo[SETTING_BLANK_PAGE].itemType = ITEM_TYPE_RADIO;
95         if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
96         {
97                 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
98         }
99
100         settingInfo[SETTING_MOST_VISITED_SITE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_MOST_VISITED_SITES");
101         settingInfo[SETTING_MOST_VISITED_SITE].subText = L"";
102         settingInfo[SETTING_MOST_VISITED_SITE].itemType = ITEM_TYPE_RADIO;
103         if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
104         {
105                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
106         }
107         WindowInfo* pWindowInfo = null;
108         String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
109         AppLog("SettingForm::OnSceneActivatedN check1");
110
111         settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
112         if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
113         {
114                 SettingPresentationModel::GetInstance()->SetFavoriteValue(L"http://www.tizen.org");
115         }
116         settingInfo[SETTING_FAVORITE_URL].subText = L"";
117         settingInfo[SETTING_FAVORITE_URL].itemType = ITEM_TYPE_RADIO;
118
119         String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
120         if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
121         {
122                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
123                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
124                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
125                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
126                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
127         }
128         else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
129         {
130                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
131                 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
132                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
133                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
134                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
135         }
136         else
137         {
138                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
139                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
140                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
141                 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
142         }
143
144         settingInfo[SETTING_DEFAULT_VIEW_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_DEFAULT_VIEW");
145         settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText = CommonUtil::GetString(SettingPresentationModel::GetInstance()->GetDefaultView());
146         settingInfo[SETTING_DEFAULT_VIEW_TITLE].itemType = ITEM_TYPE_DROPDOWN;
147
148         settingInfo[SETTING_FIT_TO_WIDTH].titleText = CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH");
149         settingInfo[SETTING_FIT_TO_WIDTH].subText = L"";
150         settingInfo[SETTING_FIT_TO_WIDTH].itemType = ITEM_TYPE_RADIO;
151         settingInfo[SETTING_FIT_TO_WIDTH].isSelected = !(String::Compare(settingInfo[SETTING_FIT_TO_WIDTH].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
152
153         settingInfo[SETTING_READABLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_READABLE");
154         settingInfo[SETTING_READABLE].subText = L"";
155         settingInfo[SETTING_READABLE].itemType = ITEM_TYPE_RADIO;
156         settingInfo[SETTING_READABLE].isSelected = !(String::Compare(settingInfo[SETTING_READABLE].titleText, settingInfo[SETTING_DEFAULT_VIEW_TITLE].subText));
157
158         settingInfo[SETTING_RUN_JAVASCRIPT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RUN_JAVASCRIPT");
159         settingInfo[SETTING_RUN_JAVASCRIPT].subText = L"";
160         settingInfo[SETTING_RUN_JAVASCRIPT].itemType = ITEM_TYPE_TOGGLE;
161         settingInfo[SETTING_RUN_JAVASCRIPT].isSelected = SettingPresentationModel::GetInstance()->IsRunJavascriptEnabled();
162
163         settingInfo[SETTING_DISPLAY_IMAGES].titleText = CommonUtil::GetString(L"IDS_BR_BODY_DISPLAY_IMAGES");
164         settingInfo[SETTING_DISPLAY_IMAGES].subText = L"";
165         settingInfo[SETTING_DISPLAY_IMAGES].itemType = ITEM_TYPE_TOGGLE;
166         settingInfo[SETTING_DISPLAY_IMAGES].isSelected = SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled();
167
168         settingInfo[SETTING_BLOCK_POPUP].titleText = CommonUtil::GetString(L"IDS_BR_BODY_BLOCK_POP_UPS_ABB");
169         settingInfo[SETTING_BLOCK_POPUP].subText = L"";
170         settingInfo[SETTING_BLOCK_POPUP].itemType = ITEM_TYPE_TOGGLE;
171         settingInfo[SETTING_BLOCK_POPUP].isSelected = !SettingPresentationModel::GetInstance()->IsBlockPopUp();
172
173         settingInfo[SETTING_CLEAR_CACHE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_CACHE");
174         settingInfo[SETTING_CLEAR_CACHE].subText = L"";
175         settingInfo[SETTING_CLEAR_CACHE].itemType = ITEM_TYPE_NORMAL;
176
177         settingInfo[SETTING_CLEAR_HISTORY].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_HISTORY");
178         settingInfo[SETTING_CLEAR_HISTORY].subText = L"";
179         settingInfo[SETTING_CLEAR_HISTORY].itemType = ITEM_TYPE_NORMAL;
180
181         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SHOW_SECURITY_WARNINGS");
182         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].subText = L"";
183         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].itemType = ITEM_TYPE_TOGGLE;
184         settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected = SettingPresentationModel::GetInstance()->IsSecurityWarningsEnabled();
185
186         settingInfo[SETTING_ACCEPT_COOKIES].titleText = CommonUtil::GetString(L"IDS_BR_BODY_ACCEPT_COOKIES");
187         settingInfo[SETTING_ACCEPT_COOKIES].subText = L"";
188         settingInfo[SETTING_ACCEPT_COOKIES].itemType = ITEM_TYPE_TOGGLE;
189         settingInfo[SETTING_ACCEPT_COOKIES].isSelected = SettingPresentationModel::GetInstance()->IsCookiesEnabled();
190
191         settingInfo[SETTING_CLEAR_COOKIE_DATA].titleText = CommonUtil::GetString(L"IDS_BR_BODY_CLEAR_ALL_COOKIE_DATA");
192         settingInfo[SETTING_CLEAR_COOKIE_DATA].subText = CommonUtil::GetString(L"IDS_BR_HEADER_COOKIES");
193         settingInfo[SETTING_CLEAR_COOKIE_DATA].itemType = ITEM_TYPE_NORMAL;
194
195         settingInfo[SETTING_SEARCH_ENGINE_TITLE].titleText = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH_ENGINE");
196         settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText = SettingPresentationModel::GetInstance()->GetSearchEngine();
197         settingInfo[SETTING_SEARCH_ENGINE_TITLE].itemType = ITEM_TYPE_DROPDOWN;
198
199         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText = CommonUtil::GetString(L"IDS_BR_BODY_YAHOO");
200         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].subText = L"";
201         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].itemType = ITEM_TYPE_RADIO;
202         settingInfo[SETTING_SEARCH_ENGINE_YAHOO].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
203
204         settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText = CommonUtil::GetString(L"IDS_BR_BODY_NAVER");
205         settingInfo[SETTING_SEARCH_ENGINE_NAVER].subText = L"";
206         settingInfo[SETTING_SEARCH_ENGINE_NAVER].itemType = ITEM_TYPE_RADIO;
207         settingInfo[SETTING_SEARCH_ENGINE_NAVER].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
208
209         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText = CommonUtil::GetString(L"IDS_COM_BODY_GOOGLE");
210         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].subText = L"";
211         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].itemType = ITEM_TYPE_RADIO;
212         settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].isSelected = !(String::Compare(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText, settingInfo[SETTING_SEARCH_ENGINE_TITLE].subText));
213
214         settingInfo[SETTING_RESET_TO_DEFAULT].titleText = CommonUtil::GetString(L"IDS_BR_BODY_RESET_TO_DEFAULT");
215         settingInfo[SETTING_RESET_TO_DEFAULT].subText = L"";
216         settingInfo[SETTING_RESET_TO_DEFAULT].itemType = ITEM_TYPE_NORMAL;
217 }
218
219 bool
220 SettingForm::Initialize(void)
221 {
222         result r = E_FAILURE;
223
224         r = Construct(L"IDL_SETTING_FORM");
225         if (IsFailed(r))
226         {
227                 return false;
228         }
229         return true;
230 }
231
232 result
233 SettingForm::OnInitializing(void)
234 {
235         result r = E_FAILURE;
236         Footer* pFooter = NULL;
237         SceneManager* pSceneManager = NULL;
238
239         __pList = static_cast< GroupedListView* >(GetControl(L"IDC_SETTING_LIST"));
240         if ( __pList != NULL )
241         {
242
243                 r = __pList->SetItemProvider(*this);
244                 TryCatch(!IsFailed(r),,"setItemProvider failed with error %s",GetErrorMessage(r));
245                 __pList->AddGroupedListViewItemEventListener(*this);
246         }
247
248         pFooter = GetFooter();
249         if (pFooter)
250         {
251                 AppLogDebug("setting back button");
252                 pFooter->SetBackButtonEnabled(true);
253                 SetFormBackEventListener(this);
254         }
255         pSceneManager = SceneManager::GetInstance();
256         if (pSceneManager != null)
257         {
258                 r = pSceneManager->AddSceneEventListener(IDSCN_SETTINGS, *this);
259                 TryCatch(!IsFailed(r),,"AddSceneEventListener failed with error %s",GetErrorMessage(r));
260         }
261         AddOrientationEventListener(*this);
262
263         CATCH:
264         return r;
265 }
266
267 void
268 SettingForm::OnGroupedListViewContextItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListContextItemStatus status)
269 {
270
271 }
272
273 void
274 SettingForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListItemStatus status)
275 {
276         int effectiveIndex = 0;
277         SettingPresentationModel* pSettingMgr = SettingPresentationModel::GetInstance();
278
279         if (pSettingMgr == null)
280                 return;
281
282         for (int i = 0; i < groupIndex; i++)
283                 effectiveIndex = effectiveIndex + pGroupItemCount[i];
284         effectiveIndex = effectiveIndex + itemIndex;
285
286         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
287         {
288                 AppLogDebug("refreshing data child count is %d", settingInfo[effectiveIndex].childCount);
289                 if (settingInfo[effectiveIndex].isOpen == false)
290                 {
291                         settingInfo[effectiveIndex].isOpen = true;
292                         settingInfo[effectiveIndex].childCount = 0;
293                         for (int iter = effectiveIndex + 1; iter < SETTING_MAX; iter++)
294                         {
295                                 if (settingInfo[iter].itemType == ITEM_TYPE_RADIO)
296                                         settingInfo[effectiveIndex].childCount++;
297                                 else
298                                         break;
299                         }
300                         listView.UpdateList();
301                 }
302                 else
303                 {
304                         settingInfo[effectiveIndex].isOpen = false;
305                         listView.UpdateList();
306                 }
307         }
308         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
309         {
310                 int parentIndex = 0;
311                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
312                 {
313                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
314                                 break;
315                 }
316                 settingInfo[parentIndex].subText = settingInfo[effectiveIndex].titleText;
317
318                 for (int iter = 0; iter < settingInfo[parentIndex].childCount; iter++)
319                 {
320                         if (parentIndex + iter + 1 != effectiveIndex)
321                         {
322                                 AppLogDebug("long effectiveIndex %d set to false", itemIndex - (effectiveIndex - parentIndex) + iter + 1);
323                                 settingInfo[parentIndex + iter + 1].isSelected = false;
324                         }
325                         else
326                         {
327                                 AppLogDebug("effectiveIndex %d set to true", effectiveIndex);
328                                 settingInfo[effectiveIndex].isSelected = true;
329                         }
330                         if (effectiveIndex == SETTING_CURRENT_PAGE)
331                         {
332                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
333                                 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
334                         }
335                         //listView.RefreshList(groupIndex, itemIndex - (effectiveIndex - parentIndex) + iter + 1, LIST_REFRESH_TYPE_ITEM_MODIFY);
336                 }
337 //              listView.UpdateList();
338                 //listView.ScrollToItem(groupIndex, itemIndex, LIST_SCROLL_ITEM_ALIGNMENT_TOP);
339                 Invalidate(true);
340         }
341         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
342         {
343                 if (settingInfo[effectiveIndex].isSelected == true)
344                 {
345                         settingInfo[effectiveIndex].isSelected = false;
346                 }
347                 else
348                 {
349                         settingInfo[effectiveIndex].isSelected = true;
350                 }
351 //              listView.RefreshList(groupIndex, itemIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
352                 if(__pList != null)
353                 {
354                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
355                 }
356         }
357
358         switch (effectiveIndex)
359         {
360         case SETTING_CURRENT_PAGE:
361                 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
362                 AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
363                 if (__currentURL.CompareTo(L"") != 0)
364                 {
365                         AppLog("setting current page currentURL is =%ls",__currentURL.GetPointer());
366                         SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
367                         SettingPresentationModel::GetInstance()->SetFavoriteValue(__currentURL);
368                         settingInfo[SETTING_FAVORITE_URL].titleText = __currentURL;
369 //                      listView.RefreshList(groupIndex, effectiveIndex, LIST_REFRESH_TYPE_ITEM_MODIFY);
370                         listView.UpdateList();
371                 }
372                 break;
373         case SETTING_BLANK_PAGE:
374                 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_BLANK_PAGE].titleText);
375                 SettingPresentationModel::GetInstance()->SetHomepage((L"IDS_BR_BODY_BLANK_PAGE"));
376                 AppLog("GetHomepage() %ls",SettingPresentationModel::GetInstance()->GetHomepage().GetPointer());
377                 listView.UpdateList();
378
379                 break;
380         case SETTING_MOST_VISITED_SITE:
381                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
382                 listView.UpdateList();
383                 break;
384
385         case SETTING_FAVORITE_URL:
386                 //SettingPresentationModel::GetInstance()->SetHomepage(settingInfo[SETTING_FAVORITE_URL].titleText);
387                 SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EDIT_HOMEPAGE_VIEW, SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
388                 break;
389
390         case SETTING_FIT_TO_WIDTH:
391                 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_FIT_TO_WIDTH");
392                 listView.UpdateList();
393                 break;
394
395         case SETTING_READABLE:
396                 SettingPresentationModel::GetInstance()->SetDefaultView(L"IDS_BR_BODY_READABLE");
397                 listView.UpdateList();
398                 break;
399
400         case SETTING_RUN_JAVASCRIPT:
401                 SettingPresentationModel::GetInstance()->SetRunJavascriptEnabled(settingInfo[SETTING_RUN_JAVASCRIPT].isSelected);
402                 break;
403
404         case SETTING_DISPLAY_IMAGES:
405                 SettingPresentationModel::GetInstance()->SetDisplayImagesEnabled(settingInfo[SETTING_DISPLAY_IMAGES].isSelected);
406                 break;
407
408         case SETTING_BLOCK_POPUP:
409                 SettingPresentationModel::GetInstance()->SetBlockPopUp(!settingInfo[SETTING_BLOCK_POPUP].isSelected);
410                 break;
411
412         case SETTING_CLEAR_CACHE:
413                 ClearCache();
414                 break;
415
416         case SETTING_CLEAR_HISTORY:
417                 ClearHistory();
418                 break;
419
420         case SETTING_SHOW_SECURITY_WARNINGS:
421                 SettingPresentationModel::GetInstance()->SetSecurityWarningsEnabled(settingInfo[SETTING_SHOW_SECURITY_WARNINGS].isSelected);
422                 break;
423
424         case SETTING_ACCEPT_COOKIES:
425                 SettingPresentationModel::GetInstance()->SetCookiesEnabled(settingInfo[SETTING_ACCEPT_COOKIES].isSelected);
426                 break;
427
428         case SETTING_CLEAR_COOKIE_DATA:
429                 ClearCookie();
430                 break;
431
432         case SETTING_SEARCH_ENGINE_YAHOO:
433                 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_YAHOO].titleText);
434                 listView.UpdateList();
435                 break;
436
437         case SETTING_SEARCH_ENGINE_NAVER:
438                 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_NAVER].titleText);
439                 listView.UpdateList();
440                 break;
441
442         case SETTING_SEARCH_ENGINE_GOOGLE:
443                 SettingPresentationModel::GetInstance()->SetSearchEngine(settingInfo[SETTING_SEARCH_ENGINE_GOOGLE].titleText);
444                 listView.UpdateList();
445                 break;
446
447         case SETTING_RESET_TO_DEFAULT:
448                 //OpenResetPopup();
449                 ResetToDefault();
450                 break;
451
452         default:
453                 break;
454         }
455 }
456
457 void
458 SettingForm::OnGroupedListViewItemSwept(GroupedListView& listView, int groupIndex, int itemIndex, SweepDirection direction)
459 {
460
461 }
462
463 GroupItem*
464 SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
465 {
466         result r = E_FAILURE;
467         String text(L"");
468         GroupItem* pItem = null;
469         const Color ITEM_TEXT_COLOR = CUSTOM_COLOR_SETTINGS_GROUPTITLE;
470
471         pItem = new(std::nothrow) GroupItem();
472         if (pItem == null)
473         {
474                 return null;
475         }
476         r = pItem->Construct(Dimension(itemWidth, 46));
477         if (IsFailed(r))
478         {
479                 delete pItem;
480                 return null;
481         }
482
483         switch (groupIndex)
484         {
485         case 0:
486                 text = CommonUtil::GetString(L"IDS_BR_BODY_HOMEPAGE"); // IDS_HOMEPAGE
487                 settingInfo[SETTING_HOMEPAGE_TITLE].subText = SettingPresentationModel::GetInstance()->GetHomepage();
488                 break;
489
490         case 1:
491                 text = CommonUtil::GetString(L"IDS_BR_MBODY_PAGE_CONTENT_SETTINGS"); // IDS_BR_MBODY_PAGE_CONTENT_SETTINGS
492                 break;
493
494         case 2:
495                 text = CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB");  // IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB
496                 break;
497
498         case 3:
499                 text = CommonUtil::GetString(L"IDS_BR_BODY_SEARCH");    // IDS_BR_BODY_SEARCH
500                 break;
501
502         case 4:
503                 text = L"";
504                 break;
505
506         default:
507                 break;
508         }
509
510         pItem->SetElement(text, null);
511
512         AppLogDebug("background color set result %s", GetErrorMessage(r));
513
514         pItem->SetTextColor(ITEM_TEXT_COLOR);
515         return pItem;
516 }
517
518 ListItemBase*
519 SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
520 {
521         AppLog("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d ", groupIndex, itemIndex, itemWidth);
522
523         result r = E_SUCCESS;
524         int effectiveIndex = 0;
525         const Color ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND;
526         const Color ITEM_RADIO_ITEM_BACKGROUND_COLOR = CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND;
527         const Color ITEM_BACKGROUND_COLOR_HIGHLIGHTED = CUSTOM_BACKGROUND_COLOR_LISTVIEW_PRESSED_HIGHLIGHTED;
528
529         for (int i = 0; i < groupIndex; i++)
530                 effectiveIndex = effectiveIndex + pGroupItemCount[i];
531         effectiveIndex = effectiveIndex + itemIndex;
532         AppLogDebug("SettingForm::CreateItem --> groupIndex : %d, itemIndex: %d itemWidth: %d effectiveIndex %d", groupIndex, itemIndex, itemWidth, effectiveIndex);
533
534         if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
535         {
536                 SettingToggleCustomItem* pItem = new(std::nothrow) SettingToggleCustomItem();
537                 r = pItem->Construct(itemWidth, 112);
538                 if (IsFailed(r))
539                 {
540                         delete pItem;
541                         return null;
542                 }
543
544                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
545                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
546                 if(__pList != null)
547                 {
548                         __pList->SetItemChecked(groupIndex, itemIndex, settingInfo[effectiveIndex].isSelected);
549                 }
550
551                 pItem->SetText(settingInfo[effectiveIndex].titleText);
552                 pItem->Make();
553
554                 return pItem;
555
556         }
557         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_DROPDOWN)
558         {
559                 DropDownCustomItem* pItem = new(std::nothrow) DropDownCustomItem();
560                 r = pItem->Construct(itemWidth);
561                 if (IsFailed(r))
562                 {
563                         delete pItem;
564                         return null;
565                 }
566
567 /*              Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,128);
568                 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
569
570                 if (pNormalBackgroundBitmap != NULL)
571                 {
572                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
573                         delete pNormalBackgroundBitmap;
574                 }
575
576                 if (pPressedBackgroundBitmap != NULL)
577                 {
578                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
579                         delete pPressedBackgroundBitmap;
580                 }*/
581
582                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
583                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
584
585                 pItem->SetMainText(settingInfo[effectiveIndex].titleText);
586                 if(settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_BLANK_PAGE") == 0 || settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_MOST_VISITED_SITES") == 0  || settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_FIT_TO_WIDTH") == 0 || settingInfo[effectiveIndex].subText.CompareTo(L"IDS_BR_BODY_READABLE") == 0)
587                 {
588                         pItem->SetSubText(CommonUtil::GetString(settingInfo[effectiveIndex].subText));
589                 }
590                 else
591                 {
592                         pItem->SetSubText(settingInfo[effectiveIndex].subText);
593                 }
594                 if (settingInfo[effectiveIndex].isOpen)
595                 {
596                         pItem->SetCurState(DROP_DOWN_ITEM_STATE_OPENED);
597                 }
598                 else
599                 {
600                         pItem->SetCurState(DROP_DOWN__ITEM_STATE_CLOSED);
601                 }
602                 r = pItem->Make();
603                 //      if (pBitmap != null)
604                 //              pItem->AddElement(Rectangle(0, 0, 10, 128), IDA_LIST_LEFT_SIDE_MARGIN_DROPDOWN, *pBitmap, null);
605
606                 if (IsFailed(r))
607                 {
608                         delete pItem;
609                         return null;
610                 }
611
612                 return pItem;
613         }
614         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
615         {
616
617
618                 RadioCustomItem* pItem = new(std::nothrow) RadioCustomItem();
619                 int parentIndex = 0;
620                 for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
621                 {
622                         if (settingInfo[parentIndex].itemType == ITEM_TYPE_DROPDOWN)
623                                 break;
624                 }
625                 if (settingInfo[parentIndex].isOpen == false || (__isCurrentPageDisable == true && groupIndex == 0 && itemIndex == 1))
626                 {
627                         r = pItem->Construct(itemWidth, 0);
628                         AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
629                         return pItem;
630                 }
631                 else
632                 {
633                         pItem->Construct(itemWidth, 112);
634                 }
635 /*
636                 Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
637                 Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
638
639                 if (pNormalBackgroundBitmap != NULL)
640                 {
641                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
642                         delete pNormalBackgroundBitmap;
643                 }
644
645                 if (pPressedBackgroundBitmap != NULL)
646                 {
647                         pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
648                         delete pPressedBackgroundBitmap;
649                 }*/
650
651                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_RADIO_ITEM_BACKGROUND_COLOR);
652                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
653
654
655                 pItem->SetText(settingInfo[effectiveIndex].titleText);
656                 AppLogDebug("effectiveIndex %d SettingInfo[effectiveIndex].isSelected %d", effectiveIndex, settingInfo[effectiveIndex].isSelected);
657
658                 //if (pBitmap != null)
659                 //      pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
660
661                 pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
662                 pItem->Make();
663
664                 return pItem;
665         }
666         else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_NORMAL)
667         {
668                 DefaultCustomItem* pItem = new(std::nothrow) DefaultCustomItem();
669
670                 r = pItem->Construct(itemWidth, 112);
671                 if (IsFailed(r))
672                 {
673                         delete pItem;
674                         return null;
675                 }
676
677
678 //              Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
679 //              Bitmap* pPressedBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG_PRESS9,itemWidth,112);
680 //
681 //              if (pNormalBackgroundBitmap != NULL)
682 //              {
683 //                      pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_NORMAL,pNormalBackgroundBitmap);
684 //                      delete pNormalBackgroundBitmap;
685 //              }
686 //
687 //              if (pPressedBackgroundBitmap != NULL)
688 //              {
689 //                      pItem->SetBackgroundBitmap(LIST_ITEM_DRAWING_STATUS_PRESSED,pPressedBackgroundBitmap);
690 //                      delete pPressedBackgroundBitmap;
691 //              }
692
693                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
694                 pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
695
696                 pItem->SetText(settingInfo[effectiveIndex].titleText);
697
698                 //if (pBitmap != null)
699                 //      pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
700
701                 r = pItem->Make();
702                 if (IsFailed(r))
703                 {
704                         delete pItem;
705                         return null;
706                 }
707                 return pItem;
708         }
709         else
710         {
711                 return null;
712         }
713 }
714
715 bool
716 SettingForm::DeleteGroupItem(int groupIndex, GroupItem* pItem, int itemWidth)
717 {
718         delete pItem;
719         pItem = null;
720         return true;
721 }
722
723 bool
724 SettingForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem, int itemWidth)
725 {
726         delete pItem;
727         pItem = null;
728         return true;
729 }
730
731 int
732 SettingForm::GetGroupCount(void)
733 {
734         return groupCount;
735 }
736
737 int
738 SettingForm::GetItemCount(int groupIndex)
739 {
740         AppLog(" SettingForm::GetItemCount --> groupIndex : %d,", groupIndex);
741         return pGroupItemCount[groupIndex];
742 }
743
744 void
745 SettingForm::OnFormBackRequested(Form& source)
746 {
747         String* pSelectedScene = NULL;
748         Object* value = NULL;
749         MultipleWindowPresentationModel::GetInstance()->GetValue(SELECTED_SCENE_ID, &value);
750         pSelectedScene = (String*) value;
751         if (pSelectedScene)
752         {
753                 SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(*pSelectedScene, SCENE_TRANSITION_ANIMATION_TYPE_NONE));
754 //              delete pSelectedScene;
755 //              pSelectedScene = null;
756         }
757 }
758
759 void
760 SettingForm::OnActionPerformed(const Control& source, int actionId)
761 {
762         switch (actionId)
763         {
764         case IDA_BUTTON_NO:
765                 if(__pConfirmationPopup)
766                 {
767                         __pConfirmationPopup->SetShowState(false);
768                         __pConfirmationPopup->Show();
769                         delete __pConfirmationPopup;
770                         __pConfirmationPopup = null;
771                 }
772                 break;
773
774         case IDA_BUTTON_YES:
775                 if(__pConfirmationPopup)
776                 {
777                         String message = L"";
778                         __pConfirmationPopup->SetShowState(false);
779                         __pConfirmationPopup->Show();
780                         if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO"))
781                         {
782                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
783                                 SettingPresentationModel::GetInstance()->ClearCookie();
784                         }
785                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q"))
786                         {
787                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
788                                 SettingPresentationModel::GetInstance()->ClearCache();
789                         }
790                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q"))
791                         {
792                                 message = CommonUtil::GetString(L"IDS_BR_POP_DELETED");
793                                 HistoryPresentationModel::GetInstance()->ClearHistory();
794                         }
795                         else if (__pConfirmationPopup->GetMessage() == CommonUtil::GetString(L"IDS_BR_POP_RESET_ALL_SETTINGS_TO_DEFAULT_Q"))
796                         {
797                                 message = CommonUtil::GetString(L"IDS_BR_SK_DONE");
798                                 SettingPresentationModel::GetInstance()->ResetRegistry();
799                                 InitializeSettingValues();
800                                 if(__pList != null)
801                                 {
802                                         __pList->UpdateList();
803                                 }
804                         }
805                         delete __pConfirmationPopup;
806                         __pConfirmationPopup = null;
807
808                         NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
809                         pNotification->SetText(message);
810                         pNotification->SetPositionDiff(0);
811                         pNotification->ShowNotification();
812                 }
813                 break;
814
815         default:
816                 break;
817         }
818 }
819
820 void
821 SettingForm::OnOrientationChanged(const Control& source, OrientationStatus orientationStatus)
822 {
823         Rectangle rect = GetClientAreaBounds();
824         if(__pList == null)
825         {
826                 return;
827         }
828         __pList->SetBounds(rect.x,rect.y,rect.width-16,rect.height);
829         __pList->UpdateList();
830 }
831
832 SettingForm::SettingItemInfo::SettingItemInfo(void)
833 {
834         titleText = L"";
835         subText = L"";
836         childCount = 0;
837         isOpen = false;
838         isSelected = false ;
839 }
840 void
841 SettingForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
842 {
843         WindowInfo* pWindowInfo = null;
844         String curUrl = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
845
846         pWindowInfo = MultipleWindowPresentationModel::GetInstance()->GetActiveWindowInfo();
847
848         if (previousSceneId == IDSCN_EDIT_HOMEPAGE_VIEW)
849         {
850                 if (pArgs != null)
851                 {
852                         String* pValue = NULL;
853                         pValue = dynamic_cast<String*>(pArgs->GetAt(0));
854                         if( pValue != NULL )
855                         {
856                                 if (pValue->CompareTo(L"Done") == 0)
857                                 {
858                                 //      SettingPresentationModel::GetInstance()->SetHomepage(CommonUtil::GetString(L"IDS_BR_BODY_USER_HOMEPAGE"));
859                                 }
860                                 else if (pValue->CompareTo(L"Cancel") == 0)
861                                 {
862                                         String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
863                                         if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
864                                         {
865                                                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = true;
866                                                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
867                                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
868                                                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
869                                                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_MOST_VISITED_SITES");
870
871                                         }
872                                         else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
873                                         {
874                                                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
875                                                 settingInfo[SETTING_BLANK_PAGE].isSelected = true;
876                                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
877                                                 settingInfo[SETTING_FAVORITE_URL].isSelected = false;
878                                                 SettingPresentationModel::GetInstance()->SetHomepage(L"IDS_BR_BODY_BLANK_PAGE");
879                                         }
880                                         else
881                                         {
882                                                 settingInfo[SETTING_MOST_VISITED_SITE].isSelected = false;
883                                                 settingInfo[SETTING_BLANK_PAGE].isSelected = false;
884                                                 settingInfo[SETTING_CURRENT_PAGE].isSelected = false;
885                                                 settingInfo[SETTING_FAVORITE_URL].isSelected = true;
886                                         }
887
888                                 }
889                         }
890                 }
891         }
892
893         if (pWindowInfo != null)
894         {
895                 __currentURL.Clear();
896                 __currentURL.Append(pWindowInfo->pageUrl);
897                 AppLog("current url is %ls",__currentURL.GetPointer());
898
899                 if (SettingPresentationModel::GetInstance()->GetFavoriteUrl().CompareTo(L"") == 0)
900                 {
901                         if (pWindowInfo->pageUrl.CompareTo(L"") == 0)
902                         {
903                                 //settingInfo[SETTING_FAVORITE_URL].titleText = CommonUtil::GetString(L"IDS_SET_HOMEPAGE");
904                                 settingInfo[SETTING_FAVORITE_URL].titleText = L"http://www.tizen.org";
905                         }
906                         else
907                         {
908                                 settingInfo[SETTING_FAVORITE_URL].titleText = pWindowInfo->pageUrl;
909                         }
910                 }
911                 else
912                 {
913                         settingInfo[SETTING_FAVORITE_URL].titleText = SettingPresentationModel::GetInstance()->GetFavoriteUrl();
914                 }
915         }
916
917         if (__pList != null)
918         {
919                 __pList->UpdateList();
920                 if (pWindowInfo && pWindowInfo->pageUrl.CompareTo(L"") == 0)
921                 {
922                         __isCurrentPageDisable = true;
923                         AppLog("set item enabled is false");
924                         __pList->SetItemEnabled(0, 1, false);
925                 }
926                 else
927                 {
928                         __isCurrentPageDisable = false;
929                         AppLog("set item enabled is true");
930                         __pList->SetItemEnabled(0, 1, true);
931                 }
932                 for(int grpindex = 0; grpindex < groupCount; grpindex++)
933                 {
934                         for(int index = 0; index < *(pGroupItemCount+groupCount); index++)
935                         {
936                                 int effectiveIndex = 0;
937                                 for (int i = 0; i < grpindex; i++)
938                                                 effectiveIndex = effectiveIndex + pGroupItemCount[i];
939                                         effectiveIndex = effectiveIndex + index;
940
941                                         if(effectiveIndex >= SETTING_MAX)
942                                         {
943                                                 continue;
944                                         }
945                                 if(settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE || settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO )
946                                 {
947                                         __pList->SetItemChecked(grpindex, index, settingInfo[effectiveIndex].isSelected);
948                                 }
949                         }
950                 }
951         }
952         return;
953 }
954
955 void
956 SettingForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
957 {
958         return;
959 }
960
961 void
962 SettingForm::ClearHistory(void)
963 {
964         String message = CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q");
965         if(!__pConfirmationPopup)
966         {
967                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
968                 __pConfirmationPopup->Initialize();
969                 __pConfirmationPopup->RemoveActionListener(*this);
970                 __pConfirmationPopup->AddActionListener(*this);
971                 __pConfirmationPopup->setMessage(message);
972                 __pConfirmationPopup->Show();
973         }
974 }
975
976 void
977 SettingForm::ClearCache(void)
978 {
979         String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q");
980         if(!__pConfirmationPopup)
981         {
982                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
983                 __pConfirmationPopup->Initialize();
984                 __pConfirmationPopup->RemoveActionListener(*this);
985                 __pConfirmationPopup->AddActionListener(*this);
986                 __pConfirmationPopup->setMessage(message);
987                 __pConfirmationPopup->Show();
988         }
989 }
990
991 void
992 SettingForm::ClearCookie(void)
993 {
994         String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO");
995         if(!__pConfirmationPopup)
996         {
997                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
998                 __pConfirmationPopup->Initialize();
999                 __pConfirmationPopup->RemoveActionListener(*this);
1000                 __pConfirmationPopup->AddActionListener(*this);
1001                 __pConfirmationPopup->setMessage(message);
1002                 __pConfirmationPopup->Show();
1003         }
1004 }
1005
1006 void
1007 SettingForm::ResetToDefault()
1008 {
1009         String message = CommonUtil::GetString(L"IDS_BR_POP_RESET_ALL_SETTINGS_TO_DEFAULT_Q");
1010         if(!__pConfirmationPopup)
1011         {
1012                 __pConfirmationPopup = new(std::nothrow) ConfirmationPopup();
1013                 __pConfirmationPopup->Initialize();
1014                 __pConfirmationPopup->RemoveActionListener(*this);
1015                 __pConfirmationPopup->AddActionListener(*this);
1016                 __pConfirmationPopup->setMessage(message);
1017                 __pConfirmationPopup->Show();
1018         }
1019 }