class WindowFactory {
public:
- // TODO: Function should return NativeView, once NativeView typedef is fixed
- static Evas_Object* GetHostWindow(const content::WebContents*);
+ typedef Evas_Object* (*GetHostWindowDelegate)(const content::WebContents*);
+
+ // TODO: Function should return NativeView, once NativeView typedef is fixed
+ static Evas_Object* GetHostWindow(const content::WebContents*);
+
+ static void SetDelegate(GetHostWindowDelegate d) { delegate_ = d; };
private:
- static void OnWindowRemoved(void*, Evas_Object*, void*);
+ static void OnWindowRemoved(void*, Evas_Object*, void*);
static std::map<const content::WebContents*, Evas_Object*> window_map_;
+ static GetHostWindowDelegate delegate_;
};
} // namespace efl
#include "common/content_client_efl.h"
#include "common/render_messages_ewk.h"
#include "common/version_info.h"
+#include "common/web_contents_utils.h"
#include "components/sessions/serialized_navigation_entry.h"
#include "components/sessions/content/content_serialized_navigation_builder.h"
#include "private/ewk_policy_decision_private.h"
using namespace content;
using namespace tizen_webview;
+using web_contents_utils::WebViewFromWebContents;
// GetContentClient() is defined in content_client.cc, but in content_client.h
// it is hidden by CONTENT_IMPLEMENTATION ifdef. We don't want to define
#endif
context_(context),
evas_object_(object),
+ native_view_(object),
touch_events_enabled_(false),
mouse_events_enabled_(false),
text_zoom_factor_(1.0),
DCHECK(new_object);
}
+//static
+Evas_Object* EWebView::GetHostWindowDelegate(
+ const content::WebContents* wc) {
+ EWebView* thiz = WebViewFromWebContents(wc);
+ Evas_Object* parent = elm_object_top_widget_get(thiz->evas_object_);
+ if (parent)
+ return parent;
+ return thiz->evas_object_;
+}
+
void EWebView::SetURL(const char* url_string) {
GURL url(url_string);
NavigationController::LoadURLParams params(url);
back_forward_list_.reset(
new tizen_webview::BackForwardList(web_contents_->GetController()));
+
+ native_view_ = static_cast<Evas_Object*>(web_contents_->GetNativeView());
}
#if defined(OS_TIZEN_MOBILE) && !defined(EWK_BRINGUP)
}
bool EWebView::HandleShow() {
-#if defined(EWK_REFACTOR)
- if (rwhv()) {
- rwhv()->HandleShow();
- return true;
- }
- return false;
-#else
- NOTIMPLEMENTED();
- return false;
-#endif
+ if (!native_view_)
+ return false;
+ evas_object_show(native_view_);
+ return true;
}
bool EWebView::HandleHide() {
-#if defined(EWK_REFACTOR)
- if (rwhv()) {
- rwhv()->HandleHide();
- return true;
- }
- return false;
-#else
- NOTIMPLEMENTED();
- return false;
-#endif
+ if (!native_view_)
+ return false;
+ evas_object_hide(native_view_);
+ return true;
}
bool EWebView::HandleMove(int x, int y) {
-#if defined(EWK_REFACTOR)
- if (rwhv()) {
- rwhv()->HandleMove(x, y);
- return true;
- }
- return false;
-#else
- NOTIMPLEMENTED();
- return false;
-#endif
+ if (!native_view_)
+ return false;
+ evas_object_move(native_view_, x, y);
+ return true;
}
bool EWebView::HandleResize(int width, int height) {
-#if defined(EWK_REFACTOR)
- if (rwhv()) {
- rwhv()->HandleResize(width, height);
- return true;
- }
- return false;
-#else
- NOTIMPLEMENTED();
- return false;
-#endif
+ if (!native_view_)
+ return false;
+ evas_object_resize(native_view_, width, height);
+ return true;
}
bool EWebView::HandleFocusIn() {
-#if defined(EWK_REFACTOR)
- if (rwhv()) {
- rwhv()->HandleFocusIn();
- return true;
- }
- return false;
-#else
- NOTIMPLEMENTED();
- return false;
-#endif
+ if (!native_view_)
+ return false;
+ elm_object_focus_set(native_view_, EINA_TRUE);
+ return true;
}
bool EWebView::HandleFocusOut() {
-#if defined(EWK_REFACTOR)
- if (rwhv()) {
- rwhv()->HandleFocusOut();
- return true;
- }
- return false;
-#else
- NOTIMPLEMENTED();
- return false;
-#endif
+ if (!native_view_)
+ return false;
+ elm_object_focus_set(native_view_, EINA_FALSE);
+ return true;
}
bool EWebView::HandleEvasEvent(const Evas_Event_Mouse_Down* event) {
void Initialize();
void CreateNewWindow(content::WebContentsDelegate::WebContentsCreateCallback);
+ static Evas_Object* GetHostWindowDelegate(const content::WebContents*);
tizen_webview::WebView* GetPublicWebView();
#if defined(EWK_REFACTOR)
scoped_ptr<tizen_webview::Frame> frame_;
scoped_ptr<tizen_webview::PolicyDecision> window_policy_;
Evas_Object* evas_object_;
+ Evas_Object* native_view_;
bool touch_events_enabled_;
bool mouse_events_enabled_;
double text_zoom_factor_;
#include "content/browser/utility_process_host_impl.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/gpu/gpu_thread_override_efl.h"
+#include "efl/window_factory.h"
+#include "eweb_view.h"
#include "tizen_webview/public/tw_web_context.h"
#include "ui/base/resource/resource_bundle.h"
DCHECK(message_pump_overridden);
ui::InstallScreenInstance();
+ efl::WindowFactory::SetDelegate(&EWebView::GetHostWindowDelegate);
instance_->content_main_delegate_efl_ = new ContentMainDelegateEfl();
content::ContentMainParams params(instance_->content_main_delegate_efl_);