[Tizen 3.0][EWK API] Change the implementation ewk_view_page_visibility_set
authorAndrzej Badowski <a.badowski@samsung.com>
Fri, 23 Oct 2015 15:23:23 +0000 (17:23 +0200)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
Change the implementation of ewk_view_page_visibibility_set means
calling RenderWidgetHostImpl::WasShown or WasHidden functions.
These functions, among others, sends a message to the renderer.
The message handler calls the function OnWasHidden or the function
OnWasShown side renderer.
The current implementation does not differ from the implementation
ewk_view_visibility_set.

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14555.
Reviewed by: Antonio Gomes, Janusz Majnert

Reviewed by: a1.gomes, j.majnert, sns.park

Change-Id: I89e84d92386ded7916b9f0671216b1adc6c99ad2
Signed-off-by: Andrzej Badowski <a.badowski@samsung.com
(cherry picked from commit 87f64fa1041d65d6b48036c5e07af406b56bff4c)

tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/public/ewk_view.cc

index 162e921..baa3654 100755 (executable)
@@ -731,6 +731,14 @@ void RenderWidgetHostViewEfl::Hide() {
   evas_object_hide(content_image_elm_host_);
 }
 
+void RenderWidgetHostViewEfl::WasShown() {
+  host_->WasShown(ui::LatencyInfo());
+}
+
+void RenderWidgetHostViewEfl::WasHidden() {
+  host_->WasHidden();
+}
+
 bool RenderWidgetHostViewEfl::IsShowing() {
   return evas_object_visible_get(content_image_);
 }
index 0730626..18c636d 100755 (executable)
@@ -114,6 +114,8 @@ class CONTENT_EXPORT RenderWidgetHostViewEfl
   bool IsSurfaceAvailableForCopy() const override;
   void Show() override;
   void Hide() override;
+  void WasShown();
+  void WasHidden();
   bool IsShowing() override;
   gfx::Rect GetViewBounds() const override;
   bool LockMouse() override;
index 179faa1..94da41b 100644 (file)
@@ -620,6 +620,16 @@ void EWebView::Hide() {
   web_contents_->WasHidden();
 }
 
+void EWebView::WasShown() {
+  if (rwhv())
+    rwhv()->WasShown();
+}
+
+void EWebView::WasHidden() {
+  if (rwhv())
+    rwhv()->WasHidden();
+}
+
 void EWebView::InvokeAuthCallback(LoginDelegateEfl* login_delegate,
                                   const GURL& url,
                                   const std::string& realm) {
index e2e3a92..217eb10 100644 (file)
@@ -255,6 +255,8 @@ class EWebView {
   void HandleTouchEvents(Ewk_Touch_Event_Type type, const Eina_List *points, const Evas_Modifier *modifiers);
   void Show();
   void Hide();
+  void WasShown();
+  void WasHidden();
   bool ExecuteJavaScript(const char* script, Ewk_View_Script_Execute_Callback callback, void* userdata);
   bool SetUserAgent(const char* userAgent);
   bool SetUserAgentAppName(const char* application_name);
index a53502a..01ce3e1 100644 (file)
@@ -352,15 +352,15 @@ Eina_Bool ewk_view_page_visibility_state_set(Evas_Object* ewkView, Ewk_Page_Visi
   EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl,false);
   switch (page_visibility_state) {
     case EWK_PAGE_VISIBILITY_STATE_VISIBLE :
-      impl->Show();
+      impl->WasShown();
       break;
     case EWK_PAGE_VISIBILITY_STATE_HIDDEN :
-      impl->Hide();
+      impl->WasHidden();
       break;
     default:
-      break;
+      return EINA_FALSE;
   }
-  return true;
+  return EINA_TRUE;
 }
 
 Eina_Bool ewk_view_user_agent_set(Evas_Object* ewkView, const char* user_agent)