Fixed Nabi Issues N_SE-56966,56735
[apps/osp/Internet.git] / src / IntMainForm.cpp
index fc08487..0005ffc 100644 (file)
 #include <FMedia.h>
 #include <FUi.h>
 #include <FContent.h>
+#include <FShell.h>
+//#include <FShellNotificationManager.h>
 
 #include "IntBookmarkData.h"
 #include "IntBookmarkPresentationModel.h"
 #include "IntCommonLib.h"
 #include "IntFaviconManager.h"
+#include "IntInternetApp.h"
 #include "IntMainForm.h"
-#include "IntNotificationPanel.h"
 #include "IntSceneRegister.h"
 #include "IntSettingPresentationModel.h"
 
@@ -44,6 +46,7 @@ using namespace Tizen::Graphics;
 using namespace Tizen::Io;
 using namespace Tizen::Locales;
 using namespace Tizen::Media;
+using namespace Tizen::Shell;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Content;
@@ -52,8 +55,8 @@ using namespace Tizen::System;
 using namespace Tizen::Web;
 using namespace Tizen::Web::Controls;
 
-static const wchar_t* IDB_SEARCH_INPUT_FIELD_BG = L"I01_toolbar_input_field.9.png";
-static const wchar_t* IDB_FINDWORD_INPUT_FIELD_BG = L"I01_toolbar_input_field_findword.9.png";
+static const wchar_t* IDB_SEARCH_INPUT_FIELD_BG = L"I01_toolbar_input_field.#.png";
+static const wchar_t* IDB_FINDWORD_INPUT_FIELD_BG = L"I01_toolbar_input_field_findword.#.png";
 static const wchar_t* IDB_BTN_BACK = L"I01_icon_Back.png";
 static const wchar_t* IDB_BTN_BACK_PRESS = L"I01_icon_Back_press.png";
 static const wchar_t* IDB_CONTRLBAR_ICON_BOOKMARK = L"I01_search_list_icon_favorite.png";
@@ -65,10 +68,12 @@ static const wchar_t* IDB_CONTRLBAR_ICON_NEW_WINDOW_PRESS = L"I01_icon_plus_pres
 static const wchar_t* IDB_CONTROLBAR_ICON_CREATE_DISABLE = L"I01_controlbar_icon_create_disable.png";
 static const wchar_t* IDB_BUTTON_ON = L"00_button_on.png";
 static const wchar_t* IDB_BUTTON_OFF = L"00_button_off.png";
-static const wchar_t* IDB_ICON_BOOKMARK_OFF_TEMP = L"I01_icon_bookmark_off_temp.png";
-static const wchar_t* IDB_ICON_BOOKMARK_ON_TEMP = L"I01_icon_bookmark_on_temp.png";
+static const wchar_t* IDB_ICON_BOOKMARK_OFF_TEMP =L"00_icon_favorite_off_74x74.png";
+static const wchar_t* IDB_ICON_BOOKMARK_ON_TEMP = L"00_icon_favorite_on_74x74.png";
 static const wchar_t* IDS_TIZEN_SERVICE = L"tizen-service";
 static const wchar_t* IDS_APPID = L"AppID";
+static const wchar_t* IDS_KEY = L"key";
+static const wchar_t* IDS_VALUE = L"value";
 static const wchar_t* IDB_TITLE_PROGRESS_BAR_BG = L"I01_title_progress_bar_bg.png";
 static const wchar_t* IDB_TITLE_PROGRESS_BAR = L"I01_title_progress_bar.png";
 //static const wchar_t* IDB_ADDRESS_BAR_BACKGROUND = L"I01_toolbar_bg_02.9.png";
@@ -125,6 +130,8 @@ const int IDA_HYPERLINK_COPY_LINK_CLICKED = 221;
 const int IDA_HYPERLINK_SAVE_IMAGE_CLICKED = 222;
 const int IDA_HYPERLINK_SHARE_IMAGE_CLICKED = 223;
 
+const int IDA_FINDWORD_CLEAR_RIGHT_TO_LEFT_CLICKED = 224;
+
 const int DEFAULT_PROGRESS_PERCENTAGE = 10;
 
 const int MainForm::IDA_FORMAT_BITMAP = 500;
@@ -137,6 +144,7 @@ static const int WIDTH_CONTEXT_MENU_BUTTON_PORTRAIT = 336;
 static const int WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE = 800;
 static const int HEIGHT_CONTEXT_MENU_BUTTON = 72;
 
+static const wchar_t* APPCONTROL_OPERATION_ID_IMAGE_VIEWER = L"http://tizen.org/appcontrol/operation/view";
 MainForm::MainForm(void)
 {
        __isLongPressedDone = false;
@@ -149,13 +157,18 @@ MainForm::MainForm(void)
        __pWindowInfo = null;
        __pWebViewer = null;
        __pImageMenu = null;
-       __pMenu = null;
+       __pOptionMenu = null;
        __pFindWordControl = null;
-
+       __pFindWordPanelLeftToRight = null;
+       __pFindWordPanelRightToLeft = null;
        __pFindWordBgLabel = null;
+       __pFindWordBgLabelRightToLeft = null;
        __pFindWordEditField = null;
+       __pFindWordEditFieldRightToLeft = null;
        __pFindWordClear = null;
+       __pFindWordClearRightToLeft = null;
        __pFindWordCountLabel = null;
+       __pFindWordClearRightToLeft = null;
        __pFindWordNext = null;
        __pFindWordPrev = null;
        __previousZoomLevel = 1.0;
@@ -175,6 +188,7 @@ MainForm::MainForm(void)
        __progressPercentage = 0;
        __touchPoint1 = Point(-1,-1);
        __touchPoint2 = Point(-1,-1);
+       __longPressPoint = Point(-1,-1);
        __pWebReader = null;
        //      __pReaderPopup = null;
        __pReaderData = null;
@@ -187,6 +201,7 @@ MainForm::MainForm(void)
        __pBlankPanel = null;
        __pArticleReaderLabel = null;
        __webControlHeight = 0;
+       __webControlHeightF = 0;
        __prevAddressBarMode = ADDRESSBAR_MODE_INVALID;
        __curAddressBarMode = ADDRESSBAR_MODE_INVALID;
        __pMostVisitedSites = null;
@@ -199,7 +214,9 @@ MainForm::MainForm(void)
        __pStopBtn = null;
        __pClearBtn = null;
        __pReaderBtn = null;
-       __isWebKeypadOpened = false;
+       __isKeypadOpened = false;
+       __fontSize = 44;
+       __pNotification = null;
 }
 
 MainForm::~MainForm(void)
@@ -234,6 +251,11 @@ MainForm::~MainForm(void)
                delete __pHitElementResult;
                __pHitElementResult = null;
        }
+       if(__pOptionMenu)
+       {
+               delete __pOptionMenu;
+               __pOptionMenu = null;
+       }
 
        String* pSelectedScene = NULL;
        Object* pValue = NULL;
@@ -251,6 +273,8 @@ bool
 MainForm::Initialize(void)
 {
        Construct(L"IDL_FORM");
+
+//     SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_FOOTER);
        return true;
 }
 
@@ -262,6 +286,7 @@ MainForm::OnInitializing(void)
        const int WIDTH_CONTEXT_MENU_BUTTON = 336;
        const int HEIGHT_CONTEXT_MENU_BUTTON = 72;
 
+       __fontSize = CommonUtil::GetFontSize();
        Panel* pFooterPanel = null;
 
        __pSaveImage = new Image();
@@ -271,6 +296,7 @@ MainForm::OnInitializing(void)
        SettingPresentationModel::GetInstance()->AddSettingsEventListener(*this);
        SceneManager::GetInstance()->AddSceneEventListener(IDSCN_MAIN_VIEW, *this);
        AddOrientationEventListener(*this);
+
        AppLogDebug(" MainForm::OnInitializing ended");
        if (__pMostVisitedSites == null)
        {
@@ -281,44 +307,23 @@ MainForm::OnInitializing(void)
 
        __pItemContext= new(std::nothrow) ListContextItem();
        __pItemContext->Construct();
-       Bitmap* pBitmapNormal = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete.9.png", WIDTH_CONTEXT_MENU_BUTTON,HEIGHT_CONTEXT_MENU_BUTTON);
-       Bitmap* pBitmapPressed = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete_press.9.png", WIDTH_CONTEXT_MENU_BUTTON, HEIGHT_CONTEXT_MENU_BUTTON);
 
-       if (pBitmapNormal != null && pBitmapPressed != null)
-       {
-               __pItemContext->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), *pBitmapNormal, *pBitmapPressed, pBitmapPressed);
-       }
+       __pItemContext->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"),true);
 
-       if (pBitmapNormal != null)
-       {
-               delete pBitmapNormal;
-       }
 
-       if (pBitmapPressed != null)
-       {
-               delete pBitmapPressed;
-       }
+       __pItemContext->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL , CONTEXT_ITEM_DELETE_COLOR);
+       __pItemContext->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_HIGHLIGHTED , CONTEXT_ITEM_DELETE_COLOR);
+       __pItemContext->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_PRESSED , CONTEXT_ITEM_DELETE_COLOR);
 
        __pItemContextLandscape= new(std::nothrow) ListContextItem();
        __pItemContextLandscape->Construct();
-       pBitmapNormal = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete.9.png", WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE,HEIGHT_CONTEXT_MENU_BUTTON);
-       pBitmapPressed = CommonUtil::GetNinepatchedBitmapN(L"00_button_sweep_delete_press.9.png", WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE, HEIGHT_CONTEXT_MENU_BUTTON);
-
-       if (pBitmapNormal != null && pBitmapPressed != null)
-       {
-               __pItemContextLandscape->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), *pBitmapNormal, *pBitmapPressed, pBitmapPressed);
-       }
-
-       if (pBitmapNormal != null)
-       {
-               delete pBitmapNormal;
-       }
-
-       if (pBitmapPressed != null)
-       {
-               delete pBitmapPressed;
-       }
 
+       __pItemContextLandscape->AddElement(IDA_CONTEXT_ITEM_DELETE, CommonUtil::GetString(L"IDS_BR_SK_DELETE_ABB"), true);
+       __pItemContextLandscape->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL , CONTEXT_ITEM_DELETE_COLOR);
+       __pItemContextLandscape->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_HIGHLIGHTED , CONTEXT_ITEM_DELETE_COLOR);
+       __pItemContextLandscape->SetElementBackgroundColor(IDA_CONTEXT_ITEM_DELETE,LIST_CONTEXT_ITEM_ELEMENT_STATUS_PRESSED , CONTEXT_ITEM_DELETE_COLOR);
+       SetFormMenuEventListener(this);
+       AppLog("SetFormMenuEventListener result %s",GetErrorMessage(GetLastResult()));
        return E_SUCCESS;
 }
 
@@ -452,7 +457,10 @@ MainForm::InitWebControl()
                return E_FAILURE;
 
        const int Y_WEBCONTROL_POSITION = 0;
-       __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
+
+       __webControlHeight = GetHeight() - __pFooterPanel->GetHeight();
+       __webControlHeightF = GetHeightF() - __pFooterPanel->GetHeightF();
+
        if (__pMostVisitedListView)
        {
                __pMostVisitedListView->SetShowState(false);
@@ -468,6 +476,7 @@ MainForm::InitWebControl()
                AppLogDebug("Initialization failed");
                return E_FAILURE;
        }
+       AppLog("GetClientAreaBounds().width %d",GetClientAreaBounds().width);
        r = __pWebViewer->Construct(Rectangle(0, Y_WEBCONTROL_POSITION, GetClientAreaBounds().width,__webControlHeight + 12));
 
        if (IsFailed(r))
@@ -480,15 +489,15 @@ MainForm::InitWebControl()
        else
        {
                r = AddControl(__pWebViewer);
-
                if (IsFailed(r))
                {
-                       delete __pWebViewer;
+                       __pWebViewer->Destroy();
                        __pWebViewer = null;
                        AppLogDebug("Web addcontrol failed with %s", GetErrorMessage(r));
                        return r;
                }
                __webControlPosition = __pWebViewer->GetPosition();
+               __webControlPositionF = __pWebViewer->GetPositionF();
                r = __pWebViewer->SetSetting(SettingPresentationModel::GetInstance()->GetWebSettings());
                if (IsFailed(r))
                {
@@ -497,7 +506,7 @@ MainForm::InitWebControl()
                }
 
                __pWebViewer->SetLoadingListener(this);
-               __pWebViewer->SetWebUiEventListener(this);
+               __pWebViewer->SetWebUiEventListenerF(this);
                __pWebViewer->SetWebKeypadEventListener(this);
                __pWebViewer->SetFocus();
                __pWebViewer->AddTouchEventListener(*this);
@@ -514,18 +523,6 @@ MainForm::InitWebControl()
 }
 
 void
-MainForm::OnFocusGained(const Control& source)
-{
-       AppLog("MainForm::OnFocusGained");
-}
-
-void
-MainForm::OnFocusLost(const Control& source)
-{
-       AppLog("MainForm::OnFocusLost");
-}
-
-void
 MainForm::SetJavascriptEnabled()
 {
        WebSetting settings = __pWebViewer->GetSetting();
@@ -569,6 +566,7 @@ MainForm::InitFooter(void)
        {
                return E_FAILURE;
        }
+//     __pFooterPanel->SetBackgroundColor(Color(255,0,0));
        //__pFooterPanel->SetBackgroundColor(CUSTOM_COLOR_TRANSPARENT);
        Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight());
        if (pBitmap != null)
@@ -584,13 +582,9 @@ MainForm::InitFooter(void)
                return E_FAILURE;
        }
 
-       __pMoreButton = static_cast<Button*>(GetControl(L"IDC_MORE_BUTTON",true));
-
-       if ( __pMoreButton == NULL )
-       {
-               return E_FAILURE;
-       }
 
+       SetFormBackEventListener(this);
+       AppLog("SetFormBackEventListener result  %s",GetErrorMessage(GetLastResult()));
        if (__pMultiWindowButton != null)
        {
                Bitmap* pBitmap = null;
@@ -622,6 +616,11 @@ MainForm::InitFooter(void)
 
                __pMultiWindowButton->AddActionEventListener(*this);
                __pMultiWindowButton->SetActionId(IDA_MULTIWINDOWBTN_CLICKED);
+               if(pPressedBitmap)
+               {
+                       delete pPressedBitmap;
+                       pPressedBitmap = null;
+               }
        }
 
        if (__pMoreButton)
@@ -651,6 +650,7 @@ MainForm::InitFooter(void)
        __pFooterUrlField->SetKeypadAction(KEYPAD_ACTION_GO);
        __pFooterUrlField->AddKeypadEventListener(*this);
        __pFooterUrlField->SetPropagatedTouchEventListener(this);
