When a new window is created originated from window.open
or target=_blank, we have to follow EWK procedure
of creating windows: a smart signal is emitted, and the embedding
app can allow or deny the creation.
In that process, RWHVEfl is created when
WebContentsView::CreateViewForWidget is called from
WebContentsImplEfl::HandleNewWebContentsCreate.
RWHVEfl owns SelectionControllEfl. At the time of its
creation, we have to ensure that the EFL widgets are
properly set up. Patch adds a hook to allow that.
In regular window creation, for example, when user clicks
a new window/tab button, the regular chromium flow is taken,
instead of this special codepath.
Original beta/m42 patch:
- http://165.213.202.130/gerrit/#/c/90112/ , reviewed by
Janusz Majnert, arno renevier.
Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=14476
Reviewed by: a.renevier
Change-Id: If250990897051af40fee36224bdc278521bb6d9a
Signed-off-by: Antonio Gomes <a1.gomes@samsung.com>
// Added for EFL port
new_contents->platform_data_ = platform_data;
- // Added for EFL port
+ if (efl_delegate_)
+ efl_delegate_->SetUpSmartObject(platform_data, new_contents->GetNativeView());
+ // End of EFL port specific code.
// Save the window for later if we're not suppressing the opener (since it
// will be shown immediately).
// such case the function should return true. Returning false means new web
// contents creation should be handled in normal, synchronous manner.
virtual bool WebContentsCreateAsync(WebContentsCreateCallback) = 0;
+
+ // Make it possible to early hook native_view and its associated smart
+ // parent.
+ // This is needed when a window is created with window.open or target:_blank,
+ // where RenderWidgetHostViewXXX objects are created earlier in the call chain.
+ virtual void SetUpSmartObject(void* platform_data, void* native_view) = 0;
};
} // namespace content
Ewk_Context* context() const { return context_.get(); }
Evas_Object* evas_object() const { return evas_object_; }
+ Evas_Object* native_view() const { return native_view_; }
Evas* GetEvas() const { return evas_object_evas_get(evas_object_); }
PermissionPopupManager* GetPermissionPopupManager() const
{
web_view_->CreateNewWindow(callback);
return true;
}
+
+void WebContentsEflDelegateEwk::SetUpSmartObject(void* platform_data, void* native_view) {
+ EWebView* new_web_view = static_cast<EWebView*>(platform_data);
+ Evas_Object* _native_view = static_cast<Evas_Object*>(native_view);
+ evas_object_smart_member_add(_native_view, new_web_view->evas_object());
+}
bool WebContentsCreateAsync(WebContentsCreateCallback) override;
+ void SetUpSmartObject(void*platform_data, void* native_view) override;
+
private:
EWebView* web_view_;