Fix codes about initializing the VCWebView handle 11/132411/6
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 2 Jun 2017 08:32:16 +0000 (17:32 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Mon, 25 Sep 2017 01:52:13 +0000 (01:52 +0000)
This change is related with a commit of vc-webview module.
https://review.tizen.org/gerrit/#/c/132420/

With this commit, static class VCWebView dynamically can response to
the vconf key changing. Therefore, WRT does not need to check vconf key
to initialize the voice touch anymore.

Change-Id: Ic1a7a6e191563e7196efe72541a857e4a80048fa
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
runtime/browser/web_application.cc

index b8a95bc..1b40dcc 100755 (executable)
@@ -490,12 +490,8 @@ bool WebApplication::Initialize() {
   m_tizenCompatibilitySettings.m_release = 0;
 
   // Get Web voice touch agent
-  bool is_supported_web_vt = false;
-  vc_webview_ = NULL;
-  if (0 == VCWebView::vc_is_supported_web_vt(&is_supported_web_vt) && is_supported_web_vt) {
-    LOGGER(DEBUG) << "[DEBUG] Web voice touch is enabled";
-    vc_webview_ = VCWebView::getInstance();
-  }
+  LOGGER(DEBUG) << "[DEBUG] Web voice touch is enabled";
+  vc_webview_ = VCWebView::getInstance();
 
   return true;
 }
@@ -550,9 +546,7 @@ void WebApplication::Launch(std::unique_ptr<common::AppControl> appcontrol) {
   view_stack_.push_front(view);
 
   // Set web view into Web voice touch agent
-  if (NULL != vc_webview_) {
-    vc_webview_->vc_webview_set_view(view->evas_object());
-  }
+  vc_webview_->vc_webview_set_view(view->evas_object());
 
   // ewk_view_bg_color_set is not working at webview initialization.
   if (common::getProfile() == common::kPROFILE_WEARABLE &&
@@ -765,9 +759,7 @@ void WebApplication::OnCreatedNewWebView(WebView* /*view*/, WebView* new_view) {
   window_->SetContent(new_view->evas_object());
 
   // Set web view into Web voice touch agent
-  if (NULL != vc_webview_) {
-    vc_webview_->vc_webview_set_view(new_view->evas_object());
-  }
+  vc_webview_->vc_webview_set_view(new_view->evas_object());
 }
 
 void WebApplication::RemoveWebViewFromStack(WebView* view) {
@@ -807,9 +799,7 @@ void WebApplication::RemoveWebViewFromStack(WebView* view) {
     window_->SetContent(view_stack_.front()->evas_object());
 
     // Set web view into Web voice touch agent
-    if (NULL != vc_webview_) {
-      vc_webview_->vc_webview_set_view(view_stack_.front()->evas_object());
-    }
+    vc_webview_->vc_webview_set_view(view_stack_.front()->evas_object());
   }
 
   // Delete after the callback context(for ewk view) was not used
@@ -964,7 +954,7 @@ void WebApplication::OnHardwareKey(WebView* view, const std::string& keyname) {
                      ? app_data_->setting_info()->hwkey_enabled()
                      : true;
 
-  if (NULL != vc_webview_ && kKeyNameBack == keyname && vc_webview_->vc_get_conflict_status() == 1) {
+  if (kKeyNameBack == keyname && vc_webview_->vc_get_conflict_status() == 1) {
     // When Web voice touch is in result conflict state, function of back key change to
     // canceling the conflict state
     vc_webview_->vc_remove_tooltip();
@@ -1165,7 +1155,7 @@ void WebApplication::OnLoadProgress(WebView* view, double persent) {
   }
 }
 
-void WebApplication::OnLoadFinished(WebView* /*view*/) {
+void WebApplication::OnLoadFinished(WebView* view) {
   LOGGER(DEBUG) << "LoadFinished";
   if (common::getProfile() == common::kPROFILE_MOBILE) {
     if ((app_data_->setting_info() != NULL &&
@@ -1176,6 +1166,9 @@ void WebApplication::OnLoadFinished(WebView* /*view*/) {
     }
   }
   splash_screen_->HideSplashScreen(SplashScreen::HideReason::LOADFINISHED);
+
+  // Set web view into Web voice touch agent
+  vc_webview_->vc_webview_set_view(view->evas_object());
 }
 
 void WebApplication::OnRendered(WebView* view) {
@@ -1184,11 +1177,6 @@ void WebApplication::OnRendered(WebView* view) {
   LOGGER(DEBUG) << "Rendered";
   splash_screen_->HideSplashScreen(SplashScreen::HideReason::RENDERED);
 
-  // Set web view into Web voice touch agent
-  if (NULL != vc_webview_) {
-    vc_webview_->vc_webview_set_view(view->evas_object());
-  }
-
   // Do not show(), active() for language change
   if(lang_changed_mode_ == false){
       // Show window after frame rendered.