+       __pFooterUrlField->AddFocusEventListener(*this);
 
        if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
        {
@@ -658,7 +658,7 @@ MainForm::InitFooter(void)
        }
        else if (SettingPresentationModel::GetInstance()->GetHomepage().CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
        {
-               __pFooterUrlField->SetGuideText(CommonUtil::GetString(L"IDS_BR_BODY_ABOUT_C_BLANK"));
+               __pFooterUrlField->SetGuideText(CommonUtil::GetString(L"IDS_BR_BODY_BLANK_PAGE"));
        }
        else
        {
@@ -746,29 +746,42 @@ MainForm::InitFooter(void)
        __pReaderBtn->SetShowState(false);
 
        //      __pFooterPanel->Invalidate(true);
+       if(__isKeypadOpened == false && __pAddressbar && __pAddressbar->GetShowState() == false)
+       {
+//             AppLog("asdasdasdasda");
+               __pFooterPanel->SetShowState(true);
+       }
+       else if(__pAddressbar == null)
+       {
+               __pFooterPanel->SetShowState(true);
+       }
+       else
+               __pFooterPanel->SetShowState(false);
+
+       SetAddressbarMode(GetAddressbarMode());
        AppLogDebug("MainForm::InitFooter exit");
        return E_SUCCESS;
 }
 
-
 result
-MainForm::InitContextMenu(Point& p)
+MainForm::InitOptionMenu()
 {
        result r = E_SUCCESS;
        bool isPrivateBrowsing = false;
        Bitmap* pBitmap = null;
 
-       if (__pMenu != null)
+       if (__pOptionMenu != null)
        {
-               __pMenu->SetAnchorPosition(p);
-               __pMenu->Invalidate(true);
+               __pOptionMenu->SetFocusable(true);
+               __pOptionMenu->Invalidate(true);
                return r;
        }
 
-       __pMenu = new(std::nothrow) ContextMenu();
-       r = __pMenu->Construct(p, CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
+       __pOptionMenu = new(std::nothrow) OptionMenu();
+       r = __pOptionMenu->Construct();
        TryCatch(!IsFailed(r),,"Contextmenu creation failed with%s",GetErrorMessage(r));
 
+       __pOptionMenu->SetFocusable(true);
        isPrivateBrowsing = SettingPresentationModel::GetInstance()->GetPrivateOn();
 
 
@@ -781,22 +794,22 @@ MainForm::InitContextMenu(Point& p)
                pBitmap  = AppResource::GetInstance()->GetBitmapN(IDB_BUTTON_OFF);
        }
 
-       r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK"), IDA_BOOKMARKBTN_CLICKED);
+       r = __pOptionMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_BOOKMARK"), IDA_BOOKMARKBTN_CLICKED);
 
        if ( pBitmap != NULL)
        {
-               __pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY"), IDA_PRIVATEON_CLICKED,*pBitmap);
+               __pOptionMenu->AddItem(CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"), IDA_PRIVATEON_CLICKED,*pBitmap);
                delete pBitmap;
        }
-       r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_BR_TAB_HISTORY"), IDA_HISTORY_CLICKED);
-       r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_COM_OPT_BRIGHTNESS"), IDA_BRIGHTNESS_BTN_CLICKED);
-       r = __pMenu->AddItem(CommonUtil::GetString(L"IDS_COM_BODY_SETTINGS"), IDA_SETTINGS_CLICKED);
+       r = __pOptionMenu->AddItem(CommonUtil::GetString(L"IDS_BR_TAB_HISTORY"), IDA_HISTORY_CLICKED);
+       r = __pOptionMenu->AddItem(CommonUtil::GetString(L"IDS_COM_OPT_BRIGHTNESS"), IDA_BRIGHTNESS_BTN_CLICKED);
+       r = __pOptionMenu->AddItem(CommonUtil::GetString(L"IDS_COM_BODY_SETTINGS"), IDA_SETTINGS_CLICKED);
 
 
-       __pMenu->SetMaxVisibleItemsCount(6);
-       __pMenu->SetShowState(false);
-       __pMenu->AddActionEventListener(*this);
-       SetControlAlwaysOnTop(*__pMenu, true);
+       __pOptionMenu->SetMaxVisibleItemsCount(6);
+       __pOptionMenu->SetShowState(false);
+       __pOptionMenu->AddActionEventListener(*this);
+       SetControlAlwaysOnTop(*__pOptionMenu, true);
 
        CATCH:
        return r;
@@ -806,6 +819,7 @@ result MainForm::InitImageContextMenu(Tizen::Graphics::Point p)
 {
        result r = E_SUCCESS;
        ContextMenuAnchorDirection direction = CONTEXT_MENU_ANCHOR_DIRECTION_AUTO;
+       String srcUrl = __pHitElementResult->GetAttributeValue(L"src");
 
        AppLog("MainForm::InitImageContextMenu clicked on image");
        if (__pImageMenu != null)
@@ -813,18 +827,27 @@ result MainForm::InitImageContextMenu(Tizen::Graphics::Point p)
                delete __pImageMenu;
                __pImageMenu = null;
        }
+       if(GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+       {
+               p.y = p.y + 54;
+       }
 
        __pImageMenu = new (std::nothrow) ContextMenu();
        r = __pImageMenu->Construct(p, CONTEXT_MENU_STYLE_LIST, direction);
        TryCatch(!IsFailed(r),, "Context image menu creation failed with%s",GetErrorMessage(r));
 
+
        r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_COPY_IMAGE"),IDA_COPY_IMAGE_CLICKED);
-       r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_VIEW_IMAGE"),IDA_VIEW_IMAGE_CLICKED);
+       AppLog("srcUrl %ls __pWebViewer->GetUrl() %ls",srcUrl.GetPointer(),__pWebViewer->GetUrl().GetPointer());
+
+       if(__pWebViewer && srcUrl.Equals(__pWebViewer->GetUrl(),false) == false)
+               r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_VIEW_IMAGE"),IDA_VIEW_IMAGE_CLICKED);
        r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_SAVE_IMAGE"),IDA_SAVE_IMAGE_CLICKED);
-       r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_DLNA_BODY_SHARE_IMAGE_ABB"),IDA_SHARE_IMAGE_CLICKED);
+       r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_SHARE"),IDA_SHARE_IMAGE_CLICKED);
        __pImageMenu->SetMaxVisibleItemsCount(4);
        __pImageMenu->AddActionEventListener(*this);
        SetControlAlwaysOnTop(*__pImageMenu, true);
+       __pImageMenu->SetFocusable(true);
 
        CATCH: return r;
 }
@@ -842,30 +865,36 @@ MainForm::InitImageLinkContextMenu(Tizen::Graphics::Point p)
                __pImageMenu = null;
        }
 
-       if(__pAddressbar->GetShowState() == true)
-               p.y = p.y + __pAddressbar->GetHeight();
+//     if(__pAddressbar->GetShowState() == true)
+//             p.y = p.y + __pAddressbar->GetHeight();
+       if(GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT || GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT_REVERSE)
+       {
+               p.y = p.y + 54;
+       }
 
        __pImageMenu = new (std::nothrow) ContextMenu();
        r = __pImageMenu->Construct(p, CONTEXT_MENU_STYLE_LIST, direction);
        TryCatch(!IsFailed(r),, "Context image menu creation failed with%s",GetErrorMessage(r));
 
-       r = __pImageMenu->AddItem("Open in new window"/*CommonUtil::GetString(L"IDS_BR_OPT_COPY_IMAGE")*/,IDA_HYPERLINK_OPEN_CLICKED);
-       r = __pImageMenu->AddItem("Copy link URL"/*CommonUtil::GetString(L"IDS_DLNA_BODY_SHARE_IMAGE_ABB")*/,IDA_HYPERLINK_COPY_LINK_CLICKED);
+       r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_BODY_OPEN_IN_NEW_WINDOW"),IDA_HYPERLINK_OPEN_CLICKED);
+       r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_COPY_LINK_URL"),IDA_HYPERLINK_COPY_LINK_CLICKED);
        //r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_SAVE_IMAGE"),IDA_HYPERLINK_SAVE_IMAGE_CLICKED);
        r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_SHARE"),IDA_HYPERLINK_SHARE_IMAGE_CLICKED);
 
        __pImageMenu->SetMaxVisibleItemsCount(3);
        __pImageMenu->AddActionEventListener(*this);
        SetControlAlwaysOnTop(*__pImageMenu, true);
+       __pImageMenu->SetFocusable(true);
 
        CATCH: return r;
 
 }
 
 result
-MainForm::InitSelectTextContextMenu(Tizen::Graphics::Point p, bool pasteOption, bool onlyPasteOption = false)
+MainForm::InitSelectTextContextMenu(Point p, bool pasteOption, bool onlyPasteOption = false)
 {
        result r = E_SUCCESS;
+       bool clipboardAvailable = true;
        ContextMenuAnchorDirection direction = CONTEXT_MENU_ANCHOR_DIRECTION_AUTO;
 
        AppLog("MainForm::InitSelectTextContextMenu clicked on text");
@@ -874,6 +903,8 @@ MainForm::InitSelectTextContextMenu(Tizen::Graphics::Point p, bool pasteOption,
                delete __pImageMenu;
                __pImageMenu = null;
        }
+//     Point q(0,0);
+//     __pWebViewer->GetBlockRange(p,q);
 
        if(p.y < 150)
        {
@@ -884,6 +915,39 @@ MainForm::InitSelectTextContextMenu(Tizen::Graphics::Point p, bool pasteOption,
        {
                direction = CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD;
        }
+
+
+       Clipboard* pClipboard = Clipboard::GetInstance();
+
+       if(pClipboard == null)
+       {
+               clipboardAvailable = false;
+       }
+       else
+       {
+               // Retrieves a latest item
+               ClipboardItem* pItem = pClipboard->RetrieveLatestItemN(CLIPBOARD_DATA_TYPE_TEXT | CLIPBOARD_DATA_TYPE_HTML);
+
+               if(pItem == null)
+               {
+                       clipboardAvailable = false;
+               }
+               else
+               {
+                       //Gets data from the clipboard item
+                       String* pString = dynamic_cast<String*>(pItem->GetData());
+
+                       if(pString == null)
+                       {
+                               clipboardAvailable = false;
+                       }
+               }
+       }
+       if(clipboardAvailable == false && onlyPasteOption == true)
+       {
+               return E_FAILURE;
+       }
+
        __pImageMenu = new (std::nothrow) ContextMenu();
        r = __pImageMenu->Construct(p, CONTEXT_MENU_STYLE_GRID, direction);
        TryCatch(!IsFailed(r),, "Context image menu creation failed with%s",GetErrorMessage(r));
@@ -892,7 +956,7 @@ MainForm::InitSelectTextContextMenu(Tizen::Graphics::Point p, bool pasteOption,
        {
                r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_COM_OPT_COPY"),IDA_COPY_TEXT_CLICKED);
        }
-       if (pasteOption || onlyPasteOption)
+       if ((pasteOption || onlyPasteOption) && clipboardAvailable == true)
        {
                r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_COM_BODY_PASTE"),IDA_PASTE_TEXT_CLICKED);
        }
@@ -905,6 +969,105 @@ MainForm::InitSelectTextContextMenu(Tizen::Graphics::Point p, bool pasteOption,
        __pImageMenu->SetMaxVisibleItemsCount(3);
        __pImageMenu->AddActionEventListener(*this);
        SetControlAlwaysOnTop(*__pImageMenu, true);
+       __pImageMenu->SetFocusable(true);
+
+       CATCH: return r;
+
+}
+
+result
+MainForm::InitSelectTextContextMenuF(FloatPoint p, bool pasteOption, bool onlyPasteOption = false)
+{
+       result r = E_SUCCESS;
+       bool clipboardAvailable = true;
+       ContextMenuAnchorDirection direction = CONTEXT_MENU_ANCHOR_DIRECTION_AUTO;
+
+       AppLog("MainForm::InitSelectTextContextMenu clicked on text");
+       if (__pImageMenu != null)
+       {
+               delete __pImageMenu;
+               __pImageMenu = null;
+       }
+//     FloatPoint q(0.0,0.0);
+//             __pWebViewer->GetBlockRange(p,q);
+       if(p.y < 0)
+               p.y =0;
+       if(p.y < 150)
+       {
+               p.y = p.y + 100;
+               if(GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE )
+               {
+                       p.y = p.y - 50;
+               }
+               direction = CONTEXT_MENU_ANCHOR_DIRECTION_DOWNWARD;
+       }
+       else if(__pWebViewer != null && (p.y > (__pWebViewer->GetHeight() + __pWebViewer->GetY())))
+       {
+               p.y = __pWebViewer->GetHeight() + __pWebViewer->GetY();
+       }
+       else
+       {
+               if(GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE )
+               {
+                       AppLog("asdasdafdsfdgfd");
+                       p.y = p.y - 50;
+               }
+               direction = CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD;
+       }
+
+
+       Clipboard* pClipboard = Clipboard::GetInstance();
+
+       if(pClipboard == null)
+       {
+               clipboardAvailable = false;
+       }
+       else
+       {
+               // Retrieves a latest item
+               ClipboardItem* pItem = pClipboard->RetrieveLatestItemN(CLIPBOARD_DATA_TYPE_TEXT | CLIPBOARD_DATA_TYPE_HTML);
+
+               if(pItem == null)
+               {
+                       clipboardAvailable = false;
+               }
+               else
+               {
+                       //Gets data from the clipboard item
+                       String* pString = dynamic_cast<String*>(pItem->GetData());
+
+                       if(pString == null)
+                       {
+                               clipboardAvailable = false;
+                       }
+               }
+       }
+       if(clipboardAvailable == false && (onlyPasteOption == true ||  __pHitElementResult->GetAttributeValue("type").Equals(L"password",false) == true))
+       {
+               return E_FAILURE;
+       }
+       __pImageMenu = new (std::nothrow) ContextMenu();
+       r = __pImageMenu->Construct(p, CONTEXT_MENU_STYLE_GRID, direction);
+       TryCatch(!IsFailed(r),, "Context image menu creation failed with%s",GetErrorMessage(r));
+
+       if(onlyPasteOption == false && __pHitElementResult->GetAttributeValue("type").Equals(L"password",false) == false)
+       {
+               r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_COM_OPT_COPY"),IDA_COPY_TEXT_CLICKED);
+       }
+       if ((pasteOption || onlyPasteOption) && clipboardAvailable == true)
+       {
+               r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_COM_BODY_PASTE"),IDA_PASTE_TEXT_CLICKED);
+       }
+       if(onlyPasteOption == false && __pHitElementResult->GetAttributeValue("type").Equals(L"password",false) == false)
+       {
+               r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"),IDA_FIND_TEXT__CLICKED);
+               r = __pImageMenu->AddItem(CommonUtil::GetString(L"IDS_BR_OPT_SHARE"),IDA_SHARE_TEXT_CLICKED);
+       }
+
+       __pImageMenu->SetMaxVisibleItemsCount(3);
+       __pImageMenu->AddActionEventListener(*this);
+       SetControlAlwaysOnTop(*__pImageMenu, true);
+       __pImageMenu->SetFocusable(true);
 
        CATCH: return r;
 
@@ -928,6 +1091,20 @@ MainForm::InitFindWordPanel(void)
                                delete pBitmap;
                        }
                }
+               if (__pFindWordBgLabelRightToLeft != null)
+               {
+                       Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_FINDWORD_INPUT_FIELD_BG, __pFindWordBgLabelRightToLeft->GetWidth(), __pFindWordBgLabelRightToLeft->GetHeight());
+                       if (pBitmap != null)
+                       {
+                               __pFindWordBgLabelRightToLeft->SetBackgroundBitmap(*pBitmap);
+                               delete pBitmap;
+                       }
+               }
+               if(__pAddressbar)
+                       __pAddressbar->SetShowState(false);
+
+               if(__isKeypadOpened == false)
+                       __pFooterPanel->SetShowState(true);
                return r;
        }
 
@@ -944,6 +1121,12 @@ MainForm::InitFindWordPanel(void)
        __pFindWordControl->SetShowState(false);
        __pFindWordControl->Invalidate(false);
 
+       __pFindWordPanelLeftToRight = static_cast<Panel*>(__pFindWordControl->GetControl(L"IDC_PANEL1", true));
+       __pFindWordPanelLeftToRight->SetShowState(true);
+
+       __pFindWordPanelRightToLeft = static_cast<Panel*>(__pFindWordControl->GetControl(L"IDC_PANEL2", true));
+       __pFindWordPanelRightToLeft->SetShowState(false);
+
        __pFindWordBgLabel = static_cast<Label*>(__pFindWordControl->GetControl(L"IDC_LABEL1", true));
        if (__pFindWordBgLabel != null)
        {
@@ -951,7 +1134,7 @@ MainForm::InitFindWordPanel(void)
                Rectangle pRect = pPanel1->GetBounds();
                pRect.x = pRect.y = 0;
                __pFindWordBgLabel->SetBounds(pRect);
-               Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.9.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
+               Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.#.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
                if (pBitmap != null)
                {
                        AppLogDebug("InitFindWordPanel: Coming here");
@@ -964,6 +1147,26 @@ MainForm::InitFindWordPanel(void)
                }
        }
 
+       __pFindWordBgLabelRightToLeft = static_cast<Label*>(__pFindWordControl->GetControl(L"IDC_LABEL2", true));
+               if (__pFindWordBgLabelRightToLeft != null)
+               {
+                       Panel* pPanel1 = static_cast<Panel*>(__pFindWordControl->GetControl(L"IDC_PANEL1", true));
+                       Rectangle pRect = pPanel1->GetBounds();
+                       pRect.x = pRect.y = 0;
+                       __pFindWordBgLabelRightToLeft->SetBounds(pRect);
+                       Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(L"I01_search_input_field_bg.#.png", __pFindWordBgLabel->GetWidth(), __pFindWordBgLabel->GetHeight());
+                       if (pBitmap != null)
+                       {
+                               AppLogDebug("InitFindWordPanel: Coming here");
+                               __pFindWordBgLabelRightToLeft->SetBackgroundBitmap(*pBitmap);
+                               delete pBitmap;
+                       }
+                       else
+                       {
+                               AppLogDebug("InitFindWordPanel: shouldn't Come here");
+                       }
+               }
+
        Button* pfindWordCancel = null;
        pfindWordCancel = static_cast<Button*>(__pFindWordControl->GetControl(L"IDC_FIND_CANCEL", true));
        if (pfindWordCancel == null)
@@ -981,9 +1184,19 @@ MainForm::InitFindWordPanel(void)
                return E_FAILURE;
        }
 
+       __pFindWordClearRightToLeft = static_cast<Button*>(__pFindWordControl->GetControl(L"IDC_FIND_CLEAR2", true));
+               if (__pFindWordClearRightToLeft == null)
+               {
+                       AppLogException("There is some problem in the xml file. Please check.");
+                       return E_FAILURE;
+               }
+
        __pFindWordClear->SetActionId(IDA_FINDWORD_CLEAR_CLICKED);
        __pFindWordClear->AddActionEventListener(*this);
 
+       __pFindWordClearRightToLeft->SetActionId(IDA_FINDWORD_CLEAR_RIGHT_TO_LEFT_CLICKED);
+       __pFindWordClearRightToLeft->AddActionEventListener(*this);
+
        __pFindWordNext = static_cast<Button*>(__pFindWordControl->GetControl(L"IDC_FIND_NEXT", true));
        if (__pFindWordNext == null)
        {
@@ -1013,6 +1226,15 @@ MainForm::InitFindWordPanel(void)
                AppLogException("There is some problem in the xml file. Please check.");
                return E_FAILURE;
        }
+       __pFindWordCountLabel->SetText(L"0/0");
+
+       __pFindWordCountLabelRightToLeft = static_cast<Label*>(__pFindWordControl->GetControl(L"IDC_FIND_COUNT_LABEL2", true));
+       if (__pFindWordCountLabelRightToLeft == null)
+       {
+               AppLogException("There is some problem in the xml file. Please check.");
+               return E_FAILURE;
+       }
+       __pFindWordCountLabelRightToLeft->SetText(L"0/0");
 
        __pFindWordEditField = static_cast<EditField*>(__pFindWordControl->GetControl(L"IDC_FIND_WORD_EDITFIELD", true));
        if (__pFindWordEditField == null)
@@ -1023,7 +1245,24 @@ MainForm::InitFindWordPanel(void)
        __pFindWordEditField->AddTextEventListener(*this);
        __pFindWordEditField->AddKeypadEventListener(*this);
        __pFindWordEditField->SetOverlayKeypadCommandButtonVisible(false);
+       __pFindWordEditField->SetColor(EDIT_STATUS_HIGHLIGHTED, Color(0x00, 0x00, 0x00, 0x00));
+
+       __pFindWordEditFieldRightToLeft = static_cast<EditField*>(__pFindWordControl->GetControl(L"IDC_FIND_WORD_EDITFIELD2", true));
+       if (__pFindWordEditFieldRightToLeft == null)
+       {
+               AppLogException("There is some problem in the xml file. Please check.");
+               return E_FAILURE;
+       }
+       __pFindWordEditFieldRightToLeft->AddTextEventListener(*this);
+       __pFindWordEditFieldRightToLeft->AddKeypadEventListener(*this);
+       __pFindWordEditFieldRightToLeft->SetOverlayKeypadCommandButtonVisible(false);
+       __pFindWordEditFieldRightToLeft->SetColor(EDIT_STATUS_HIGHLIGHTED, Color(0x00, 0x00, 0x00, 0x00));
+
+       if(__pAddressbar)
+               __pAddressbar->SetShowState(false);
 
+       if(__isKeypadOpened == false)
+               __pFooterPanel->SetShowState(true);
        return r;
 }
 
@@ -1059,7 +1298,7 @@ MainForm::CreateItem (int index, int itemWidth)
        if (pageURL.GetLength() == 0)
        {
                String nourl;
-               pAppResource->GetString(L"IDS_BR_BODY_ABOUT_C_BLANK", nourl);
+               pAppResource->GetString(L"IDS_BR_BODY_BLANK_PAGE", nourl);
                pageURL = L"<"+ nourl +">";
 
        }
