Refactor ClosePageFromOnTerminate 95/108095/1
authorYoungsoo Choi <kenshin.choi@samsung.com>
Mon, 2 Jan 2017 13:33:48 +0000 (22:33 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 3 Jan 2017 04:02:01 +0000 (13:02 +0900)
The view stack needs to be handled in class WebApplication.

Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2743

Change-Id: Ide43a3d254da9d1746b5235a97ed401aa24ea7b8
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
runtime/browser/runtime.cc
runtime/browser/web_application.cc
runtime/browser/web_application.h

index a2e0c03..bba1168 100644 (file)
@@ -58,17 +58,8 @@ std::unique_ptr<Runtime> Runtime::MakeRuntime(
 }
 
 void Runtime::ClosePageFromOnTerminate(WebApplication* app) {
-  if (app) {
-    std::list<WebView*> vstack = app->view_stack();
-    auto it = vstack.begin();
-    if (it != vstack.end()) {
-      Runtime::is_on_terminate_called = true;
-      for (; it != vstack.end(); ++it) {
-        vstack.front()->SetVisibility(false);
-        ewk_view_page_close((*it)->evas_object());
-      }
-    }
-  }
+  if (app)
+    app->ClosePageFromOnTerminate();
 }
 
 }  // namespace runtime
index f5f16ba..753711a 100755 (executable)
@@ -655,6 +655,17 @@ void WebApplication::Terminate() {
   extension_server->Shutdown();
 }
 
+void WebApplication::ClosePageFromOnTerminate() {
+  auto it = view_stack_.begin();
+  if (it != view_stack_.end()) {
+    runtime::Runtime::is_on_terminate_called = true;
+    for (; it != view_stack_.end(); ++it) {
+      view_stack_.front()->SetVisibility(false);
+      ewk_view_page_close((*it)->evas_object());
+    }
+  }
+}
+
 void WebApplication::OnCreatedNewWebView(WebView* /*view*/, WebView* new_view) {
   if (view_stack_.size() > 0 && view_stack_.front() != NULL)
     view_stack_.front()->SetVisibility(false);
index f219a37..1c31d21 100755 (executable)
@@ -52,6 +52,7 @@ class WebApplication : public WebView::EventListener {
   void Suspend();
   void Terminate();
 
+  void ClosePageFromOnTerminate();
   std::string data_path() const { return app_data_path_; }
   void set_terminator(std::function<void(void)> terminator) {
     terminator_ = terminator;