Use virtual InitAsChild function to initialize RenderWidgetHostViewEfl
authorPiotr Tworek <p.tworek@samsung.com>
Thu, 19 Mar 2015 10:44:10 +0000 (11:44 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
RenderWidgetHostViewBase::InitAsChild virtual function is supposed to
perform the same function as our RenderWidgetHostViewEfl::Init. Since
I see no point in having both of them, especially that the only thing
InitAsChild currently does is call NOTIMPLEMENTED() macro let's merge
them.

Change-Id: I0ee3e53019f1607db20f9de195dcfcf6c65d17d0
Signed-off-by: Piotr Tworek <p.tworek@samsung.com>
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/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc

index 72066d6..3efca43 100644 (file)
@@ -134,18 +134,18 @@ RenderWidgetHostViewEfl::RenderWidgetHostViewEfl(RenderWidgetHost* widget)
   gesture_recognizer_->AddGestureEventHelper(this);
 }
 
-void RenderWidgetHostViewEfl::Init(Evas_Object* parent_view) {
+void RenderWidgetHostViewEfl::InitAsChild(gfx::NativeView parent_view) {
   DCHECK(parent_view);
-  parent_view_ = parent_view;
-  evas_ = evas_object_evas_get(parent_view);
+  parent_view_ = static_cast<Evas_Object*>(parent_view);
+  evas_ = evas_object_evas_get(parent_view_);
 
-  content_image_elm_host_ = elm_bg_add(parent_view);
+  content_image_elm_host_ = elm_bg_add(parent_view_);
   content_image_ = evas_object_image_filled_add(evas_);
   elm_object_part_content_set(content_image_elm_host_,
                               "overlay", content_image_);
   elm_object_focus_allow_set(content_image_elm_host_, EINA_TRUE);
 
-  Evas_Object* smart_parent = evas_object_smart_parent_get(parent_view);
+  Evas_Object* smart_parent = evas_object_smart_parent_get(parent_view_);
   if (smart_parent) {
     // If our parent is a member of some smart object we also want
     // to join that group.
@@ -153,7 +153,7 @@ void RenderWidgetHostViewEfl::Init(Evas_Object* parent_view) {
   }
 
   int x, y, width = 0, height = 0;
-  evas_object_geometry_get(parent_view, &x, &y, &width, &height);
+  evas_object_geometry_get(parent_view_, &x, &y, &width, &height);
   if (width == 0 || height == 0)
     width = height = 1;
   evas_object_image_size_set(content_image_, width, height);
@@ -506,10 +506,6 @@ bool RenderWidgetHostViewEfl::Send(IPC::Message* message) {
   return host_->Send(message);
 }
 
-void RenderWidgetHostViewEfl::InitAsChild(gfx::NativeView parent_view) {
-  NOTIMPLEMENTED();
-}
-
 void RenderWidgetHostViewEfl::InitAsPopup(RenderWidgetHostView*, const gfx::Rect&) {
   NOTIMPLEMENTED();
 }
index b7cc4b1..34f9abd 100644 (file)
@@ -171,7 +171,6 @@ class RenderWidgetHostViewEfl
 
   void set_magnifier(bool status);
 
-  void Init(Evas_Object* view);
   void Init_EvasGL(int width, int height);
   void CreateNativeSurface(int width, int height);
 
index 8530c06..f2c35ae 100644 (file)
@@ -86,7 +86,7 @@ RenderWidgetHostViewBase* WebContentsViewEfl::CreateViewForWidget(
 
   RenderWidgetHostViewEfl* view =
       new RenderWidgetHostViewEfl(render_widget_host);
-  view->Init(native_view_);
+  view->InitAsChild(native_view_);
 
   elm_naviframe_item_pop(naviframe_);
   Evas_Object* content_view = static_cast<Evas_Object*>(view->GetNativeView());