@@ -1067,7 +1306,7 @@ MainForm::CreateItem (int index, int itemWidth)
        Rectangle screenBounds = GetBounds();
        if (pItem != null)
        {
-               r = pItem->Construct(Dimension(itemWidth, 128), style);
+               r = pItem->Construct(Dimension(itemWidth, 128 + (__fontSize - 44)), style);
        }
        if (IsFailed(r))
        {
@@ -1092,8 +1331,8 @@ MainForm::CreateItem (int index, int itemWidth)
 
        if ( pListIconImage != NULL)
        {
-               listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28,72, 72);
-               pagetTitleRect.SetBounds(listImageRect.x + 72 + 16,10, screenBounds.width - 2 * pListIconImage->GetWidth() - 120, 60);
+               listImageRect.SetBounds(screenBounds.x + 16, screenBounds.y + 28  + (__fontSize - 44)/2 , 72, 72);
+               pagetTitleRect.SetBounds(listImageRect.x + 72 + 16,10, screenBounds.width - 2 * pListIconImage->GetWidth() - 120, 72  + (__fontSize - 44));
                pageURLRect.SetBounds(pagetTitleRect.x, pagetTitleRect.y + pagetTitleRect.height, screenBounds.width - 2 * pListIconImage->GetWidth() - 120, 48);
 
 
@@ -1107,7 +1346,7 @@ MainForm::CreateItem (int index, int itemWidth)
        {
                if (pItem != null)
                {
-                       pItem->AddElement(pagetTitleRect, IDA_FORMAT_TITLE_STRING, pageTitle, 44, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, true);
+                       pItem->AddElement(pagetTitleRect, IDA_FORMAT_TITLE_STRING, pageTitle, __fontSize, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, true);
                }
        }
 
@@ -1115,7 +1354,7 @@ MainForm::CreateItem (int index, int itemWidth)
        {
                if (pItem != null)
                {
-                       pItem->AddElement(pageURLRect, IDA_FORMAT_URL_STRING, pageURL, 32, CUSTOM_COLOR_GREY, CUSTOM_COLOR_GREY, CUSTOM_COLOR_GREY, true);
+                       pItem->AddElement(pageURLRect, IDA_FORMAT_URL_STRING, pageURL, 32, CUSTOM_COLOR_GREY, CUSTOM_COLOR_LISTVIEW_TEXT, CUSTOM_COLOR_LISTVIEW_TEXT, true);
                }
        }
 
@@ -1175,6 +1414,7 @@ MainForm::GetItemCount (void)
 void
 MainForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus state)
 {
+       AppLog("MainForm::OnListViewContextItemStateChanged called");
        if(__pMostVisitedSites != null)
        {
                History* pHistory = static_cast < History* >(__pMostVisitedSites->GetAt(index));
@@ -1191,6 +1431,7 @@ MainForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listV
 void
 MainForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
 {
+       AppLog("MainForm::OnListViewItemStateChanged called");
        History* pHistory = static_cast < History* >(__pMostVisitedSites->GetAt(index));
        String url = pHistory->GetHistoryUrl();
        if (url != null)
@@ -1209,14 +1450,40 @@ result
 MainForm::OnTerminating(void)
 {
        result r = E_SUCCESS;
-       if(__pItemContext)
+
+       RemoveOrientationEventListener(*this);
+
+       if(__pAddressbar)
+       {
+               __pAddressbar->SetAddressbarEventListener(null);
+       }
+
+       if(__pWebViewer)
+       {
+               __pWebViewer->RemoveTouchEventListener(*this);
+               __pWebViewer->SetWebUiEventListenerF(null);
+               __pWebViewer->SetWebKeypadEventListener(null);
+               __pWebViewer->SetTextSearchListener(null);
+       }
+
+
+       if (__pItemContext)
        {
                delete __pItemContext;
        }
-       if(__pItemContextLandscape)
+       if (__pItemContextLandscape)
        {
                delete __pItemContextLandscape;
        }
+       if (__pSaveImage)
+       {
+               delete __pSaveImage;
+       }
+       if (__pMostVisitedSites)
+       {
+               __pMostVisitedSites->RemoveAll(true);
+               delete __pMostVisitedSites;
+       }
        return r;
 }
 
@@ -1230,6 +1497,11 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
        {
        case IDA_BACKBTN_CLICKED:
        {
+               if(__pImageMenu && __pImageMenu->GetShowState() == true)
+               {
+                       AppLog("Hiding the menu");
+                       __pImageMenu->SetShowState(false);
+               }
                if (__pWebViewer && __pWebViewer->CanGoBack())
                {
                        __pWebViewer->GoBack();
@@ -1240,7 +1512,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        pApp = UiApp::GetInstance();
                        if (pApp != null)
                        {
-                               r = pApp->Terminate();
+                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                if (IsFailed(r))
                                {
                                        AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -1264,7 +1536,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                pApp = UiApp::GetInstance();
                                if (pApp != null)
                                {
-                                       r = pApp->Terminate();
+                                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                        if (IsFailed(r))
                                        {
                                                AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -1284,7 +1556,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                        pApp = UiApp::GetInstance();
                                        if (pApp != null)
                                        {
-                                               r = pApp->Terminate();
+                                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                                if (IsFailed(r))
                                                {
                                                        AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -1322,13 +1594,14 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                                        pApp = UiApp::GetInstance();
                                                        if (pApp != null)
                                                        {
-                                                               r = pApp->Terminate();
+                                                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                                                return;
                                                        }
                                                }
                                                else
                                                {
-                                                       r = pSceneManager->GoBackward(BackwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE));
+                                                       r = pSceneManager->GoForward(ForwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_HISTORY_OPTION_ADD_HISTORY,SCENE_DESTROY_OPTION_DESTROY));
+//                                                     r = pSceneManager->GoBackward(BackwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE));
                                                        if (IsFailed(r))
                                                        {
                                                                AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -1351,8 +1624,8 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        __pWebViewer->GoForward();
                }
-               __pMenu->SetShowState(false);
-               __pMenu->Invalidate(false);
+               __pOptionMenu->SetShowState(false);
+               __pOptionMenu->Invalidate(false);
                break;
 
        case IDA_FINDONPAGE_CLICKED:
@@ -1361,11 +1634,19 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                __currentSearchStr.Clear();
 
                InitFindWordPanel();
-               __pMenu->SetShowState(false);
-               __pMenu->Invalidate(false);
+               __pOptionMenu->SetShowState(false);
+               __pOptionMenu->Invalidate(false);
 
-               __pFindWordEditField->SetFocus();
                ShowFindWordPanel(true);
+
+               if(__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true)
+               {
+                       __pFindWordEditField->SetFocus();
+               }
+               else
+               {
+                       __pFindWordEditFieldRightToLeft->SetFocus();
+               }
        }
        break;
        case IDA_PRIVATEON_CLICKED:
@@ -1418,12 +1699,10 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        }
                }
 
-
-               itemIndex = __pMenu->GetItemIndexFromActionId(IDA_PRIVATEON_CLICKED);
-               r = __pMenu->SetItemAt(itemIndex,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY"),IDA_PRIVATEON_CLICKED,*pBitmap);
+               itemIndex = __pOptionMenu->GetItemIndexFromActionId(IDA_PRIVATEON_CLICKED);
+               r = __pOptionMenu->SetItemAt(itemIndex,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap);
                AppLog("Result:: %s for index = %d", GetErrorMessage(r),itemIndex);
-               __pMenu->Invalidate(true);
-
+               __pOptionMenu->Invalidate(true);
                if ( pBitmap != NULL )
                {
                        delete pBitmap;
@@ -1441,8 +1720,9 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        pArgList->Add(*__pWindowInfo);
                        SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_SETTINGS), pArgList);
                }
-               __pMenu->SetShowState(false);
-               __pMenu->Invalidate(false);
+               __pOptionMenu->SetShowState(false);
+               __pOptionMenu->Invalidate(false);
+
                if (pArgList != null)
                {
                        delete pArgList;
@@ -1475,12 +1755,17 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                BookmarkPresentationModel::GetInstance()->DeleteBookmark(url);
                                pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_OFF_TEMP);
 
-                               NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
-                               if (pNotification != null)
+                               if(__pNotification != null)
+                               {
+                                       RemoveControl(__pNotification);
+                                       __pNotification = null;
+                               }
+                               __pNotification = new (std::nothrow) NotificationPanel(*this);
+                               if (__pNotification != null)
                                {
-                                       pNotification->SetText(message);
-                                       pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
-                                       pNotification->ShowNotification();
+                                       __pNotification->SetText(message);
+                                       __pNotification->SetPositionDiff(__pFooterPanel->GetHeight() - 12);
+                                       __pNotification->ShowNotification();
                                }
                        }
                        else
@@ -1500,29 +1785,35 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                //r = BookmarkPresentationModel::GetInstance()->SaveBookmark(*pBookmark);
                                r = BookmarkPresentationModel::GetInstance()->SaveTempBookmark(*pBookmark);
                                delete pBookmark;
-
-                               NotificationPanel* pNotification = new (std::nothrow) NotificationPanel(*this);
-                               if (pNotification != null)
+                               if(__pNotification != null)
                                {
-                                       pNotification->SetText(message);
-                                       pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
-                                       pNotification->ShowNotification();
+                                       RemoveControl(__pNotification);
+                                       __pNotification = null;
+                               }
+                               __pNotification = new (std::nothrow) NotificationPanel(*this);
+                               if (__pNotification != null)
+                               {
+                                       __pNotification->SetText(message);
+                                       __pNotification->SetPositionDiff(__pFooterPanel->GetHeight() - 12);
+                                       __pNotification->ShowNotification();
                                        pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_ON_TEMP);
                                }
                        }
                        if (pBitmap != null)
                        {
-                               r = __pMenu->SetItemAt(0,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+                               r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
                                delete pBitmap;
                        }
+
+
+                       __pOptionMenu->Invalidate(true);
                }
-               __pMenu->Invalidate(true);
 
        }
        break;
        case IDA_PRINT_CLICKED:
        {
-               r = __pWebViewer->SavePageAsPdf(UiApp::GetInstance()->GetAppRootPath()+"//data//test.pdf");
+               r = __pWebViewer->SavePageAsPdf(UiApp::GetInstance()->GetAppRootPath()+"//shared//data//test.pdf");
                AppLog("SavePageAsPdf result %s",GetErrorMessage(r));
 
                AppLog("RequestPrint called!");
@@ -1541,7 +1832,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        String fileCount = L"service_print_files_count";
                        String countVal = L"1";
                        String fileFolder= L"service_print_files_folder_name";
-                       String folderVal = UiApp::GetInstance()->GetAppRootPath()+"//data";
+                       String folderVal = UiApp::GetInstance()->GetAppRootPath()+"//shared//data";
 
                        map.Add(&fileCount, &countVal);
                        map.Add(&fileFolder, &folderVal);
@@ -1591,6 +1882,10 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        delete __pPopUp;
                        __pPopUp = null;
                }
+               if(__pAddressbar)
+               {
+                       __pAddressbar->HideKeypad();
+               }
                __pPopUp = new(std::nothrow) SharePopup();
                __pPopUp->Initialize();
                if (__pWindowInfo != null)
@@ -1619,13 +1914,10 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
        break;
        case IDA_MOREBTN_CLICKED:
        {
-               AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 1");
-               Point p = Point(__pMoreButton->GetX() + __pMoreButton->GetWidth() / 2, GetClientAreaBounds().y + GetClientAreaBounds().height - __pMoreButton->GetHeight());
-               AppLog("Anchot pos: %d %d", p.x, p.y);
-               InitContextMenu(p);
+               AppLog("IDA_MOREBTN_CLICKED");
+               InitOptionMenu();
                if (__pWindowInfo != NULL && __pWindowInfo->pageUrl != NULL && __pWebViewer->GetShowState() == true)
                {
-                       AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 2");
                        int bookmarkCount=0;
                        bool exist = false;
                        String url=L"";
@@ -1649,13 +1941,13 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        }
                        AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3");
 
-                       if (__pMenu->GetItemCount() == 9)
+                       if (__pOptionMenu->GetItemCount() == 9)
                        {
-                               r = __pMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+                               r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
                        }
                        else
                        {
-                               r = __pMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+                               r = __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
                        }
 
                        if (IsFailed(r))
@@ -1665,34 +1957,35 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                return ;
                        }
                        AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4");
-                       if (__pMenu->GetItemCount() != 9)
+                       if (__pOptionMenu->GetItemCount() != 9)
                        {
-                               __pMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED);
-                               __pMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_COM_SK_PRINT"), IDA_PRINT_CLICKED);
-//                             __pMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
-                               __pMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
-                               __pMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
-                               __pMenu->SetMaxVisibleItemsCount(6);
+                               __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED);
+                               __pOptionMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_BODY_PRINT"), IDA_PRINT_CLICKED);
+       //                              __pOptionMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
+                               __pOptionMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
+                               __pOptionMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
+                               __pOptionMenu->SetMaxVisibleItemsCount(6);
                        }
-                       if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE)
+                       if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
                        {
                                AppLog(" Orientation landscape");
-                               __pMenu->SetMaxVisibleItemsCount(5);
+                               __pOptionMenu->SetMaxVisibleItemsCount(5);
                        }
                        else
                        {
                                AppLog(" Orientation potrait");
-                               __pMenu->SetMaxVisibleItemsCount(6);
+                               __pOptionMenu->SetMaxVisibleItemsCount(6);
                        }
 
                        AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 5");
                        delete pBitmap;
                }
                AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED end");
-               __pMenu->SetShowState(true);
-               __pMenu->Invalidate(true);
-               __pMenu->Show();
-       }
+               __pOptionMenu->SetShowState(true);
+               __pOptionMenu->Invalidate(true);
+               __pOptionMenu->Show();
+
+}
        break;
        case IDA_HISTORY_CLICKED:
        {
@@ -1724,7 +2017,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 
        case IDA_NEWWINDOWBTN_CLICKED:
        {
-               WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene();
+               WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN();
 
                if (pNewWindowInfo == null)
                {
@@ -1788,19 +2081,39 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                __currentSearchStr = L"";
                __currentWordIndex = 0;
                __maxOccurrances = 0;
-               __pFindWordEditField->SetText(L"");
+
+               if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true)
+               {
+                       __pFindWordEditField->SetText(L"");
+                       __pFindWordCountLabel->SetText(L"0/0");
+               }
+               else if (__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true)
+               {
+                       __pFindWordEditFieldRightToLeft->SetText(L"");
+                       __pFindWordCountLabelRightToLeft->SetText(L"0/0");
+               }
+
                __pFindWordNext->SetEnabled(false);
                __pFindWordPrev->SetEnabled(false);
                __pFindWordCountLabel->SetText(L"0/0");
-               __pWebViewer->SearchText(L"aaaabbbbcccc",true);
+               __pWebViewer->SearchTextAllAsync(L"",true);
                AppLog("akjshdasd 1");
-               __pFooterPanel->SetShowState(true);
+               if(__isKeypadOpened == false)
+                       __pFooterPanel->SetShowState(true);
                ShowFindWordPanel(false);
        }
        break;
        case IDA_FINDWORD_SEARCH_CLICKED:
        {
-               __currentSearchStr = __pFindWordEditField->GetText();
+               if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true)
+               {
+                       __currentSearchStr = __pFindWordEditField->GetText();
+               }
+               else if (__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true)
+               {
+                       __currentSearchStr = __pFindWordEditFieldRightToLeft->GetText();
+               }
+
                if (__currentSearchStr.GetLength() > 0)
                {
                        StartWordSearch();
@@ -1820,6 +2133,20 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                __currentSearchStr = L"";
                __pFindWordNext->SetEnabled(false);
                __pFindWordPrev->SetEnabled(false);
+//             __pFindWordCountLabel->SetShowState(false);
+               __pFindWordControl->Invalidate(true);
+       }
+       break;
+       case IDA_FINDWORD_CLEAR_RIGHT_TO_LEFT_CLICKED:
+       {
+               __pFindWordCountLabelRightToLeft->SetText(L"0/0");
+               __pFindWordEditFieldRightToLeft->SetText(L"");
+               __currentSearchStr = L"aaaaaabbbbbbccccccc";
+               StartWordSearch();
+               __currentSearchStr = L"";
+               __pFindWordNext->SetEnabled(false);
+               __pFindWordPrev->SetEnabled(false);
+//             __pFindWordCountLabelRightToLeft->SetShowState(false);
                __pFindWordControl->Invalidate(true);
        }
        break;
@@ -1845,19 +2172,20 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                AppLogDebug("IDA_COPY_IMAGE_CLICKED");
                ClipboardItem item;
                const Bitmap* pBitmap = null;
-               if (__pHitElementResult != null)
+               if (__pHitElementResult != null && __pHitElementResult->HasImage())
                {
                        pBitmap = __pHitElementResult->GetImage();
                }
 
                String resourcePath = App::GetInstance()->GetAppResourcePath();
-               item.Construct(CLIPBOARD_DATA_TYPE_IMAGE , *pBitmap);
-
+               r = item.Construct(CLIPBOARD_DATA_TYPE_IMAGE , *pBitmap);
+               AppLog("Platofrm construct failed result %s",GetErrorMessage(r));
                // copying the item to clipboard
                Clipboard* pClipboard = Clipboard::GetInstance();
                if (pClipboard != null)
                {
-                       pClipboard->CopyItem(item);
+                       r = pClipboard->CopyItem(item);
+                       AppLog("Platofrm copy failed result %s",GetErrorMessage(r));
                }
        }
        break;
@@ -1869,8 +2197,22 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        String srcUrl = __pHitElementResult->GetAttributeValue(L"src");
                        AppLog("MainForm::OnTouchLongPressed srcUrl is %ls",srcUrl.GetPointer());
-                       LoadUrl(srcUrl);
 
+                       Uri currentUri;
+                       currentUri.SetUri(__pWebViewer->GetUrl());
+
+                       String newUrl;
+                       Uri newUri;
+                       newUri.SetUri(srcUrl);
+                       AppLog("newuri gethost %ls",newUri.GetHost().GetPointer());
+                       if(newUri.GetHost().GetLength() == 0)
+                       {
+                               newUrl = currentUri.GetHost();
+                               newUrl.Append(srcUrl);
+                               srcUrl = newUrl;
+                       }
+
+                       LoadUrl(srcUrl);
                }
        }
        break;
@@ -1895,30 +2237,34 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        UpdateImageContent(pBuffer, imageName);
                        delete pBuffer;
-                       NotificationPanel *pNotification = new NotificationPanel(*this);
+                       if(__pNotification != null)
+                       {
+                               RemoveControl(__pNotification);
+                               __pNotification = null;
+                       }
+                       __pNotification = new NotificationPanel(*this);
                        String msg;
                        AppResource::GetInstance()->GetString("IDS_COM_SK_SAVE", msg);
                        msg.Append(imagePath);
-                       if (pNotification != null)
+                       if (__pNotification != null)
                        {
-                               pNotification->SetText(msg);
+                               __pNotification->SetText(msg);
                                if (__pFooterPanel->GetShowState() == true)
                                {
-                                       pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
+                                       __pNotification->SetPositionDiff(__pFooterPanel->GetHeight());
                                }
                                else
                                {
-                                       pNotification->SetPositionDiff(0);
+                                       __pNotification->SetPositionDiff(0);
                                }
-
-                               pNotification->ShowNotification();
+                               __pNotification->ShowNotification();
                        }
                }
                else
                {
                        int __modalMsgBoxResult;
                        MessageBox* pMsgBox = new MessageBox();
-                       pMsgBox->Construct(CommonUtil::GetString(L"IDS_COM_FAILED_TO_SAVE_IMAGE"),CommonUtil::GetString(L"IDS_COM_FAILED_TO_SAVE_IMAGE"),MSGBOX_STYLE_OK,3000);
+                       pMsgBox->Construct(CommonUtil::GetString(L"IDS_IMGE_POP_UNABLE_TO_SAVE_IMAGE"),CommonUtil::GetString(L"IDS_IMGE_POP_UNABLE_TO_SAVE_IMAGE"),MSGBOX_STYLE_OK,3000);
                        pMsgBox->ShowAndWait(__modalMsgBoxResult);
                        delete pMsgBox;
                        pMsgBox = null;
@@ -1934,6 +2280,10 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        delete __pPopUp;
                        __pPopUp = null;
                }
+               if(__pAddressbar)
+               {
+                       __pAddressbar->HideKeypad();
+               }
                __pPopUp = new(std::nothrow) SharePopup();
                __pPopUp->Initialize();
                if (__pHitElementResult != null)
@@ -1973,12 +2323,13 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        String srcUrl = __pHitElementResult->GetUrl();
 
-                       WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene(srcUrl);
+                       WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN(srcUrl);
 
                        if (pNewWindowInfo == null)
                        {
                                return;
                        }
+                       pNewWindowInfo->isJavascriptInitiated = true;
                        result r = E_SUCCESS;
                        SceneManager* pSceneManager = SceneManager::GetInstance();
                        if (pSceneManager == NULL)
@@ -2019,6 +2370,10 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                        delete __pPopUp;
                        __pPopUp = null;
                }
