From: ws29.jung Date: Tue, 3 Apr 2018 11:05:00 +0000 (+0900) Subject: Implement Hardware Backkey action X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6503b49f5d1d0852f1e3193d86a548f3e98680f1;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Implement Hardware Backkey action Hardware Backkey callback was already registered and called but inside of it, there was nothing implemented related with WebApp. Now hardware backkey work as it should be, like going back history and App quit when there is no history to go back. Change-Id: Ib95be89c8dc4da0628b7c69c531f36ff921c1b04 Signed-off-by: ws29.jung --- diff --git a/atom/app/ui_runtime.cc b/atom/app/ui_runtime.cc index c85a63fd4..2593e3233 100644 --- a/atom/app/ui_runtime.cc +++ b/atom/app/ui_runtime.cc @@ -45,7 +45,6 @@ bool UiRuntime::OnCreate() { void UiRuntime::OnTerminate() { atom::Browser *browser_model = atom::Browser::Get(); - browser_model->Shutdown(); } void UiRuntime::OnPause() { diff --git a/atom/browser/browser.cc b/atom/browser/browser.cc index 42cc787ee..2678b1c3e 100644 --- a/atom/browser/browser.cc +++ b/atom/browser/browser.cc @@ -5,6 +5,7 @@ #include "atom/browser/browser.h" #include +#include #include "atom/browser/atom_browser_main_parts.h" #include "atom/browser/browser_observer.h" @@ -87,6 +88,7 @@ void Browser::Shutdown() { if (base::ThreadTaskRunnerHandle::IsSet()) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); + ui_app_exit(); } else { // There is no message loop available so we are in early stage. exit(0); diff --git a/atom/browser/native_window_efl.cc b/atom/browser/native_window_efl.cc index 209e49c43..af0b8626e 100644 --- a/atom/browser/native_window_efl.cc +++ b/atom/browser/native_window_efl.cc @@ -145,7 +145,6 @@ void NativeWindowEfl::Close() { } void NativeWindowEfl::CloseImmediately() { - NOTIMPLEMENTED(); if(window_) evas_object_del(window_); window_ = nullptr; @@ -419,6 +418,10 @@ void NativeWindowEfl::HWBackKeyCallback(void* data, Evas_Object*, void*) { rfh->ExecuteJavaScriptWithUserGestureForTests( base::UTF8ToUTF16(kBackKeyEventScript)); } + if (thiz->web_contents()->GetController().CanGoBack()) + thiz->web_contents()->GetController().GoBack(); + else + thiz->Close(); } // static