Handle back-key behavior when viewmode is 'windowed' 01/105701/2 accepted/tizen/3.0/common/20161220.101433 accepted/tizen/3.0/ivi/20161220.011040 accepted/tizen/3.0/mobile/20161220.010946 accepted/tizen/3.0/tv/20161220.011004 accepted/tizen/3.0/wearable/20161220.011020 submit/tizen_3.0/20161219.103152
authorYoungcheol Kang <ychul.kang@samsung.com>
Mon, 19 Dec 2016 09:46:49 +0000 (18:46 +0900)
committerYoungcheol Kang <ychul.kang@samsung.com>
Mon, 19 Dec 2016 10:02:58 +0000 (19:02 +0900)
The Webview should be navigated back in history if the viewmode is
'windowed' in config.xml.

This patch adds the codes for handling the back-key behavior when
viewmode is 'windowed' for backward compatibility with Tizen 2.x.

Bug: P161214-06597

Change-Id: I83dff6c297cbc2baa82fdd19a49b1f89a433710e
Signed-off-by: Youngcheol Kang <ychul.kang@samsung.com>
runtime/browser/web_application.cc

index 47da126..91614ee 100755 (executable)
@@ -725,8 +725,10 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) {
     view->EvalJavascript(kBackKeyEventScript);
     // NOTE: This code is added for backward compatibility.
     // If the 'backbutton_presence' is true, WebView should be navigated back.
-    if (app_data_->setting_info() &&
-        app_data_->setting_info()->backbutton_presence()) {
+    if ((app_data_->setting_info() != NULL &&
+         app_data_->setting_info()->backbutton_presence()) ||
+        (app_data_->widget_info() != NULL &&
+         app_data_->widget_info()->view_modes() == "windowed")) {
       if (!view->Backward()) {
         RemoveWebViewFromStack(view_stack_.front());
       }