+               if(__pAddressbar)
+               {
+                       __pAddressbar->HideKeypad();
+               }
                __pPopUp = new(std::nothrow) SharePopup();
                __pPopUp->Initialize();
 
@@ -2062,18 +2417,20 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                __currentSearchStr.Append(__currentSelectedStr);
                InitFindWordPanel();
                __pFindWordEditField->SetText(__currentSearchStr);
-               if(__pMenu != null)
+
+               if(__pOptionMenu != null)
                {
-                       __pMenu->SetShowState(false);
-                       __pMenu->Invalidate(false);
+                       __pOptionMenu->SetShowState(false);
+                       __pOptionMenu->Invalidate(false);
                }
-
                __adressPanelPosition.y = 0;
 
                if (__pAddressbar != null && __pWebViewer != NULL)
                {
                        __webControlPosition.y = __pAddressbar->GetHeight() - 12;
+                       __webControlPositionF.y = __pAddressbar->GetHeightF() - 12.0f;
                        __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight() - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12);
+                       __webControlHeightF = GetClientAreaBoundsF().height - __pFooterPanel->GetHeightF() - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeightF() - 12.0f);
 
                        if (__pFooterPanel->GetShowState() == false)
                                __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width, GetClientAreaBounds().height - ( /*__pAddressbar->GetY() +*/ __pAddressbar->GetHeight() - 12)));
@@ -2083,7 +2440,17 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                }
 
                ShowFindWordPanel(true);
-               __pFindWordEditField->SetFocus();
+               if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true)
+               {
+                       __pFindWordEditField->SetText(__currentSearchStr);
+                       __pFindWordEditField->SetFocus();
+               }
+               else if(__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true)
+               {
+                       __pFindWordEditFieldRightToLeft->SetText(__currentSearchStr);
+                       __pFindWordEditFieldRightToLeft->SetFocus();
+               }
+
                if (__currentSearchStr.GetLength() > 0)
                {
                        StartWordSearch();
@@ -2103,12 +2470,17 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
        break;
        case IDA_SHARE_TEXT_CLICKED:
        {
+               __pWebViewer->ReleaseBlock();
                AppLogDebug("IDA_SHARE_TEXT_CLICKED");
                if(__pPopUp != null)
                {
                        delete __pPopUp;
                        __pPopUp = null;
                }
+               if(__pAddressbar)
+               {
+                       __pAddressbar->HideKeypad();
+               }
                __pPopUp = new(std::nothrow) SharePopup();
                __pPopUp->Initialize();
                if (__pHitElementResult != null)
@@ -2126,7 +2498,7 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
        break;
        case IDA_COPY_TEXT_CLICKED:
        {
-               __pWebViewer->ReleaseBlock();
+//             __pWebViewer->ReleaseBlock();//as per hyunn lee request for issue 53500
                // need to implement
                //__currentSelectedStr
                // Sets data to a clip board item
@@ -2164,22 +2536,55 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                {
                        String idElement = __pHitElementResult->GetAttributeValue(L"id");
                        String nameElement = __pHitElementResult->GetAttributeValue(L"name");
+                       String classElement = __pHitElementResult->GetAttributeValue(L"class");
+                       String tagElement  = __pHitElementResult->GetTagName();
+                       String contenteditable = __pHitElementResult->GetAttributeValue("contenteditable");
                        AppLog("MainForm::IDA_PASTE_TEXT_CLICKED id is %ls",idElement.GetPointer());
+                       String str = L"document.getElementsByName('";
+                       str.Append(nameElement);
+                       str.Append("').length");
+                       String* pNameCount = __pWebViewer->EvaluateJavascriptN(str);
+
+                       str.Clear();
+                       str = L"document.getElementsByClassName('";
+                       str.Append(classElement);
+                       str.Append("').length");
+                       String* pClassCount = __pWebViewer->EvaluateJavascriptN(str);
 
                        String script;
-                       if(idElement.GetLength() != 0)
+                       if(contenteditable.Equals(L"true",false) == true)
+                       {
+                               AppLog("gmail paste need to support");
+
+                               script = L"function replaceSelectedText(replacementText) { var sel, range; if (window.getSelection) { sel = window.getSelection(); if (sel.rangeCount) { range = sel.getRangeAt(0); range.deleteContents(); range.insertNode(document.createTextNode(replacementText)); } } else if (document.selection && document.selection.createRange) { range = document.selection.createRange(); range.text = replacementText; } }";
+                               script.Append("replaceSelectedText(");
+                               script.Append("\"");
+                               script.Append(*pString);
+                               script.Append("\");");
+                       }
+                       else if(idElement.GetLength() != 0)
+                       {
+                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   myField.focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (myField.selectionStart || myField.selectionStart == '0'){   var startPos = myField.selectionStart;   var endPos = myField.selectionEnd;   myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);   } else {    myField.value += myValue;   }  } ";
+                               script.Append("insertAtCursor(");
+                               script.Append(L"document.activeElement");
+                               script.Append(",");
+                               script.Append("\"");
+                               script.Append(*pString);
+                               script.Append("\");");
+                       }
+                       else if (classElement.GetLength() != 0 && pClassCount->Equals("1",false) == true)
                        {
-                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   document.getElementById(myField).focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (document.getElementById(myField).selectionStart || document.getElementById(myField).selectionStart == '0'){   var startPos = document.getElementById(myField).selectionStart;   var endPos = document.getElementById(myField).selectionEnd;   document.getElementById(myField).value = document.getElementById(myField).value.substring(0, startPos)+ myValue + document.getElementById(myField).value.substring(endPos, document.getElementById(myField).value.length);   } else {    document.getElementById(myField).value += myValue;   }  } ";
-                               script.Append("insertAtCursor('");
-                               script.Append(idElement);
-                               script.Append("',");
+                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   myField.focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (myField.selectionStart || myField.selectionStart == '0'){   var startPos = myField.selectionStart;   var endPos = myField.selectionEnd;   myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);   } else {    myField.value += myValue;   }  } ";
+                               script.Append("insertAtCursor(document.getElementsByClassName('");
+                               script.Append(classElement);
+                               script.Append("')[0],");
                                script.Append("\"");
                                script.Append(*pString);
                                script.Append("\");");
                        }
-                       else if (nameElement.GetLength() != 0)
+                       else if (nameElement.GetLength() != 0 && pNameCount->Equals("1",false) == true)
                        {
-                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   document.getElementByName(myField)[0].focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (myField.selectionStart || myField.selectionStart == '0'){   var startPos = myField.selectionStart;   var endPos = myField.selectionEnd;   myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);   } else {    document.getElementByName(myField)[0].value += myValue;   }  } ";
+                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   myField.focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (myField.selectionStart || myField.selectionStart == '0'){   var startPos = myField.selectionStart;   var endPos = myField.selectionEnd;   myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);   } else {    myField.value += myValue;   }  } ";
                                script.Append("insertAtCursor(document.getElementsByName('");
                                script.Append(nameElement);
                                script.Append("')[0],");
@@ -2187,11 +2592,24 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                                script.Append(*pString);
                                script.Append("\");");
                        }
+                       else if(tagElement.GetLength() != 0) //adding for twitter post page
+                       {
+                               script = L"function insertAtCursor(myField, myValue) {  if (document.selection) {   myField.focus();   sel = document.selection.createRange();   sel.text = myValue;  }   else if (myField.selectionStart || myField.selectionStart == '0'){   var startPos = myField.selectionStart;   var endPos = myField.selectionEnd;   myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length);   } else {    myField.value += myValue;   }  } ";
+
+                               script.Append("insertAtCursor(document.activeElement,");
+                               script.Append("\"");
+                               script.Append(*pString);
+                               script.Append("\");");
+                       }
                        AppLog("MainForm::OnTouchLongPressed script is %ls",script.GetPointer());
                        String* pStr = __pWebViewer->EvaluateJavascriptN(script);
                        delete pStr;
+                       delete pNameCount;
+                       delete pClassCount;
                }
                delete pItem;
+               if(__pWebViewer)
+                       __pWebViewer->ReleaseBlock();
        }
        break;
        case IDA_GO_BACK:
@@ -2213,7 +2631,13 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 
                String url = __pFooterUrlField->GetText();
                AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer());
-               LoadUrl(url);
+//             LoadUrl(url);
+               if (__pWebViewer != null && __pAddressbar != null)
+               {
+                       LoadUrl(url);
+                       //__pWebViewer->Reload();
+                       SetAddressbarMode((AddressBarMode)ADDRESSBAR_MODE_LOADING);
+               }
 
                //OnUrlSubmitted();
                UpdateProgressBitmap();
@@ -2261,19 +2685,146 @@ MainForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
 void
 MainForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
 {
-
-       UiApp* pApp = UiApp::GetInstance();
-       if (pApp == null)
+       AppLog("MainForm::OnFormBackRequested entered");
+       result r = E_FAILURE;
+       if(__pImageMenu && __pImageMenu->GetShowState() == true)
        {
-               return;
+               AppLog("Hiding the menu");
+               __pImageMenu->SetShowState(false);
+       }
+       if (__pWebViewer && __pWebViewer->CanGoBack())
+       {
+               __pWebViewer->GoBack();
+       }
+       else if(__pWindowInfo && __pWindowInfo->isJavascriptInitiated == false)
+       {
+               UiApp* pApp = null;
+               pApp = UiApp::GetInstance();
+               if (pApp != null)
+               {
+                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+                       if (IsFailed(r))
+                       {
+                               AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+                               return;
+                       }
+               }
+       }
+       else
+       {
+               UiApp* pApp = null;
+               WindowInfo* pWindowInfo = null;
+               int totalCount = 0;
+               SceneManager* pSceneManager = SceneManager::GetInstance();
+               if (pSceneManager == null)
+               {
+                       return;
+               }
+               ArrayList* pAllWindowList = MultipleWindowPresentationModel::GetInstance()->GetAllWindowArrayList();
+               if (pAllWindowList == NULL)
+               {
+                       pApp = UiApp::GetInstance();
+                       if (pApp != null)
+                       {
+                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+                               if (IsFailed(r))
+                               {
+                                       AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+                                       return;
+                               }
+                       }
+               }
+               if (pAllWindowList != null)
+               {
+                       totalCount = pAllWindowList->GetCount();
+               }
+               for (int count = 0; count < totalCount; count++)
+               {
+                       pWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(count));
+                       if (pWindowInfo == null)
+                       {
+                               pApp = UiApp::GetInstance();
+                               if (pApp != null)
+                               {
+                                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+                                       if (IsFailed(r))
+                                       {
+                                               AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+                                               return;
+                                       }
+                               }
+                       }
+                       else
+                       {
+                               if (pWindowInfo && pSceneManager->GetCurrentSceneId() == pWindowInfo->sceneID && pWindowInfo->isJavascriptInitiated == true)
+                               {
+                                       r = SceneRegister::DestroyAndUnRegisterScene(pWindowInfo->sceneID);
+                                       if (IsFailed(r))
+                                       {
+                                               AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+                                               return;
+                                       }
+                                       r = pAllWindowList->RemoveAt(count, true);
+                                       __pWindowInfo = null;
+                                       if (IsFailed(r))
+                                       {
+                                               AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+                                               return;
+                                       }
+                                       if(count > 0)
+                                       {
+                                               pWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(count - 1));
+                                       }
+                                       else
+                                       {
+                                               pWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(pAllWindowList->GetCount() - 1));
+                                       }
+                                       if (pWindowInfo == null)
+                                       {
+                                               pApp = UiApp::GetInstance();
+                                               if (pApp != null)
+                                               {
+                                                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+                                                       return;
+                                               }
+                                       }
+                                       else
+                                       {
+                                               if(pWindowInfo != null)
+                                                       r = pSceneManager->GoForward(ForwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_HISTORY_OPTION_ADD_HISTORY,SCENE_DESTROY_OPTION_DESTROY));
+                                               if (IsFailed(r))
+                                               {
+                                                       AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+                                                       return;
+                                               }
+                                       }
+                                       break;
+                               }
+//                             else if (pWindowInfo && pSceneManager->GetCurrentSceneId() == pWindowInfo->sceneID && pWindowInfo->isJavascriptInitiated == false)
+//                             {
+//                                     UiApp* pApp = null;
+//                                     pApp = UiApp::GetInstance();
+//                                     if (pApp != null)
+//                                     {
+//                                             r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+//                                             if (IsFailed(r))
+//                                             {
+//                                                     AppLogException("MainForm::OnFormBackRequested failed with %s", GetErrorMessage(r));
+//                                                     return;
+//                                             }
+//                                     }
+//                             }
+                       }
+               }
        }
-       pApp->Terminate();
+       AppLog("MainForm::OnFormBackRequested exit");
 }
 
 void
 MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
 {
+
        AppLog("MainForm::OnSceneActivatedN called");
        String* pSelectedScene = NULL;
        Object* pValue = NULL;
@@ -2313,15 +2864,16 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        InitFooter();
        InitAddressbar();
 
-       __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), GetClientAreaBounds().width, __pFooterPanel->GetHeight());
+       FloatRectangle footerPanelBounds = FloatRectangle(0.0f, (GetClientAreaBoundsF().height) - __pFooterPanel->GetHeightF(), GetClientAreaBoundsF().width, __pFooterPanel->GetHeightF());
+       __pFooterPanel->SetBounds(CoordinateSystem::AlignToDevice(footerPanelBounds));
 
        // hiding the address bar
        //      __pAddressbar->SetBounds(__pAddressbar->GetX(), __pAddressbar->GetY() - __pAddressbar->GetHeight(), __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
        __pAddressbar->SetShowState(false);
-       if(__pWebViewer != null)
-       {
-               __pWebViewer->Resume();
-       }
+//     if(__pWebViewer != null)
+//     {
+//             __pWebViewer->Resume();
+//     }
 
        if(pUrl != null && pUrl->GetLength() > 0)
        {
@@ -2329,15 +2881,23 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        }
        else if(__pWindowInfo != null)
        {
-               if(__pWindowInfo->pageUrl.GetLength() > 0 && previousSceneId != IDSCN_MULTIPLE_WINDOW && previousSceneId != IDSCN_MULTIPLE_WINDOW_GRID && previousSceneId != IDSCN_BOOKMARK_VIEW && previousSceneId != IDSCN_SETTINGS && previousSceneId != IDSCN_MAIN_VIEW)
+               if(__pWindowInfo->pageUrl.GetLength() > 0 &&previousSceneId != IDSCN_BRIGHTNESS && previousSceneId != IDSCN_HISTORY_LIST && previousSceneId != IDSCN_MULTIPLE_WINDOW && previousSceneId != IDSCN_MULTIPLE_WINDOW_GRID && previousSceneId != IDSCN_BOOKMARK_VIEW && previousSceneId != IDSCN_SETTINGS && previousSceneId.Contains(IDSCN_MAIN_VIEW) == false)
                {
                        LoadUrl(__pWindowInfo->pageUrl);
                }
-               else if (__pWindowInfo->isJavascriptInitiated == true)
+               else if(__pWindowInfo->pageUrl.GetLength() > 0 && __pWindowInfo->isAppcontrolTriggered == true)
                {
+                       LoadUrl(__pWindowInfo->pageUrl);
+                       __pWindowInfo->isAppcontrolTriggered = false;
+               }
+               else if (__pWindowInfo->isJavascriptInitiated == true && __pWindowInfo->isFirstLaunch == true)
+               {
+                       __pWindowInfo->isFirstLaunch = false;
                        AppLog("Called");
                        InitWebControl();
                        __pWindowInfo->pCurrentWeb = __pWebViewer;
+                       if(__pWindowInfo->pageUrl.GetLength() > 0)
+                               LoadUrl(__pWindowInfo->pageUrl);
                }
        }
 
@@ -2347,7 +2907,7 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
        {
                InitMostVisitedSitesView(GetOrientationStatus());
        }
-       else if (homePage.CompareTo((L"IDS_BR_BODY_BLANK_PAGE")) == 0)
+       else
        {
                if(__pMostVisitedListView != null)
                {
@@ -2355,6 +2915,10 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                }
        }
 
+       if(__pMostVisitedListView && __pMostVisitedListView->GetShowState() == true)
+       {
+               __pMostVisitedListView->UpdateList();
+       }
        if (__pAddressbar != null && pArgs != null && (previousSceneId == IDSCN_BOOKMARK_VIEW || previousSceneId == IDSCN_HISTORY_LIST))
        {
                String* pBookmarkUrl = dynamic_cast< String* >(pArgs->GetAt(0));
@@ -2402,13 +2966,13 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                }
        }
 
-       if (__pMenu != null && __pMenu->GetItemCount() == 3)
+       if (__pOptionMenu != null && __pOptionMenu->GetItemCount() != 9)
        {
-               __pMenu->SetItemAt(0,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY"),IDA_PRIVATEON_CLICKED,*pBitmap);
+               __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap);
        }
-       else if (__pMenu != null )
+       else if (__pOptionMenu != null )
        {
-               __pMenu->SetItemAt(3,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY"),IDA_PRIVATEON_CLICKED,*pBitmap);
+               __pOptionMenu->SetItemAt(5,CommonUtil::GetString(L"IDS_BR_BODY_PRIVACY_AND_SECURITY_ABB"),IDA_PRIVATEON_CLICKED,*pBitmap);
        }
 
        if (pBitmap != null)
@@ -2416,7 +2980,13 @@ MainForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
                delete pBitmap;
        }
 
+       RelayoutControls(false);
        AppLog("ABC: OnSceneActivatedN started exit");
+       if(__pWebViewer)
+       {
+               AppLog("WebControl's width height %d %d,",__pWebViewer->GetWidth(),__pWebViewer->GetHeight());
+               __pWebViewer->Resume();
+       }
 
 }
 
@@ -2428,7 +2998,6 @@ MainForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
        if (__pWebViewer != null)
        {
                pWebCanvas = __pWebViewer->GetCanvasN();
-               __pWebViewer->Pause();
 
        }
        if (pWebCanvas == null)
@@ -2454,12 +3023,22 @@ MainForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
                pCanvas->DrawBitmap(Point(0,0),*pBitmap);
                delete pBitmap;
        }
-       if(__pWebViewer != null && __pWindowInfo != null)
+       if(__pWebViewer != null && __pWindowInfo != null && __pWindowInfo->pWebCanvasBitmap != null)
                pCanvas->DrawBitmap(__pWebViewer->GetPosition(),*__pWindowInfo->pWebCanvasBitmap);
 
        WindowInfo::pFormCanvasBitmap = new(std::nothrow) Bitmap();
-       WindowInfo::pFormCanvasBitmap->Construct(*pCanvas,Rectangle(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height - __pFooterPanel->GetHeight()));
+       if (__pFooterPanel)
+       {
+               WindowInfo::pFormCanvasBitmap->Construct(*pCanvas,Rectangle(0,0,GetClientAreaBounds().width,GetClientAreaBounds().height - __pFooterPanel->GetHeight()));
+       }
        delete pCanvas;
+       delete pWebCanvas;
+       if(__pAddressbar)
+               __pAddressbar->SetShowState(false);
+       if(__pWebViewer)
+       {
+               __pWebViewer->Pause();
+       }
        AppLog("Coming here");
 }
 
@@ -2485,12 +3064,16 @@ MainForm::OnLoadingStarted(void)
        {
                return;
        }
+
        // this is added in case if menu is opened and user load the page
