From: Youngsoo Choi Date: Mon, 6 Feb 2017 04:09:15 +0000 (+0900) Subject: Terminate properly when triggering hardware back key event X-Git-Tag: accepted/tizen/3.0/common/20170209.112717^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab93561c683c7e1e58ca49d6be8d6640ff3dd58b;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Terminate properly when triggering hardware back key event Termination should not be done when there are multiple webviews and hardware back key event is triggered for page navigation. The termination needs to be done only if there is one webview on view stack. This CL adds condition for the checking webview count. PLM: P170125-05834 Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2951 Change-Id: I6d4056c46a0c9999d068d1dd4c14d4f4793457a0 Signed-off-by: Youngsoo Choi --- diff --git a/runtime/browser/web_application.cc b/runtime/browser/web_application.cc index ac93129..a99a876 100755 --- a/runtime/browser/web_application.cc +++ b/runtime/browser/web_application.cc @@ -931,8 +931,12 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { if(enabled) view->EvalJavascript(kBackKeyEventScript); if (!view->Backward()) { - LOGGER(DEBUG) << "Terminate"; - Terminate(); + if (view_stack_.size() == 1) { + LOGGER(DEBUG) << "Terminate"; + Terminate(); + } else { + RemoveWebViewFromStack(view_stack_.front()); + } } } return; @@ -947,8 +951,12 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) { (app_data_->widget_info() != NULL && app_data_->widget_info()->view_modes() == "windowed")) { if (!view->Backward()) { - LOGGER(DEBUG) << "Terminate"; - Terminate(); + if (view_stack_.size() == 1) { + LOGGER(DEBUG) << "Terminate"; + Terminate(); + } else { + RemoveWebViewFromStack(view_stack_.front()); + } } } } else if (enabled && kKeyNameMenu == keyname) {