From 8c44d95f633d855de44296a85f0c057349312832 Mon Sep 17 00:00:00 2001 From: Piotr Tworek Date: Thu, 19 Mar 2015 11:44:10 +0100 Subject: [PATCH] Use virtual InitAsChild function to initialize RenderWidgetHostViewEfl 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 --- .../browser/renderer_host/render_widget_host_view_efl.cc | 16 ++++++---------- .../browser/renderer_host/render_widget_host_view_efl.h | 1 - .../browser/web_contents/web_contents_view_efl.cc | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc index 72066d6..3efca43 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc @@ -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(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(); } diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h index b7cc4b1..34f9abd 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h +++ b/tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h @@ -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); diff --git a/tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc b/tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc index 8530c06..f2c35ae 100644 --- a/tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc +++ b/tizen_src/chromium_impl/content/browser/web_contents/web_contents_view_efl.cc @@ -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(view->GetNativeView()); -- 2.7.4