-       if(__pMenu != null && __pMenu->GetShowState() == true)
+       if(__pOptionMenu != null && __pOptionMenu->GetShowState() == true)
        {
-               __pMenu->SetShowState(false);
-               __pMenu->Invalidate(true);
+               __pOptionMenu->SetShowState(false);
+               __pOptionMenu->Invalidate(true);
        }
+
+
+
        if(__pImageMenu != null && __pImageMenu->GetShowState() == true)
        {
                __pImageMenu->SetShowState(false);
@@ -2500,7 +3083,7 @@ MainForm::OnLoadingStarted(void)
        if(url.Contains(IDS_TIZEN_SERVICE))
        {
                String appId;
-               String delim(L":;");
+               String delim(L":;,");
 
                // Creates a StringTokenizer instance
                StringTokenizer strTok(url, delim);
@@ -2521,20 +3104,19 @@ MainForm::OnLoadingStarted(void)
                                token.SubString(6, appId);
                                AppLog("AppID:%ls", appId.GetPointer());
                        }
-                       else if(token.Contains("="))
+                       else if(token.Contains(IDS_KEY))
                        {
-                               String *pKey = new String();
-                               String *pValue = new String();
-                               int index = -1;
-                               token.IndexOf("=", 0, index);
-                               if(index != -1)
-                               {
-                                       token.SubString(0, index, *pKey);
-                                       token.SubString(index + 1, *pValue);
-                                       pMap->Add(pKey, pValue);
-                               }
+                               token.SubString(4, key);
+                               AppLog("key:%ls", key.GetPointer());
+                       }
+                       else if(token.Contains(IDS_VALUE))
+                       {
+                               token.SubString(6, value);
+                               AppLog("value:%ls", value.GetPointer());
                        }
                }
+               pMap->Add(key, value);
+
                if(appId != "")
                {
                        AppControl *pAppControl = null;
@@ -2583,7 +3165,7 @@ MainForm::OnLoadingStarted(void)
                if (__pWindowInfo != NULL)
                {
                        // resetting the page title to blank, it will be received in OnPageTitleReceived()
-                       __pWindowInfo->pageTitle = L"";
+//                     __pWindowInfo->pageTitle = L"";
                        __pWindowInfo->pageUrl = __pWebViewer->GetUrl();
                }
                __pAddressbar->Invalidate(true);
@@ -2597,7 +3179,6 @@ MainForm::OnLoadingCanceled(void)
 
 }
 
-
 void
 MainForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
 {
@@ -2609,20 +3190,24 @@ void
 MainForm::OnKeypadOpened(Tizen::Ui::Control& source)
 {
        AppLog("XYZ::MainForm::OnKeypadOpened");
-
+       __isKeypadOpened = true;
+       __pFooterPanel->SetShowState(false);
+       RelayoutControls(false);
 }
 
 void
 MainForm::OnKeypadClosed(Tizen::Ui::Control& source)
 {
        AppLog("XYZ::MainForm::OnKeypadClosed");
+       __isKeypadOpened = false;
+       __pFooterPanel->SetShowState(true);
        RelayoutControls(true);
 }
 
 void
 MainForm::OnKeypadBoundsChanged(Tizen::Ui::Control &source)
 {
-       AppLog("KeypadBoundsChanged");
+       AppLog("XYZ::KeypadBoundsChanged");
        RelayoutControls(false);
 }
 
@@ -2649,6 +3234,15 @@ MainForm::OnLoadingCompleted(void)
        {
                return;
        }
+
+       if(__pWindowInfo && __pWebViewer)
+               __pWindowInfo->pageTitle = __pWebViewer->GetTitle();
+       if(__pImageMenu && __pImageMenu->GetShowState())
+       {
+               __pImageMenu->SetShowState(false);
+               __pImageMenu->Invalidate(true);
+       }
+
        if (__pWebViewer->CanGoForward())
        {
                //__pAddressbar->SetForwardButtonEnabled(true);
@@ -2707,7 +3301,6 @@ MainForm::OnLoadingCompleted(void)
                                __pHistory->SetFavIconBitmap(*pTempBitmap);
                        }
 
-                       AppLog("MainForm::OnLoadingCompleted setting the fav icon 2");
                }
 
                Canvas* pCanvas = __pWebViewer->GetCanvasN();
@@ -2721,6 +3314,13 @@ MainForm::OnLoadingCompleted(void)
                Bitmap *pFavIcon = __pWebViewer->GetFaviconN();
                if (pFavIcon)
                {
+                       Tizen::Graphics::BufferInfo bmpInfo;
+                       pFavIcon->Lock(bmpInfo);
+                       AppLog("rrrr:: width %d height %d of the faviconbitmap from bufferinfo", bmpInfo.width, bmpInfo.height);
+
+                       AppLog("MainForm::OnLoadingCompleted setting the fav icon 2");
+
+                       AppLog("rrrr:: width %d height %d of the faviconbitmap",pFavIcon->GetWidth(),pFavIcon->GetHeight());
                        __pHistory->SetFavIconBitmap(*pFavIcon);
                        delete pFavIcon;
                }
@@ -2808,7 +3408,8 @@ MainForm::OnLoadingCompleted(void)
 void
 MainForm::OnEstimatedProgress(int progress)
 {
-       AppLogDebug("MainForm::OnEstimatedProgress entered");
+       AppLogDebug("MainForm::OnEstimatedProgress entered %d",progress);
+
        if (progress < DEFAULT_PROGRESS_PERCENTAGE)
                progress = DEFAULT_PROGRESS_PERCENTAGE;
        //if(__pAddressbar)
@@ -2843,8 +3444,12 @@ MainForm::OnUrlSubmitted(Addressbar& addBar)
        String url = addBar.GetUrl();
        AppLog("MainForm::OnUrlSubmitted url is %ls", url.GetPointer());
 
+
        if(__pFooterUrlField)
+       {
+               AppLog("Position:: %d, %ls",__pFooterUrlField->GetTextLength(),__pFooterUrlField->GetText().GetPointer());
                __pFooterUrlField->SetCursorPosition(__pFooterUrlField->GetTextLength());
+       }
        AddressBarCancelledClicked(*__pAddressbar);
        LoadUrl(url);
 }
@@ -2890,6 +3495,8 @@ MainForm::LoadUrl(String& url)
        ret = firstRegex.Match(url, false); // This returns true value
        flag = secondRegex.Match(url, false);  // Checks whether URL typed is of type  abc.com (i.e without protocol in front of it)
 
+
+
        if (ret == true && __pWebViewer != null)
        {
                SetUrl(url);
@@ -2906,7 +3513,7 @@ MainForm::LoadUrl(String& url)
                }
                else
                {
-                               UrlEncoder::Encode(url, L"UTF-8", encodedUrl);
+                       UrlEncoder::Encode(url, L"UTF-8", encodedUrl);
                        __pWebViewer->LoadUrl(SettingPresentationModel::GetInstance()->GetSearchUrl(encodedUrl));
                }
        }
@@ -2923,6 +3530,62 @@ MainForm::LoadUrl(String& url)
 }
 
 void
+MainForm::OnFocusGained(const Tizen::Ui::Control& source)
+{
+       AppLog("MainForm::OnFocusGained");
+       if(__pFooterPanel)
+       {
+               __pFooterPanel->SetShowState(false);
+       }
+
+       if(__pWebViewer)
+       {
+               __pWebViewer->ReleaseBlock();
+       }
+
+       if(__pAddressbar)
+       {
+               __pAddressbar->SetShowState(true);
+               __pAddressbar->SetAddressbarURLFocus();
+       }
+       if(__pFindWordControl && __pFindWordControl->GetShowState() == true)
+       {
+               __currentSearchStr = L"";
+               __currentWordIndex = 0;
+               __maxOccurrances = 0;
+
+               if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true)
+               {
+                       __pFindWordEditField->SetText(L"");
+                       __pFindWordEditField->HideKeypad();
+                       __pFindWordControl->SetShowState(false);
+                       __pFindWordCountLabel->SetText(L"0/0");
+               }
+               else if(__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true)
+               {
+                       __pFindWordEditFieldRightToLeft->SetText(L"");
+                       __pFindWordEditFieldRightToLeft->HideKeypad();
+                       __pFindWordControl->SetShowState(false);
+                       __pFindWordCountLabelRightToLeft->SetText(L"0/0");
+               }
+
+               __pFindWordNext->SetEnabled(false);
+               __pFindWordPrev->SetEnabled(false);
+
+               if(__pWebViewer)
+                       __pWebViewer->SearchTextAllAsync(L"",true);
+               __pFindWordControl->SetShowState(false);
+       }
+       RelayoutControls(false);
+}
+
+void
+MainForm::OnFocusLost(const Tizen::Ui::Control& source)
+{
+       AppLog("MainForm::OnFocusLost called");
+}
+
+void
 MainForm::OnStopClicked(Addressbar& addBar)
 {
        AppLogDebug("MainForm::OnStopClicked called");
@@ -2938,8 +3601,13 @@ MainForm::OnStopClicked(Addressbar& addBar)
 void
 MainForm::OnBackClicked(/*const Addressbar& addBar*/)
 {
-//     AppLog("MainForm::OnBackClicked");
+       //      AppLog("MainForm::OnBackClicked");
        result r = E_FAILURE;
+       if(__pImageMenu && __pImageMenu->GetShowState() == true)
+       {
+               AppLog("Hiding the menu");
+               __pImageMenu->SetShowState(false);
+       }
 
        if (__pWebViewer && __pWebViewer->CanGoBack())
        {
@@ -2951,7 +3619,7 @@ MainForm::OnBackClicked(/*const Addressbar& addBar*/)
                pApp = UiApp::GetInstance();
                if (pApp != null)
                {
-                       r = pApp->Terminate();
+                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                        if (IsFailed(r))
                        {
                                AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -2975,7 +3643,7 @@ MainForm::OnBackClicked(/*const Addressbar& addBar*/)
                        pApp = UiApp::GetInstance();
                        if (pApp != null)
                        {
-                               r = pApp->Terminate();
+                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                if (IsFailed(r))
                                {
                                        AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -2995,7 +3663,7 @@ MainForm::OnBackClicked(/*const Addressbar& addBar*/)
                                pApp = UiApp::GetInstance();
                                if (pApp != null)
                                {
-                                       r = pApp->Terminate();
+                                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                        if (IsFailed(r))
                                        {
                                                AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -3022,22 +3690,33 @@ MainForm::OnBackClicked(/*const Addressbar& addBar*/)
                                {
                                        pWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(count - 1));
                                }
-                               else
+                               else if(pAllWindowList->GetCount() > 0)
                                {
                                        pWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(pAllWindowList->GetCount() - 1));
                                }
+                               else
+                               {
+                                       pApp = UiApp::GetInstance();
+                                       if (pApp != null)
+                                       {
+                                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+                                               return;
+                                       }
+
+                               }
                                if (pWindowInfo == null)
                                {
                                        pApp = UiApp::GetInstance();
                                        if (pApp != null)
                                        {
-                                               r = pApp->Terminate();
+                                               r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
                                                return;
                                        }
                                }
                                else
                                {
-                                       r = pSceneManager->GoBackward(BackwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE));
+                                       r = pSceneManager->GoForward(ForwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_HISTORY_OPTION_ADD_HISTORY,SCENE_DESTROY_OPTION_DESTROY));
+//                                     r = pSceneManager->GoBackward(BackwardSceneTransition(pWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE));
                                        if (IsFailed(r))
                                        {
                                                AppLogException("OnActionPerformed failed with %s", GetErrorMessage(r));
@@ -3085,17 +3764,12 @@ MainForm::OnAddressBarFocusGained(const Addressbar& addBar)
 }
 
 void
-MainForm::OnAddressBarFocusLost(const Addressbar& addBar)
+MainForm::OnAddressBarFocusLost(const Addressbar& addBar, bool addressbarKeyPadState)
 {
        AppLog("XYZ::MainForm::OnAddressBarFocusLost");
 
-       if(__pAddressbar)
-               __pAddressbar->SetShowState(false);
-       if(__pFooterPanel)
-       {
-               AppLog("akjshdasd 3");
-               __pFooterPanel->SetShowState(true);
-       }
+       int Height = GetClientAreaBounds().height;
+       AppLog("MainForm::OnAddressBarFocusLost height is %d",Height);
 
        RelayoutControls(false);
 }
@@ -3122,6 +3796,7 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/)
                if (__pAddressbar != null)
                {
                        __webControlPosition.y = __pAddressbar->GetHeight() - 12;
+                       __webControlPositionF.y = __pAddressbar->GetHeightF() - 12.0f;
                        __pAddressbar->SetBounds(Rectangle(0,0,GetClientAreaBounds().width,__pAddressbar->GetHeight()));
                        __pAddressbar->Invalidate(true);
                }
@@ -3136,6 +3811,7 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/)
                if (__pAddressbar != null)
                {
                        __webControlPosition.y = 0;
+                       __webControlPositionF.y = 0.0f;
                        __pAddressbar->SetBounds(Rectangle(0, __pAddressbar->GetY() - __pAddressbar->GetHeight(), GetClientAreaBounds().width, __pAddressbar->GetHeight()));
                        __pAddressbar->Invalidate(true);
                }
@@ -3145,43 +3821,71 @@ MainForm::OnAddressBarModeChanged(/*const Addressbar& addBar*/)
 void
 MainForm::OnClipboardClosed(const Addressbar& addBar)
 {
+       AppLog("XYZ::MainForm::OnClipboardClosed");
+       if (__pFooterPanel && __pAddressbar->GetShowState() == false)
+       {
+               AppLog("akjshdasd 3");
+               __pFooterPanel->SetShowState(true);
+       }
+       __isKeypadOpened = false;
        RelayoutControls(false);
 }
 
 void
 MainForm::OnAddressBarKeypadClosed(const Addressbar& addBar, bool footerState)
 {
+       AppLog("XYZ::MainForm::OnAddressBarKeypadClosed");
+       if (__pFooterPanel && __pAddressbar->GetShowState() == false)
+       {
+               AppLog("akjshdasd 3");
+               __pFooterPanel->SetShowState(true);
+       }
+       __isKeypadOpened = false;
+       if(__pNotification && __pNotification->GetShowState())
+       {
+               __pNotification->SetPosition(0,GetClientAreaBounds().height - __pNotification->GetHeight());
+       }
+
        RelayoutControls(false,footerState);
 }
 
 void
 MainForm::OnAddressBarKeypadOpened(const Addressbar& addBar)
 {
+       AppLog("XYZ::MainForm::OnAddressBarKeypadOpened");
+       __isKeypadOpened = true;
+       if(__pNotification && __pNotification->GetShowState())
+       {
+               __pNotification->SetPosition(0,GetClientAreaBounds().height - __pNotification->GetHeight());
+       }
        RelayoutControls(false);
 }
 
 void
 MainForm::OnAddressBarKeypadWillOpen(const Addressbar& addBar)
 {
+       __isKeypadOpened = true;
        __pFooterPanel->SetShowState(false);
 }
 
 void
 MainForm::OnAddressBarKeypadBoundsChanged(const Addressbar& addBar)
 {
-       AppLog("KeypadBoundsChanged");
+       AppLog("XYZ::MainForm::OnAddressBarKeypadBoundsChanged");
        RelayoutControls(false);
 }
 
 void
 MainForm::OnPageTitleReceived(const Tizen::Base::String& title)
 {
+       AppLog("MainForm::OnPageTitleReceived %ls",title.GetPointer());
        if (__pWindowInfo)
        {
                __pWindowInfo->pageTitle = title;
                if (__pWebViewer != null)
                {
                        __pWindowInfo->pageUrl = __pWebViewer->GetUrl();
+                       AppLog("MainForm::OnPageTitleReceived url %ls",__pWindowInfo->pageUrl.GetPointer());
                }
        }
        if (__pAddressbar != null && __pWebViewer != null)
@@ -3194,8 +3898,11 @@ MainForm::OnPageTitleReceived(const Tizen::Base::String& title)
 void
 MainForm::UpdateFavicon(void)
 {
+       AppLog("MainForm::UpdateFavicon called");
        bool urlImageType = false;
-       String *tempPath = __pWebViewer->EvaluateJavascriptN(L"var getFavicon = function() {      var favicon = '/favicon.ico';      var nodeList = document.getElementsByTagName('link');    if(nodeList) {  for (var i = 0; i < nodeList.length; i++)      {          if ((nodeList[i].getAttribute('rel') == 'icon')||(nodeList[i].getAttribute('rel') == 'shortcut icon'))         {              favicon = nodeList[i].getAttribute('href');          }      } }     return favicon;          };  getFavicon();");
+       String *tempPath = null;
+       if(__pWebViewer)
+               tempPath = __pWebViewer->EvaluateJavascriptN(L"var getFavicon = function() {      var favicon = '/favicon.ico';      var nodeList = document.getElementsByTagName('link');    if(nodeList) {  for (var i = 0; i < nodeList.length; i++)      {          if ((nodeList[i].getAttribute('rel') == 'icon')||(nodeList[i].getAttribute('rel') == 'shortcut icon'))         {              favicon = nodeList[i].getAttribute('href');          }      } }     return favicon;          };  getFavicon();");
        Bitmap* pBitmap = null;
 
        if (tempPath && tempPath->GetLength() > 0 && tempPath->CompareTo(L"undefined") != 0)
@@ -3207,7 +3914,8 @@ MainForm::UpdateFavicon(void)
                        if (url.GetHost().GetLength() == 0)
                        {
                                Uri webUrl;
-                               webUrl.SetUri(__pWebViewer->GetUrl());
+                               if(__pWebViewer)
+                                       webUrl.SetUri(__pWebViewer->GetUrl());
                                result r = url.SetHost(webUrl.GetHost());
                                if(IsFailed(r))
                                {
@@ -3218,7 +3926,8 @@ MainForm::UpdateFavicon(void)
                        if (url.GetScheme().GetLength() == 0)
                        {
                                Uri webUrl;
-                               webUrl.SetUri(__pWebViewer->GetUrl());
+                               if(__pWebViewer)
+                                       webUrl.SetUri(__pWebViewer->GetUrl());
                                url.SetScheme(webUrl.GetScheme());
                        }
                        __pWindowInfo->faviconUrl = url.ToString();
@@ -3227,6 +3936,7 @@ MainForm::UpdateFavicon(void)
 
                        if (pBitmap != null)
                        {
+                               AppLog("__pWindowInfo->pFavicon updating favicon");
                                if (__pWindowInfo->pFavicon != NULL)
                                {
                                        __pWindowInfo->pFavicon = null;
@@ -3250,6 +3960,11 @@ MainForm::UpdateFavicon(void)
                                        __pAddressbar->SetFaviconBitmap(*pDefaultBmp);
                                }
                        }
+                       if(pBitmap)
+                       {
+                               delete pBitmap;
+                               pBitmap = null;
+                       }
                }
                delete tempPath;
        }
@@ -3265,11 +3980,11 @@ MainForm::UpdateFavicon(void)
 
 }
 
-
 bool
 MainForm::OnLoadingRequested(const Tizen::Base::String& url,
                Tizen::Web::Controls::WebNavigationType type)
 {
+       AppLog("urlk %ls",url.GetPointer());
        // when load new page if find word panel is open its show state is false
        if(__pFindWordControl && __pFindWordControl->GetShowState() == true)
        {
@@ -3285,8 +4000,6 @@ MainForm::OnLoadingRequested(const Tizen::Base::String& url,
                RelayoutControls(false);
        }
 
-
-
        __pFooterPanel->Invalidate(true);
 
        Uri uriInfo;
@@ -3317,20 +4030,19 @@ MainForm::OnLoadingRequested(const Tizen::Base::String& url,
                                token.SubString(6, appId);
                                AppLog("AppID:%ls", appId.GetPointer());
                        }
-                       else if(token.Contains("="))
+                       else if(token.Contains(IDS_KEY))
                        {
-                               String *pKey = new String();
-                               String *pValue = new String();
-                               int index = -1;
-                               token.IndexOf("=", 0, index);
-                               if(index != -1)
-                               {
-                                       token.SubString(0, index, *pKey);
-                                       token.SubString(index + 1, *pValue);
-                                       pMap->Add(pKey, pValue);
-                               }
+                               token.SubString(4, key);
+                               AppLog("key:%ls", key.GetPointer());
+                       }
+                       else if(token.Contains(IDS_VALUE))
+                       {
+                               token.SubString(6, value);
+                               AppLog("value:%ls", value.GetPointer());
                        }
                }
+               pMap->Add(key, value);
+
                if(appId != "")
                {
                        AppControl *pAppControl = null;
@@ -3358,11 +4070,13 @@ MainForm::OnWebDataReceived(const Tizen::Base::String& mime,
        return Tizen::Web::Controls::WEB_DECISION_CONTINUE;
 }
 
-
 void
-MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graphics::Point& startPoint, Tizen::Graphics::Point& endPoint)
+MainForm::OnWebPageBlockSelected(Web& source, FloatPoint& startPoint, FloatPoint& endPoint)
 {
-       AppLog("MainForm::OnWebPageBlockSelected");
+       AppLog("LMN::MainForm::OnWebPageBlockSelected");
+//     if(__isLongPressedDone == false)
+//             return;
+
        if (__pHitElementResult != null)
        {
                delete __pHitElementResult;
@@ -3373,9 +4087,20 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph
        {
                AppLog("MainForm::OnWebPageBlockSelected web not null");
                __pHitElementResult = __pWebViewer->GetElementByPointN(startPoint);
-               if(GetLastResult() == E_INVALID_ARG)
+
+               if(GetLastResult() == E_INVALID_ARG || (__pHitElementResult->GetTagName().Equals(L"INPUT",false) == false && __pHitElementResult->GetTagName().Equals(L"TEXTAREA",false) == false))
                {
+                       AppLog("datafirst startpoint error %s",GetErrorMessage(GetLastResult()));
                        __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint);
+                       if(GetLastResult() == E_INVALID_ARG || (__pHitElementResult->GetTagName().Equals(L"INPUT",false) == false && __pHitElementResult->GetTagName().Equals(L"TEXTAREA",false) == false))
+                       {
+                               __pHitElementResult = __pWebViewer->GetElementByPointN(__longPressPoint);
+                               if(__pHitElementResult == null)
+                               {
+                                       __pHitElementResult = __pWebViewer->GetElementByPointN(endPoint);
+                               }
+                       }
+                       AppLog("datafirst endpoint error %s",GetErrorMessage(GetLastResult()));
                }
        }
 
@@ -3388,22 +4113,36 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph
        {
                String tagName = __pHitElementResult->GetTagName();
                String type = __pHitElementResult->GetAttributeValue("type");
+               String contenteditable = __pHitElementResult->GetAttributeValue("contenteditable");
+
 
+               AppLog("TagName %ls",tagName.GetPointer());
                __currentSelectedStr.Clear();
                AppLog("__currentSelectedStr after clear %ls",__currentSelectedStr.GetPointer());
                __currentSelectedStr = __pWebViewer->GetTextFromBlock();
                AppLog("__currentSelectedStr after GetTextFromBlock %ls",__currentSelectedStr.GetPointer());
+               if(tagName.Equals(L"TEXTAREA",false) == true)
+               {
+                       AppLog("Tagnameseemstobe TEXTAREA");
+               }
+               else if(tagName.Equals(L"INPUT",false) == true)
+               {
+                       AppLog("Tagnameseemstobe INPUT");
+               }
 
-               if (((tagName.CompareTo(L"INPUT") == 0)  || tagName.CompareTo(L"TEXTAREA") == 0) && __isLongPressedDone == true)
+               if (((tagName.Equals(L"INPUT",false) == true)  || tagName.Equals(L"TEXTAREA",false) == true) || contenteditable.Equals(L"true",false) == true/*&& __isLongPressedDone == true*/ && __currentSelectedStr.CompareTo(L"") !=0 )
                {
                        AppLog("MainForm::OnWebPageBlockSelected show paste option");
 
-                       InitSelectTextContextMenu(endPoint,true);
-                       __pImageMenu->SetShowState(true);
-                       __pImageMenu->Show();
-                       __pImageMenu->Invalidate(true);
+                       InitSelectTextContextMenuF(FloatPoint(startPoint.x,startPoint.y + __pWebViewer->GetY()),true);
+                       if(__pImageMenu)
+                       {
+                               __pImageMenu->SetShowState(true);
+                               __pImageMenu->Show();
+                               __pImageMenu->Invalidate(true);
+                       }
                }
-               else if(__isLongPressedDone == true)
+               else /*if(__isLongPressedDone == true)*/
                {
                        AppLog("MainForm::OnWebPageBlockSelected no paste option");
 
@@ -3412,10 +4151,13 @@ MainForm::OnWebPageBlockSelected(Tizen::Web::Controls::Web& source, Tizen::Graph
                                __currentSelectedStr.Clear();
                                __currentSelectedStr = __pHitElementResult->GetUrl();
                        }
-                       InitSelectTextContextMenu(endPoint,false);
-                       __pImageMenu->SetShowState(true);
-                       __pImageMenu->Show();
-                       __pImageMenu->Invalidate(true);
+                       InitSelectTextContextMenuF(FloatPoint(startPoint.x,startPoint.y + __pWebViewer->GetY()),false);
+                       if(__pImageMenu)
+                       {
+                               __pImageMenu->SetShowState(true);
+                               __pImageMenu->Show();
+                               __pImageMenu->Invalidate(true);
+                       }
                }
 
                AppLog("MainForm::OnWebPageBlockSelected block text is %ls",__currentSelectedStr.GetPointer());
@@ -3434,7 +4176,8 @@ MainForm::OnWebPageShowRequested(Tizen::Web::Controls::Web& source)
 Web*
 MainForm::OnWebWindowCreateRequested(void)
 {
-       WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewScene();
+       AppLog("MainForm::OnWebWindowCreateRequested entered");
+       WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN();
 
        if (pNewWindowInfo == null)
        {
@@ -3471,37 +4214,151 @@ MainForm::OnWebWindowCreateRequested(void)
 }
 
 void
+MainForm::OnWebWindowCloseRequested(Tizen::Web::Controls::Web& source)
+{
+       AppLog("OnWebWindowCloseRequested");
+       ArrayList* pAllWindowList = MultipleWindowPresentationModel::GetInstance()->GetAllWindowArrayList();
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+       WindowInfo* pWindowInfo = null;
+       WindowInfo* pNewWindowInfo = null;
+       int totalCount = 0;
+       UiApp* pApp = null;
+       result r = E_FAILURE;
+
+       if (pAllWindowList != null)
+       {
+               totalCount = pAllWindowList->GetCount();
+       }
+
+       for (int count = 0; count < totalCount; count++)
+       {
+               pWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(count));
+
+               if (__pWindowInfo != null && pWindowInfo != null && __pWindowInfo->sceneID == pWindowInfo->sceneID)
+               {
+                       r = SceneRegister::DestroyAndUnRegisterScene(__pWindowInfo->sceneID);
+                       r = pAllWindowList->RemoveAt(count, true);
+
+                       Form* pCurrentForm = null;
+                       if(SceneManager::GetInstance()->GetCurrentScene() != null)
+                               pCurrentForm = (SceneManager::GetInstance()->GetCurrentScene()->GetForm());
+                       if (pCurrentForm)
+                       {
+                               pCurrentForm->SendUserEvent(UPDATE_MAINFORM_FOOTER_ON_WINDOWCLOSED, null);
+                       }
+
+                       if (pAllWindowList->GetCount() > 0)
+                       {
+                               pNewWindowInfo = null;
+                               pNewWindowInfo = dynamic_cast< WindowInfo* >(pAllWindowList->GetAt(pAllWindowList->GetCount() - 1));
+                       }
+                       else
+                       {
+                               WindowInfo* pNewWindowInfo = MultipleWindowPresentationModel::GetInstance()->CreateNewMainViewSceneN();
+
+                               if (pNewWindowInfo == null)
+                               {
+                                       return;
+                               }
+                               result r = E_SUCCESS;
+                               SceneManager* pSceneManager = SceneManager::GetInstance();
+                               if (pSceneManager == NULL)
+                               {
+                                       return;
+                               }
+                               ArrayList* pArgList = new(std::nothrow) ArrayList();
+                               if (pArgList == NULL)
+                               {
+                                       return;
+                               }
+                               r = pArgList->Construct();
+                               if (r == E_SUCCESS)
+                               {
+                                       pArgList->Add(*pNewWindowInfo);
+                                       result r = pSceneManager->GoForward(ForwardSceneTransition(pNewWindowInfo->sceneID, SCENE_TRANSITION_ANIMATION_TYPE_NONE),pArgList);
+                                       if (pArgList != null)
+                                       {
+                                               delete pArgList;
+                                               pArgList = null;
+                                       }
+                                       if(IsFailed(r))
+                                       {
+                                               AppLogDebug("MultipleWindowForm::OnActionPerformed GoForward failed %s",GetErrorMessage(r));
+                                               return;
+                                       }
+                               }
+
+                               pApp = UiApp::GetInstance();
+                               if (pApp != null)
+                               {
+                                       r = pApp->GetFrameAt(0)->SetShowMode(FRAME_SHOW_MODE_MINIMIZED);
+                                       return;
+                               }
+                       }
+                       if(pNewWindowInfo)
+                               r = pSceneManager->GoForward(ForwardSceneTransition(pNewWindowInfo->sceneID ,SCENE_TRANSITION_ANIMATION_TYPE_NONE,SCENE_HISTORY_OPTION_ADD_HISTORY,SCENE_DESTROY_OPTION_DESTROY));
+
+                       break;
+               }
+
+       }
+
+
+}
+
+void
 MainForm::RelayoutControls(bool showAddressbar,bool relayoutFooter)
 {
+       AppLog("xyz:: MainForm::RelayoutControls called");
        __webControlPosition.y = 0;
+       __webControlPositionF.y = 0.0f;
        __webControlHeight = GetClientAreaBounds().height;
-       AppLog("Client area height: %d", __webControlHeight);
+       __webControlHeightF = GetClientAreaBoundsF().height;
+       AppLog("Client area height: %d width %d", __webControlHeight,GetClientAreaBounds().width);
 
        AppLog("Client area height: %d", __webControlHeight);
        if(__pAddressbar != null && __pAddressbar->GetShowState() == true)
        {
                __webControlPosition.y += __pAddressbar->GetHeight();
+               __webControlPositionF.y += __pAddressbar->GetHeightF();
                __webControlHeight -= __pAddressbar->GetHeight();
+               __webControlHeightF -= __pAddressbar->GetHeightF();
                __pAddressbar->SetBounds(0, 0, __pAddressbar->GetWidth(), __pAddressbar->GetHeight());
        }
        else if(__pFindWordControl != null && __pFindWordControl->GetShowState() == true)
        {
                __webControlPosition.y += __pFindWordControl->GetHeight();
+               __webControlPositionF.y += __pFindWordControl->GetHeightF();
                __webControlHeight -= __pFindWordControl->GetHeight();
+               __webControlHeightF -= __pFindWordControl->GetHeightF();
                __pFindWordControl->SetBounds(0, 0, GetClientAreaBounds().width, __pFindWordControl->GetHeight());
        }
 
        if(__pFooterPanel != null && __pFooterPanel->GetShowState() == true && relayoutFooter == true)
        {
                __webControlHeight -= __pFooterPanel->GetHeight();
+               __webControlHeightF -= __pFooterPanel->GetHeightF();
 
-               __pFooterPanel->SetBounds(0, __webControlPosition.y + __webControlHeight, GetClientAreaBounds().width, __pFooterPanel->GetHeight());
+               __pFooterPanel->SetBounds(CoordinateSystem::AlignToDevice(FloatRectangle(0.0F, __webControlPositionF.y + __webControlHeightF, GetClientAreaBoundsF().width, __pFooterPanel->GetHeightF())));
+               __webControlHeight = __webControlHeight + 12;
+               __webControlHeightF = __webControlHeightF + 12.0f;
        }
+
+
+
        if (__pWebViewer != null && __pWebViewer->GetShowState() == true)
        {
-               __pWebViewer->SetBounds(0, __webControlPosition.y, GetClientAreaBounds().width, __webControlHeight + 12);
-               __pWebViewer->Invalidate(false);
+               if(__pWebViewer->GetX() == 0 && __pWebViewer->GetY() == __webControlPosition.y &&__pWebViewer->GetWidth() == GetClientAreaBounds().width &&__pWebViewer->GetHeight() == __webControlHeight )
+               {
+               }
+               else
+               {
+                       __pWebViewer->SetBounds(CoordinateSystem::AlignToDevice(FloatRectangle(0.0f, __webControlPositionF.y, GetClientAreaBoundsF().width, __webControlHeightF)));
+                       AppLog("xyz:: MainForm::RelayoutControls called __webControlHeight %d",__webControlHeight);
+                       __pWebViewer->Invalidate(false);
+               }
        }
+
        if(__pMostVisitedListView != null && __pAddressbar != null && __pFooterPanel != null)
        {
                __pMostVisitedListView->SetBounds(Tizen::Graphics::Rectangle(0,__webControlPosition.y , GetClientAreaBounds().width, __webControlHeight));
@@ -3517,12 +4374,50 @@ MainForm::ShowFindWordPanel(bool show , bool isTouchPressed)
        {
                return;
        }
+
+       Tizen::Locales::LocaleManager localeManager;
+       Tizen::Locales::Locale local = localeManager.GetSystemLocale();
+
+       String languageCode;
+       result r = SettingInfo::GetValue(L"Language", languageCode);
+       // int languagecode = local.GetLanguageCode();
+       AppLog("rahul language is %S", languageCode.GetPointer());
+
        if (show == true)
        {
                InitFindWordPanel();
-//             __pFindWordEditField->SetText(__currentSearchStr);
-               //__pFindWordCountLabel->SetText(L"");
-//             __pFindWordCountLabel->SetText(L"0/0");
+
+               if (languageCode.CompareTo("ara") == 0)
+               {
+                       AppLog("rahul language is arabic");
+
+                       __pFindWordPanelLeftToRight->SetShowState(false);
+                       __pFindWordPanelRightToLeft->SetShowState(true);
+
+                       __pFindWordClear->SetShowState(false);
+                       __pFindWordCountLabel->SetShowState(false);
+                       __pFindWordEditField->SetShowState(false);
+
+                       __pFindWordClearRightToLeft->SetShowState(true);
+                       __pFindWordCountLabelRightToLeft->SetShowState(true);
+                       __pFindWordEditFieldRightToLeft->SetShowState(true);
+               }
+               else
+               {
+                       AppLog("rahul language is not arabic");
+
+
+                       __pFindWordPanelLeftToRight->SetShowState(true);
+                       __pFindWordPanelRightToLeft->SetShowState(false);
+
+                       __pFindWordClear->SetShowState(true);
+                       __pFindWordCountLabel->SetShowState(true);
+                       __pFindWordEditField->SetShowState(true);
+
+                       __pFindWordClearRightToLeft->SetShowState(false);
+                       __pFindWordCountLabelRightToLeft->SetShowState(false);
+                       __pFindWordEditFieldRightToLeft->SetShowState(false);
+               }
                __pFindWordControl->SetShowState(true);
        }
        else
@@ -3536,16 +4431,35 @@ MainForm::ShowFindWordPanel(bool show , bool isTouchPressed)
        AppLog("MainForm::ShowFindWordPanel %d",show);
        if (show && !isTouchPressed)
        {
-               if (__pFindWordEditField)
+               if (languageCode.CompareTo("ara") == 0)
                {
-                       __pFindWordEditField->SetFocus();
-                       __pFindWordEditField->ShowKeypad();
+                       if (__pFindWordEditFieldRightToLeft)
+                       {
+                               __pFindWordEditFieldRightToLeft->SetFocus();
+                               __pFindWordEditFieldRightToLeft->ShowKeypad();
+                       }
+               }
+               else
+               {
+                       if (__pFindWordEditField)
+                       {
+                               __pFindWordEditField->SetFocus();
+                               __pFindWordEditField->ShowKeypad();
+                       }
                }
        }
        else
        {
-               if (__pFindWordEditField)
-                       __pFindWordEditField->HideKeypad();
+               if (languageCode.CompareTo("ara") == 0)
+               {
+                       if (__pFindWordEditFieldRightToLeft)
+                               __pFindWordEditFieldRightToLeft->HideKeypad();
+               }
+               else
+               {
+                       if (__pFindWordEditField)
+                               __pFindWordEditField->HideKeypad();
+               }
        }
 
        RelayoutControls(false);
@@ -3560,7 +4474,12 @@ MainForm::StartWordSearch()
 
        __pFindWordPrev->SetEnabled(false);
        String *pCountStr = null;
-       __pWebViewer->SearchTextAllAsync(__currentSearchStr, false);
+       if (__pWebViewer)
+       {
+               result r = __pWebViewer->SearchTextAllAsync(__currentSearchStr, false);
+               AppLog("Search Result %s",GetErrorMessage(r));
+       }
+
        /*__pWebViewer->EvaluateJavascriptN(L"document.body.textContent.match(/"  + __currentSearchStr + "/gi).length;");
        if (pCountStr != null)
        {
@@ -3578,21 +4497,38 @@ void MainForm::OnTextFound(int totalCount, int currentOrdinal)
        AppLog("MainForm::OnTextFound totalCount %d",totalCount);
        AppLog("MainForm::OnTextFound currentOrdinal %d",currentOrdinal);
 
-       if(totalCount == -1 || totalCount == 0)
+       if(totalCount <= 9)
        {
-               __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),84,__pFindWordCountLabel->GetHeight());
-               __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight());
-//             return;
+               if (__pFindWordCountLabel)
+               {
+                       __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),84,__pFindWordCountLabel->GetHeight());
+               }
+               if (__pFindWordEditField)
+               {
+                       __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight());
+               }
        }
-       else if(totalCount > 100)
+       else if(totalCount >= 100)
        {
-               __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
-               __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+               if (__pFindWordCountLabel)
+               {
+                       __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
+               }
+               if (__pFindWordEditField)
+               {
+                       __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+               }
        }
        else
        {
-               __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
-               __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+               if (__pFindWordCountLabel)
+               {
+                       __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
+               }
+               if (__pFindWordEditField)
+               {
+                       __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+               }
        }
 
        __maxOccurrances = totalCount;
@@ -3603,36 +4539,61 @@ void MainForm::OnTextFound(int totalCount, int currentOrdinal)
        {
                AppLog("Word not found");
                //Show error notification to user
-               __pFindWordNext->SetEnabled(false);
-               __pFindWordCountLabel->SetText(L"0/0");
-               __pFindWordNext->Invalidate(false);
+               if(__pFindWordNext)
+                       __pFindWordNext->SetEnabled(false);
+               if(__pFindWordCountLabel && __pFindWordCountLabel->GetShowState() == true)
+               {
+                       __pFindWordCountLabel->SetText(L"0/0");
+                       __pFindWordCountLabel->Invalidate(false);
+               }
+               else if(__pFindWordCountLabelRightToLeft && __pFindWordCountLabelRightToLeft->GetShowState() == true)
+               {
+                       __pFindWordCountLabelRightToLeft->SetText(L"0/0");
+                       __pFindWordCountLabelRightToLeft->Invalidate(false);
+               }
+               if(__pFindWordNext)
+                       __pFindWordNext->Invalidate(false);
                __pFindWordPrev->Invalidate(false);
-               __pFindWordCountLabel->Invalidate(false);
+
                return;
        }
 
-       if (totalCount == 1)
+       if (totalCount == 1 || totalCount == currentOrdinal)
        {
-               __pFindWordNext->SetEnabled(false);
+               if(__pFindWordNext)
+                       __pFindWordNext->SetEnabled(false);
        }
        else
        {
-               __pFindWordNext->SetEnabled(true);
+               if(__pFindWordNext)
+                       __pFindWordNext->SetEnabled(true);
        }
 
        String countStr = L"";
        countStr.Append(__currentWordIndex);
        countStr.Append(L"/");
        countStr.Append(__maxOccurrances);
+       if (__pFindWordCountLabel && __pFindWordCountLabel->GetShowState() == true)
+       {
        __pFindWordCountLabel->SetText(countStr);
-       //      __pFindWordCountLabel->SetShowState(true);
        __pFindWordCountLabel->Invalidate(false);
-
-       //FindNextWord(true);
-       //Update the controls
-       __pFindWordNext->Invalidate(false);
-       __pFindWordPrev->Invalidate(false);
        __pFindWordCountLabel->Invalidate(false);
+       }
+       else if (__pFindWordCountLabelRightToLeft && __pFindWordCountLabelRightToLeft->GetShowState() == true)
+       {
+               __pFindWordCountLabelRightToLeft->SetText(countStr);
+               __pFindWordCountLabelRightToLeft->Invalidate(false);
+               __pFindWordCountLabelRightToLeft->Invalidate(false);
+       }
+       if (__pFindWordNext)
+       {
+               __pFindWordNext->Invalidate(false);
+       }
+       if (__pFindWordPrev)
+       {
+               __pFindWordPrev->Invalidate(false);
+       }
+
 }
 
 void
@@ -3640,17 +4601,19 @@ MainForm::FindNextWord(bool next)
 {
        if (next == true)
        {
-               if (__pWebViewer->SearchText(__currentSearchStr, true) == true)
-               {
-                       if(__currentWordIndex < __maxOccurrances)
+               //if (__pWebViewer->SearchText(__currentSearchStr, true) == true)
+                       if (__pWebViewer->SearchNextAsync(true) == E_SUCCESS)
                        {
-                               __currentWordIndex++;
+                               if (__currentWordIndex < __maxOccurrances)
+                               {
+                                       __currentWordIndex++;
+                               }
                        }
-               }
        }
        else
        {
-               if (__pWebViewer->SearchText(__currentSearchStr, false) == true)
+               //if (__pWebViewer->SearchText(__currentSearchStr, false) == true)
+               if (__pWebViewer->SearchNextAsync(false) == E_SUCCESS)
                {
                        if(__currentWordIndex > 1)
                        {
@@ -3663,9 +4626,18 @@ MainForm::FindNextWord(bool next)
        countStr.Append(__currentWordIndex);
        countStr.Append(L"/");
        countStr.Append(__maxOccurrances);
+
+       if (__pFindWordCountLabel && __pFindWordCountLabel->GetShowState() == true)
+       {
        __pFindWordCountLabel->SetText(countStr);
-       //      __pFindWordCountLabel->SetShowState(true);
        __pFindWordCountLabel->Invalidate(false);
+       }
+       else if(__pFindWordCountLabelRightToLeft && __pFindWordCountLabelRightToLeft->GetShowState() == true)
+       {
+               __pFindWordCountLabelRightToLeft->SetText(countStr);
+               __pFindWordCountLabelRightToLeft->Invalidate(false);
+       }
+
        if (__currentWordIndex >= __maxOccurrances)
        {
                __pFindWordNext->SetEnabled(false);
@@ -3684,7 +4656,7 @@ MainForm::FindNextWord(bool next)
        }
        __pFindWordPrev->Invalidate(false);
        __pFindWordNext->Invalidate(false);
-       __pFindWordCountLabel->Invalidate(false);
+
        __pFindWordControl->Invalidate(true);
 }
 
@@ -3692,7 +4664,7 @@ void
 MainForm::OnWebKeypadWillOpen(Tizen::Web::Controls::Web& source)
 {
        AppLog("xyz::MainForm::OnWebKeypadWillOpen");
-       __isWebKeypadOpened = true;
+       __isKeypadOpened = true;
        __pFooterPanel->SetShowState(false);
        //      OnAddressBarKeypadOpened(*__pAddressbar);
 }
@@ -3700,6 +4672,7 @@ MainForm::OnWebKeypadWillOpen(Tizen::Web::Controls::Web& source)
 void
 MainForm::OnWebKeypadOpened(Tizen::Web::Controls::Web& source)
 {
+       __isKeypadOpened = true;
        AppLog("xyz::MainForm::OnWebKeypadOpened");
 
        if(__pFindWordControl && __pFindWordControl->GetShowState() == true)
@@ -3719,7 +4692,7 @@ MainForm::OnWebKeypadOpened(Tizen::Web::Controls::Web& source)
 
        if (__pWebViewer != null && __pFooterPanel != null)
        {
-               AppLog("MainForm::OnOrientationChanged GetClientAreaBounds().height %d ", GetClientAreaBounds().height);
+               AppLog("MainForm::OnWebKeypadOpened GetClientAreaBounds().height %d ", GetClientAreaBounds().height);
                if(__pAddressbar != null)
                {
                        __pAddressbar->SetShowState(false);
@@ -3742,12 +4715,43 @@ MainForm::OnWebKeypadOpened(Tizen::Web::Controls::Web& source)
 void
 MainForm::OnWebKeypadClosed(Tizen::Web::Controls::Web& source)
 {
+       AppLog("abcde::MainForm::OnWebKeypadClosed");
        AppLog("xyz::MainForm::OnWebKeypadClosed");
        AppLog("akjshdasd 4");
        __pFooterPanel->SetShowState(true);
 //     OnAddressBarKeypadClosed(*__pAddressbar);
        RelayoutControls(false);
-       __isWebKeypadOpened = false;
+       __isKeypadOpened = false;
+
+
+       if(__pImageMenu && __pImageMenu->GetShowState() == true)
+       {
+               AppLog("abcde: imagemenu visible.");
+               Point p(0,0);
+               Point q(0,0);
+               __pWebViewer->GetBlockRange(p,q);
+               if (p == Point(0,0) && q == Point(0,0))
+                       return;
+               if(p.y < 150)
+               {
+                       p.y = p.y + 100;
+
+               }
+
+               __pImageMenu->SetAnchorPosition(p);
+               __pImageMenu->Show();
+               Invalidate(true);
+       }
+}
+
+void
+MainForm::OnWebKeypadBoundsChanged(Tizen::Web::Controls::Web& source)
+{
+       //      RelativeLayout(false);
+       if(__pWebViewer != null)
+       {
+               __pWebViewer->SetBounds(Rectangle(0,__webControlPosition.y,GetClientAreaBounds().width,GetClientAreaBounds().height));
+       }
 }
 
 void
@@ -3773,7 +4777,17 @@ MainForm::OnTouchDoublePressed(const Control& source, const Point& currentPositi
 
 void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
 {
-       AppLog("abcde::MainForm::OnTouchLongPressed %d, %d" ,currentPosition.x,currentPosition.y);
+       AppLog("LMN::abcde::MainForm::OnTouchLongPressed %d, %d" ,currentPosition.x,currentPosition.y);
+       if(TouchEventManager::GetInstance() && TouchEventManager::GetInstance()->GetTouchInfoListN() && TouchEventManager::GetInstance()->GetTouchInfoListN()->GetCount() >1)
+       {
+               AppLog("Returning because of more than one touch point.");
+               return;
+       }
+//     if(__pWebViewer)
+//             __pWebViewer->ReleaseBlock();
+       if(__pWebViewer)
+               __pWebViewer->SetFocus();
+       __longPressPoint = currentPosition;
 
        if (__pHitElementResult != null)
        {
@@ -3794,13 +4808,19 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen:
 
        if (__pHitElementResult->HasImage() == true)
        {
-               InitImageContextMenu(currentPosition);
+               if(__pWebViewer != null)
+               {
+                       __pWebViewer->ReleaseBlock();//N_SE-52389
+                       InitImageContextMenu(Point(currentPosition.x,currentPosition.y + __pWebViewer->GetY()));
+               }
                __pImageMenu->SetShowState(true);
                __pImageMenu->Show();
                __pImageMenu->Invalidate(true);
        }
        else if(__pHitElementResult->HasUrl() == true)
        {
+               if(__pWebViewer != null)
+                       __pWebViewer->ReleaseBlock();//N_SE-52389
                String tempURl = __pHitElementResult->GetUrl();
                AppLog("tempURl is %ls", tempURl.GetPointer());
                const Bitmap* pBitmap = __pHitElementResult->GetImage();
@@ -3812,7 +4832,7 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen:
                {
                        AppLog(null);
                }
-               InitImageLinkContextMenu(currentPosition);
+               InitImageLinkContextMenu(Point(currentPosition.x,currentPosition.y + __pWebViewer->GetY()));
                __pImageMenu->SetShowState(true);
                __pImageMenu->Show();
                __pImageMenu->Invalidate(true);
@@ -3823,19 +4843,23 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen:
                String type = __pHitElementResult->GetAttributeValue("type");
                String value = __pHitElementResult->GetAttributeValue(L"value");
                String innerHtml = __pHitElementResult->GetAttributeValue(L"innerHTML");
-
+               result r = E_FAILURE;
                __currentSelectedStr.Clear();
                __currentSelectedStr = __pWebViewer->GetTextFromBlock();
 
                AppLog("tag name is %ls", tagName.GetPointer());
                AppLog("type is %ls", type.GetPointer());
-               AppLog("innerHtml is %ls", innerHtml.GetPointer());
 
-               if (((tagName.CompareTo(L"INPUT") == 0)  || tagName.CompareTo(L"TEXTAREA") == 0) &&  value.GetLength() == 0 && innerHtml.GetLength() == 0 && __isWebKeypadOpened == true)
+
+
+               __isLongPressedDone = true;
+               if( type.Equals(L"submit",false) !=true && type.Equals(L"checkbox",false) !=true && type.Equals(L"range",false) !=true && type.Equals(L"file",false) !=true)
+                       r =__pWebViewer->SetBlockSelectionPosition(currentPosition);
+               if (((tagName.Equals(L"INPUT",false) == true)  || tagName.Equals(L"TEXTAREA",false) == true) && innerHtml.GetLength() == 0  && type.Equals(L"submit",false) !=true && type.Equals(L"checkbox",false) !=true && type.Equals(L"range",false) !=true  && type.Equals(L"file",false) !=true/*&& __isWebKeypadOpened == true*/ && __currentSelectedStr.Equals(L"",false) == true && r == E_INVALID_ARG)
                {
                        AppLog("MainForm::OnWebPageBlockSelected show paste option");
 
-                       InitSelectTextContextMenu(currentPosition,true, true);
+                       InitSelectTextContextMenu(Point(currentPosition.x , currentPosition.y + __pWebViewer->GetY()),true, true);
                        if(__pImageMenu)
                        {
                                __pImageMenu->SetShowState(true);
@@ -3843,8 +4867,6 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen:
                                __pImageMenu->Invalidate(true);
                        }
                }
-               __isLongPressedDone = true;
-               result r =__pWebViewer->SetBlockSelectionPosition(currentPosition);
                AppLog("setselectionselectedornot %s",GetErrorMessage(r));
 
        }
@@ -3854,7 +4876,16 @@ void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen:
 void
 MainForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
 {
-       AppLog("MainForm::OnTouchReleased");
+       AppLog("xyz:: MainForm::OnTouchReleased called");
+
+       if (__pAddressbar && __pAddressbar->GetShowState() == true)
+       {
+               __pAddressbar->SetShowState(false);
+       }
+       if(__pFooterPanel && __isKeypadOpened == false)
+       {
+               __pFooterPanel->SetShowState(true);
+       }
 
        // Not reuired now.
        /*HitElementResult* pHitElement = __pWebViewer->GetElementByPointN(currentPosition);
@@ -3884,21 +4915,36 @@ MainForm::OnTouchReleased(Tizen::Ui::Control& source, const Tizen::Ui::TouchEven
                __currentSearchStr = L"";
                __currentWordIndex = 0;
                __maxOccurrances = 0;
-               __pFindWordEditField->SetText(L"");
+
+               if (__pFindWordPanelLeftToRight && __pFindWordPanelLeftToRight->GetShowState() == true)
+               {
+                       __pFindWordEditField->SetText(L"");
+                       __pFindWordEditField->HideKeypad();
+                       __pFindWordControl->SetShowState(false);
+                       __pFindWordCountLabel->SetText(L"0/0");
+               }
+               else if(__pFindWordPanelRightToLeft && __pFindWordPanelRightToLeft->GetShowState() == true)
+               {
+                       __pFindWordEditFieldRightToLeft->SetText(L"");
+                       __pFindWordEditFieldRightToLeft->HideKeypad();
+                       __pFindWordControl->SetShowState(false);
+                       __pFindWordCountLabelRightToLeft->SetText(L"0/0");
+               }
+
                __pFindWordNext->SetEnabled(false);
                __pFindWordPrev->SetEnabled(false);
-               __pFindWordCountLabel->SetText(L"0/0");
-               __pWebViewer->SearchText(L"aaaabbbbcccc",true);
+
+               __pWebViewer->SearchTextAllAsync(L"",true);
                __pFindWordControl->SetShowState(false);
-               __pFindWordEditField->HideKeypad();
        }
+       AppLog("__pAddressbar->GetShowState() %d",__pAddressbar->GetShowState());
        if(__pAddressbar->GetShowState() == false)
        {
                __pAddressbar->SetAddressbarURLFocus();
                __pFooterPanel->SetShowState(false);
        }
 
-       return true;
+       return false;
 }
 
 bool
@@ -3936,7 +4982,8 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
 {
        AppLog("MainForm::OnOrientationChanged GetClientAreaBounds %d, %d",GetClientAreaBounds().width,GetClientAreaBounds().height);
        int widthContextItem = 0;
-
+       //if(__pFindWordCountLabel)
+       //      __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
        // As per the platform engineer comment removed this line
        /*if(__pWebViewer != null)
        {
@@ -3944,8 +4991,27 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
                __pWebViewer->ReleaseBlock();
        }*/
 
-       if(__pFindWordControl != null)
-               ShowFindWordPanel(__pFindWordControl->GetShowState(), false);
+//     if(__pFindWordControl != null)
+//             ShowFindWordPanel(__pFindWordControl->GetShowState(), false);
+
+       if(__pOptionMenu && __pOptionMenu->GetShowState() == true)
+       {
+               if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+               {
+                       AppLog(" Orientation landscape");
+                       __pOptionMenu->SetMaxVisibleItemsCount(5);
+               }
+               else
+               {
+                       AppLog(" Orientation potrait");
+                       __pOptionMenu->SetMaxVisibleItemsCount(6);
+               }
+       }
+       if(__pNotification && __pNotification->GetShowState() == true)
+       {
+               __pNotification->SetShowState(false);
+               __pNotification->Invalidate(false);
+       }
        if ( __pFooterLabel != null)
        {
                Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_SEARCH_INPUT_FIELD_BG, __pFooterLabel->GetWidth(), __pFooterLabel->GetHeight());
@@ -3967,8 +5033,20 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
                }
        }
 
-       if(__pMenu != null)
-               __pMenu->SetShowState(false);
+       if (__pFindWordBgLabelRightToLeft != null)
+       {
+               Bitmap *pBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_FINDWORD_INPUT_FIELD_BG, __pFindWordBgLabelRightToLeft->GetWidth(), __pFindWordBgLabelRightToLeft->GetHeight());
+               if (pBitmap != null)
+               {
+                       __pFindWordBgLabelRightToLeft->SetBackgroundBitmap(*pBitmap);
+                       delete pBitmap;
+               }
+       }
+
+
+//     if(__pOptionMenu != null)
+//             __pOptionMenu->SetShowState(false);
+
        if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
        {
                widthContextItem = WIDTH_CONTEXT_MENU_BUTTON_LANDSCAPE;
@@ -3982,18 +5060,11 @@ MainForm::OnOrientationChanged (const Tizen::Ui::Control &source, Tizen::Ui::Ori
        {
                AppLog("__pFooterPanel->GetShowState() is true");
                InitFooter();
-               __pFooterPanel->SetBounds(0, GetClientAreaBounds().height - __pFooterPanel->GetHeight(), __pFooterPanel->GetWidth(), __pFooterPanel->GetHeight());
+               __pFooterPanel->SetBounds(CoordinateSystem::AlignToDevice(FloatRectangle(0, GetClientAreaBoundsF().height - __pFooterPanel->GetHeightF(), __pFooterPanel->GetWidthF(), __pFooterPanel->GetHeightF())));
                __pFooterPanel->Invalidate(true);
        }
        InitAddressbar();
 
-       if(__pMoreButton && __pMenu)
-       {
-               Point p = Point(__pMoreButton->GetX() + __pMoreButton->GetWidth() / 2, GetBounds().height - __pMoreButton->GetHeight());
-               __pMenu->SetAnchorPosition(p);
-               __pMenu->Invalidate(true);
-       }
-
        String homePage = SettingPresentationModel::GetInstance()->GetHomepage();
        if (homePage.CompareTo((L"IDS_BR_BODY_MOST_VISITED_SITES")) == 0)
        {
@@ -4064,15 +5135,16 @@ MainForm::OnSettingsChange(int settingvalue)
        if (settingvalue == (int) REGISTRY_SETTING_DEFAULT_VIEW)
        {
                WebSetting settings = __pWebViewer->GetSetting();
-               if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0)
+               if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo((L"IDS_BR_BODY_FIT_TO_WIDTH")) == 0)
                {
                        settings.SetAutoFittingEnabled(true);
                }
-               else if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo(CommonUtil::GetString(L"IDS_BR_BODY_READABLE")) == 0)
+               else if (SettingPresentationModel::GetInstance()->GetDefaultView().CompareTo((L"IDS_BR_BODY_READABLE")) == 0)
                {
                        settings.SetAutoFittingEnabled(false);
                }
                __pWebViewer->SetSetting(settings);
+
        }
        else if (settingvalue == (int) REGISTRY_SETTING_RUN_JAVASCRIPT)
        {
@@ -4085,6 +5157,7 @@ MainForm::OnSettingsChange(int settingvalue)
                WebSetting settings = __pWebViewer->GetSetting();
                settings.SetAutoImageLoadEnabled(SettingPresentationModel::GetInstance()->IsDisplayImagesEnabled());
                __pWebViewer->SetSetting(settings);
+               __pWebViewer->Reload();
        }
        else if (settingvalue == (int) REGISTRY_SETTING_BLOCK_POPUP)
        {
@@ -4105,6 +5178,7 @@ MainForm::OnSettingsChange(int settingvalue)
                {
                        WebSetting settings = __pWebViewer->GetSetting();
                        settings.SetAutoFormDataShowEnabled(SettingPresentationModel::GetInstance()->IsRememberFormData());
+                       __pWebViewer->SetSetting(settings);
                }
        }
        else if(settingvalue == (int) REGISTRY_SETTING_REMEMBER_PASSWORD)
@@ -4112,7 +5186,8 @@ MainForm::OnSettingsChange(int settingvalue)
                if (__pWebViewer)
                {
                        WebSetting settings = __pWebViewer->GetSetting();
-                       settings.SetAutoFormDataShowEnabled(SettingPresentationModel::GetInstance()->IsRememberPassword());
+                       settings.SetAutoLoginFormFillEnabled(SettingPresentationModel::GetInstance()->IsRememberPassword());
+                       __pWebViewer->SetSetting(settings);
                }
        }
        else if (settingvalue == (int) REGISTRY_SETTING_SHOW_SECURITY_WARNINGS)
@@ -4253,13 +5328,16 @@ MainForm::findDistance(int x1,int y1,int x2, int y2)
 void
 MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
 {
+       AppLog("xyz:: MainForm::OnTouchPressed called");
        if(__pFindWordControl)
        {
                AppLog("MainForm::OnTouchPressed %d",__pFindWordControl->GetShowState());
-               ShowFindWordPanel(__pFindWordControl->GetShowState(), true);
+//             ShowFindWordPanel(__pFindWordControl->GetShowState(), true);
        }
        __isLongPressedDone = false;
 
+
+
        Touch touch;
        IList* pList = null;
        pList = touch.GetTouchInfoListN(source);
@@ -4305,17 +5383,26 @@ MainForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics
                }
        }
        if( pList != NULL)
-
        {
                pList->RemoveAll(true);
                delete pList;
        }
+       if(__pAddressbar)
+       {
+               __pAddressbar->SetShowState(false);
+       }
+       if(__pFooterPanel && __isKeypadOpened == false)
+       {
+               __pFooterPanel->SetShowState(true);
+       }
+       RelayoutControls(false);
        return;
 }
 
 void
 MainForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
 {
+       AppLog("LMN::MainForm::OnTouchMoved entered");
 //     __currentWordIndex = 0;
        __isLongPressedDone = false;
 
@@ -4340,9 +5427,20 @@ MainForm::OnTextValueChanged (const Tizen::Ui::Control &source)
                        __pFooterUrlField->SetKeypadActionEnabled(true);
                }
        }
-       if (__pFindWordEditField != null)
+       if (__pFindWordEditField != null && __pFindWordEditField->GetShowState() == true)
        {
                __currentSearchStr = __pFindWordEditField->GetText();
+               if (__currentSearchStr.GetLength() > 0)
+               {
+                       __pFindWordCountLabel->SetShowState(true);
+               }
+               else
+               {
+//                     __pFindWordCountLabel->SetShowState(false);
+                       __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),84,__pFindWordCountLabel->GetHeight());
+                       __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight());
+
+               }
                __pFindWordNext->SetEnabled(false);
                __pFindWordPrev->SetEnabled(false);
                __pFindWordNext->Invalidate(true);
@@ -4350,6 +5448,25 @@ MainForm::OnTextValueChanged (const Tizen::Ui::Control &source)
                __pFindWordCountLabel->SetText(L"0/0");
                __pFindWordCountLabel->Invalidate(true);
        }
+       else if (__pFindWordEditFieldRightToLeft != null && __pFindWordEditFieldRightToLeft->GetShowState() == true)
+       {
+               __currentSearchStr = __pFindWordEditFieldRightToLeft->GetText();
+               if (__currentSearchStr.GetLength() > 0)
+               {
+                       __pFindWordCountLabelRightToLeft->SetShowState(true);
+               }
+               else
+               {
+                       __pFindWordCountLabelRightToLeft->SetShowState(false);
+               }
+
+               __pFindWordNext->SetEnabled(false);
+               __pFindWordPrev->SetEnabled(false);
+               __pFindWordNext->Invalidate(true);
+               __pFindWordPrev->Invalidate(true);
+               __pFindWordCountLabelRightToLeft->SetText(L"0/0");
+               __pFindWordCountLabelRightToLeft->Invalidate(true);
+       }
        AppLog("__currentSearchStr %ls",__currentSearchStr.GetPointer());
        if (__currentSearchStr.GetLength() > 0)
        {
@@ -4381,8 +5498,9 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu
        result r = E_SUCCESS;
 
 
-       if (__pWebViewer != null && __pMostVisitedListView != null)
+       if (__pMostVisitedListView != null)
        {
+               __pMostVisitedListView->SetShowState(true);
                return E_SUCCESS;
        }
 
@@ -4398,6 +5516,7 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu
        HistoryPresentationModel::GetInstance()->GetMostVisitedSites(*__pMostVisitedSites);
 
        __webControlHeight = GetClientAreaBounds().height - __pFooterPanel->GetHeight();
+       __webControlHeightF = GetClientAreaBoundsF().height - __pFooterPanel->GetHeightF();
        __pMostVisitedListView = new(std::nothrow) ListView();
 
        int height = GetClientAreaBounds().height;
@@ -4421,7 +5540,7 @@ MainForm::InitMostVisitedSitesView(Tizen::Ui::OrientationStatus orientationStatu
        }
        __pMostVisitedListView->SetItemProvider(*this);
        __pMostVisitedListView->AddListViewItemEventListener(*this);
-       __pMostVisitedListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_RECENTLY_VISITED_SITES"));
+       __pMostVisitedListView->SetTextOfEmptyList(CommonUtil::GetString(L"IDS_BR_BODY_NO_VISITED_SITES"));
        AddControl(__pMostVisitedListView);
        __pMostVisitedListView->UpdateList();
 
@@ -4482,13 +5601,46 @@ void MainForm::UpdateImageContent(ByteBuffer* aBuffer, String imageName)
                return;
        }
        Tizen::Base::String contentPath = Tizen::System::Environment::GetMediaPath() + L"Downloads/";
+       Tizen::Io::Directory::Create(contentPath,true);
+       if(GetLastResult() == E_FILE_ALREADY_EXIST)
+       {
+               AppLog("Already exists");
+       }
+       else if(GetLastResult() == E_SUCCESS)
+       {
+               AppLog("created success");
+       }
        contentPath.Append(imageName);
        contentPath.Append(".jpg");
        contentId = contentManager.CreateContent(*aBuffer, contentPath);
+       ShowIndicatorNotification(L"Download Complete",contentPath);
        AppLog("Content manager update content result %s" ,GetErrorMessage(GetLastResult()));
 }
 
 void
+MainForm::ShowIndicatorNotification(const String& messageText, const String& contentPath)
+{
+       AppLogDebug("ENTER");
+
+       NotificationRequest request;
+       request.SetAlertText(messageText);
+       request.SetTitleText(L"");
+       request.SetAppMessage(contentPath);
+
+       Tizen::App::App* pApp = Tizen::App::App::GetInstance();
+       String homePath = pApp->GetAppRootPath();
+       String iconPath = homePath + L"res/screen-density-xhigh/Notification_download_complete.png";
+       AppLog("The iconPath is : %ls", homePath.GetPointer());
+       request.SetIconFilePath(iconPath);
+
+       Tizen::Shell::NotificationManager notiMgr;
+       notiMgr.Construct();
+       notiMgr.Notify(request);
+       AppLogDebug("EXIT: %s", GetErrorMessage(GetLastResult()));
+       return;
+}
+
+void
 MainForm::SetForwardButtonEnabled(bool isEnabled)
 {
        __pGoForwardBtn->SetEnabled(isEnabled);
@@ -4649,82 +5801,6 @@ MainForm::ReaderClicked()
        return;
 
 
-       int bodyWidth = ((double)(GetClientAreaBounds().width))*0.73;
-
-       CreateReaderPanel();
-       AppLogDebug("MainScene::ReaderClicked entered");
-
-
-       /*if (__pArticleReaderPanel)
-       {
-               AppLogDebug("showstate true for reader panel");
-               __pArticleReaderPanel->SetShowState(true);
-               __pArticleReaderPanel->Show();
-       }*/
-       int xPos = __pArticleReaderPanel->GetX();
-       int yPos = __pArticleReaderPanel->GetY();
-       AppLog("ReaderClicked() xPos = %d",xPos);
-       AppLog("ReaderClicked() yPos = %d",yPos);
-
-       if (__pReaderData == null)
-       {
-               return;
-       }
-
-       String loadData = L"<html>\
-                                       <head>\
-                                       <meta name='viewport' content='width=device-width*0.73,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no'>\
-                                       <style>\
-                                       h1\
-                                       {\
-                                       font-weight:bold;\
-                                       background-color: transparent;\
-                                       }\
-                                       div\
-                                       {\
-                                       display: block;\
-                                       }\
-                                       p\
-                                       {\
-                                       display: block; \
-                                       }\
-                                       img\
-                                       {\
-                                       margin-left:auto;\
-                                       margin-right:auto;\
-                                       }\
-                                       \
-                                       \
-                                       </style>\
-                                       </head>\
-                                       <body style='width:'";
-       loadData.Append(bodyWidth);
-       loadData.Append(L"px'>");
-       AppLogDebug("data->GetLength %d",__pReaderData->GetLength());
-       loadData.Append(*__pReaderData);
-       loadData.Append(L"</body></html>");
-
-       ByteBuffer buf ;
-       buf.Construct(loadData.GetLength());
-       AppLogDebug("data->GetLength %d",loadData.GetLength());
-       for (int z=0;z<loadData.GetLength();z++)
-       {
-               mchar b;
-               loadData.GetCharAt(z,b);
-               buf.SetByte((byte)b);
-       }
-
-       buf.Flip();
-       if (__pWebReader != null)
-       {
-               __pWebReader->LoadData(L"",buf,L"text/html");
-               AppLogDebug("LoadData result %s",GetErrorMessage(GetLastResult()));
-       }
-       else
-       {
-               AppLogDebug("cannot LoadData __pWebReader is null");
-       }
-
 }
 
 void MainForm::SetAddressbarMode(AddressBarMode addMode)
@@ -4789,6 +5865,8 @@ AddressBarMode MainForm::GetAddressbarMode(void)
 void MainForm::SetUrl(const String& url)
 {
        __displayUrl = url;
+       if(__displayUrl.GetLength() > 2048)
+               __displayUrl.SubString(0,2048,__displayUrl);
 
        if (__pFooterUrlField != NULL)
        {
@@ -4796,20 +5874,23 @@ void MainForm::SetUrl(const String& url)
                if (removedHttpUrl.IsEmpty() == false)
                {
                        __pFooterUrlField->SetText(removedHttpUrl);
-                       if(__pAddressbar != NULL)
-                       __pAddressbar->SetUrl(__displayUrl);
+                       if(__pAddressbar != NULL && __pAddressbar->HasCurrentFocus() == false)
+                               __pAddressbar->SetUrl(__displayUrl);
                }
                else
                {
                        __pFooterUrlField->SetText(__displayUrl);
-                       if(__pAddressbar != NULL)
-                       __pAddressbar->SetUrl(__displayUrl);
+                       if(__pAddressbar != NULL && __pAddressbar->HasCurrentFocus() == false)
+                               __pAddressbar->SetUrl(__displayUrl);
                }
                if(__pFooterUrlField)
+               {
+                       AppLog("Position:: %d, %ls",__pFooterUrlField->GetTextLength(),__pFooterUrlField->GetText().GetPointer());
                        __pFooterUrlField->SetCursorPosition(__pFooterUrlField->GetTextLength());
+               }
                __pFooterUrlField->Invalidate(false);
-               if(__pAddressbar != NULL)
-               __pAddressbar->Invalidate(true);
+               if(__pAddressbar != NULL && __pAddressbar->HasFocus())
+                       __pAddressbar->Invalidate(true);
 //             __pFooterUrlField->SetCursorPosition(0);
        }
 }
@@ -4817,14 +5898,19 @@ void MainForm::SetUrl(const String& url)
 String
 MainForm::RemoveHttpTextFromDisplayURL(void)
 {
-       bool isHttpText = __displayUrl.Contains(L"http://");
+       AppLog("MainForm::RemoveHttpTextFromDisplayURL __displayUrl %ls",__displayUrl.GetPointer());
+       int index = -1;
+//     bool isHttpText = __displayUrl.Contains(L"http://");
        String updatedDisplayUrl;
        updatedDisplayUrl.Clear();
-
-       if (isHttpText == true)
+       if(__displayUrl.IndexOf(L"http://",0,index) == E_SUCCESS && index == 0)
        {
                __displayUrl.SubString(7,updatedDisplayUrl);
        }
+       else if(__displayUrl.IndexOf(L"https://",0,index) == E_SUCCESS && index == 0)
+       {
+               __displayUrl.SubString(8,updatedDisplayUrl);
+       }
        return updatedDisplayUrl;
 }
 
@@ -4833,14 +5919,28 @@ void MainForm::OnSharePopupControlStarted(void)
        __pWebViewer->AddTouchEventListener(*this);
 }
 
-void MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
+void
+MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collection::IList *pArgs)
 {
-       if (requestId == BACK_GROUND_APP_EVENT)
+       if (requestId == UPDATE_MAINFORM_FOOTER_ON_WINDOWCLOSED)
+       {
+               AppLog("OnWebWindowCloseRequested mainform test 1 OnUserEventReceivedN");
+               InitFooter();
+       }
+       else if (requestId == BACK_GROUND_APP_EVENT)
        {
                if(__pWebViewer != null)
                {
                        __pWebViewer->Pause();
                }
+               if(__pImageMenu)
+               {
+                       __pImageMenu->SetShowState(false);
+               }
+               if(__pAddressbar != null)
+               {
+                       __pAddressbar->SendUserEvent(BACK_GROUND_APP_EVENT,NULL);
+               }
        }
        else if(requestId == FORE_GROUND_APP_EVENT)
        {
@@ -4848,13 +5948,22 @@ void MainForm::OnUserEventReceivedN (RequestId requestId, Tizen::Base::Collectio
                {
                        __pWebViewer->Resume();
                }
+               if(__pAddressbar != null)
+               {
+                       __pAddressbar->SendUserEvent(FORE_GROUND_APP_EVENT,NULL);
+               }
        }
 }
 
 void
 MainForm::AddressBarCancelledClicked(const Addressbar& addBar)
 {
+       AppLog("XYZ::MainForm::AddressBarCancelledClicked");
        result r = E_SUCCESS;
+
+       if (__pAddressbar)
+               __pAddressbar->SetShowState(false);
+
        AppLog("akjshdasd 5");
        __pFooterPanel->SetShowState(true);
 
@@ -4864,9 +5973,106 @@ MainForm::AddressBarCancelledClicked(const Addressbar& addBar)
                __pMostVisitedListView->SetFocus();
        else if(__pMultiWindowButton)
                __pMultiWindowButton->SetFocus();
-       __pMoreButton->SetFocus();
+       else if(__pMoreButton)
+               __pMoreButton->SetFocus();
 
        __pAddressbar->SetShowState(false);
 
        RelayoutControls(false);
 }
+
+void
+MainForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
+{
+       AppLog("MainForm::OnFormMenuRequested called");
+       InitOptionMenu();
+       if (__pWindowInfo != NULL && __pWindowInfo->pageUrl != NULL && __pWebViewer && __pWebViewer->GetShowState() == true)
+       {
+               int bookmarkCount=0;
+               bool exist = false;
+               String url=L"";
+               url=__pWindowInfo->pageUrl;
+               AppLog("MainForm::OnFormMenuRequested url %ls",url.GetPointer());
+               result r = E_SUCCESS;
+               Bitmap* pBitmap = null;
+               String lastChar = L"";
+//             if(url.SubString(url.GetLength()-1,lastChar));
+//             if(lastChar == L"/")
+//             {
+//                     bool exist1 = false;
+//                     bool exist2 = false;
+//                     r=BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(url,exist1);
+//                     url.SubString(0,url.GetLength() - 1,url);
+//                     r=BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(url,exist2);
+//                     exist = exist1 | exist2;
+//             }
+//             else
+//             {
+                       r=BookmarkPresentationModel::GetInstance()->DoesBookmarkExist(url,exist);
+                       if (IsFailed(r))
+                       {
+                               AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED failed");
+                               return;
+                       }
+//             }
+               if ( exist == true)
+               {
+                       pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_ON_TEMP);
+               }
+               else
+               {
+                       pBitmap = AppResource::GetInstance()->GetBitmapN(IDB_ICON_BOOKMARK_OFF_TEMP);
+               }
+               AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 3");
+
+               if (__pOptionMenu->GetItemCount() == 9)
+               {
+                       r = __pOptionMenu->SetItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+               }
+               else
+               {
+                       r = __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED,*pBitmap);
+               }
+
+               if (IsFailed(r))
+               {
+                       AppLogException("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED Add to Bookmark failed with %s", GetErrorMessage(r));
+                       delete pBitmap;
+                       return ;
+               }
+               AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 4");
+               if (__pOptionMenu->GetItemCount() != 9)
+               {
+                       __pOptionMenu->InsertItemAt(1,CommonUtil::GetString(L"IDS_BR_OPT_ADDTOBOOKMARKS"), IDA_ADDTOBOOKMARK_CLICKED);
+                       __pOptionMenu->InsertItemAt(2,CommonUtil::GetString(L"IDS_BR_BODY_PRINT"), IDA_PRINT_CLICKED);
+//                             __pOptionMenu->InsertItemAt(2,L"Add to Home"/*CommonUtil::GetString(L"IDS_BR_OPT_SHARE")*/, IDA_ADD_TO_HOME_CLICKED);
+                       __pOptionMenu->InsertItemAt(3,CommonUtil::GetString(L"IDS_BR_OPT_SHARE"), IDA_SHARE_CLICKED);
+                       __pOptionMenu->InsertItemAt(4,CommonUtil::GetString(L"IDS_BR_OPT_FIND_ON_PAGE_ABB"), IDA_FINDONPAGE_CLICKED);
+                       __pOptionMenu->SetMaxVisibleItemsCount(6);
+               }
+               if( GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+               {
+                       AppLog(" Orientation landscape");
+                       __pOptionMenu->SetMaxVisibleItemsCount(5);
+               }
+               else
+               {
+                       AppLog(" Orientation potrait");
+                       __pOptionMenu->SetMaxVisibleItemsCount(6);
+               }
+
+               AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED 5");
+               delete pBitmap;
+       }
+       AppLogDebug("ONACTION_PERFORMED:IDA_MOREBTN_CLICKED end");
+       if(__pAddressbar)
+               __pAddressbar->SetShowState(false);
+       SetFocus();
+       __pFooterPanel->SetShowState(true);
+       result r = __pOptionMenu->SetShowState(true);
+       AppLog("ajsghd %s",GetErrorMessage(r));
+       RelayoutControls(false);
+       __pOptionMenu->Invalidate(true);
+       __pOptionMenu->Show();
+
+}