return host_;
}
+#if defined(USE_WAYLAND)
+Ecore_Wl_Window* RenderWidgetHostViewEfl::GetEcoreWlWindow() const {
+ const Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
+ return ecore_evas_wayland_window_get(ee);
+}
+#else
Ecore_X_Window RenderWidgetHostViewEfl::GetEcoreXWindow() const {
- Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
+ const Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_);
return ecore_evas_gl_x11_window_get(ee);
}
+#endif
void RenderWidgetHostViewEfl::SetSize(const gfx::Size& size) {
// This is a hack. See WebContentsView::SizeContents
int height = std::min(size.height(), EFL_MAX_HEIGHT);
if (popup_type_ != blink::WebPopupTypeNone) {
// We're a popup, honor the size request.
- // TODO: Webview TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
- ecore_x_window_resize(GetEcoreXWindow(), width, height);
+#if defined(USE_WAYLAND)
+ ecore_wl_window_resize(GetEcoreWlWindow(), width, height, 0);
#else
- NOTIMPLEMENTED();
+ ecore_x_window_resize(GetEcoreXWindow(), width, height);
#endif
}
}
void RenderWidgetHostViewEfl::MovePluginContainer(const WebPluginGeometry& move) {
+#if defined(USE_WAYLAND)
+ Ecore_Wl_Window* surface_window = nullptr;
+ PluginWindowToWidgetMap::const_iterator i = plugin_window_to_widget_map_.find(move.window);
+
+ if (i != plugin_window_to_widget_map_.end())
+ surface_window = i->second;
+
+ if (!surface_window)
+ return;
+
+ if (!move.visible) {
+ ecore_wl_window_hide(surface_window);
+ return;
+ }
+
+ ecore_wl_window_show(surface_window);
+
+ if (!move.rects_valid)
+ return;
+
+ ecore_wl_window_move(surface_window, move.window_rect.x(), move.window_rect.y());
+ ecore_wl_window_resize(surface_window, move.window_rect.width(), move.window_rect.height(), 0);
+#else
Ecore_X_Window surface_window = 0;
PluginWindowToWidgetMap::const_iterator i = plugin_window_to_widget_map_.find(move.window);
return;
if (!move.visible) {
- // TODO: Webview TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
ecore_x_window_hide(surface_window);
-#else
- NOTIMPLEMENTED();
-#endif
return;
}
- // TODO: Webview TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
ecore_x_window_show(surface_window);
-#else
- NOTIMPLEMENTED();
-#endif
if (!move.rects_valid)
return;
- // TODO: Webview TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
ecore_x_window_move(surface_window, move.window_rect.x(), move.window_rect.y());
ecore_x_window_resize(surface_window, move.window_rect.width(), move.window_rect.height());
-#else
- NOTIMPLEMENTED();
#endif
}
static void EvasObjectImagePixelsGetCallback(void*, Evas_Object*);
void initializeProgram();
+#if defined(USE_WAYLAND)
+ Ecore_Wl_Window* GetEcoreWlWindow() const;
+#else
Ecore_X_Window GetEcoreXWindow() const;
+#endif
void PaintTextureToSurface(GLuint texture_id);
bool evas_gl_initialized_;
float device_scale_factor_;
+#if defined(USE_WAYLAND)
+ typedef std::map<gfx::PluginWindowHandle, Ecore_Wl_Window*> PluginWindowToWidgetMap;
+#else
typedef std::map<gfx::PluginWindowHandle, Ecore_X_Window> PluginWindowToWidgetMap;
+#endif
PluginWindowToWidgetMap plugin_window_to_widget_map_;
bool magnifier_;
evas_object_show(popup_);
evas_object_focus_set(popup_, true);
- int width, height;
-#if !defined(WAYLAND_BRINGUP)
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
+ int width = 0, height = 0;
+#if defined(USE_WAYLAND)
+ ecore_wl_screen_size_get(&width, &height);
#else
- NOTIMPLEMENTED();
+ ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
evas_object_resize(popup_, width, height);
evas_object_move(popup_, 0, 0);
return;
int popupHeight;
- int width, height;
-#if !defined(WAYLAND_BRINGUP)
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
+ int width = 0, height = 0;
+#if defined(USE_WAYLAND)
+ ecore_wl_screen_size_get(&width, &height);
#else
- NOTIMPLEMENTED();
+ ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
evas_object_geometry_get(obj, 0, 0, 0, &popupHeight);
}
}
-#if !defined(WAYLAND_BRINGUP)
- int width = 0;
- int height = 0;
- ecore_x_screen_size_get(ecore_x_default_screen_get(), &width, &height);
-#else
- NOTIMPLEMENTED();
-#endif
-
evas_object_size_hint_weight_set(popup_, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
static Elm_Genlist_Item_Class _context_menu_list_item;
int width = 0;
int height = 0;
- // TODO: Webview and Rendering TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
+#if defined(USE_WAYLAND)
+ // Screen orientation is already considered in ecore_wl_screen_size_get function.
+ ecore_wl_screen_size_get(&width, &height);
+#else
if (orientation == 0 || orientation == 180) {
ecore_x_screen_size_get(ecore_x_default_screen_get(), &width, &height);
} else {
ecore_x_screen_size_get(ecore_x_default_screen_get(), &height, &width);
}
-#else
- NOTIMPLEMENTED();
#endif
if (context_menu_)
context_menu_->SetPopupSize(width, height);
if (use_fullscreen) {
// FIXME: this is wrong with dual screen configuration (desktop).
// We should use XineramaQueryScreens for that setup.
- // TODO: Webview and Rendering TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
+#if defined(USE_WAYLAND)
+ ecore_wl_screen_size_get(&width, &height);
+#else
ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
ecore_evas_size_base_set(ee, width, height);
{
Evas_Object *window = elm_win_add(NULL, "ChromiumEfl", ELM_WIN_BASIC);
if (window) {
- int width, height;
+ int width = 0, height = 0;
elm_win_title_set(window, "ChromiumEfl");
evas_object_size_hint_weight_set(window, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(window, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_win_borderless_set(window, EINA_TRUE);
elm_win_conformant_set(window, EINA_TRUE);
- // TODO: Webview and Rendering TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
+#if defined(USE_WAYLAND)
+ ecore_wl_screen_size_get(&width, &height);
+#else
ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
evas_object_resize(window, width, height);
void get_main_window_size(int *changed_ang, int *width, int *height)
{
+#if defined(USE_WAYLAND)
+ // Screen orientation is already considered in ecore_wl_screen_size_get function.
+ ecore_wl_screen_size_get(width, height);
+#else
switch (*changed_ang) {
case APP_DEVICE_ORIENTATION_0:
- // TODO: Webview and Rendering TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
ecore_x_window_size_get(ecore_x_window_root_first_get(), width, height);
-#endif
break;
case APP_DEVICE_ORIENTATION_90:
case APP_DEVICE_ORIENTATION_270:
- // TODO: Webview and Rendering TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
ecore_x_window_size_get(ecore_x_window_root_first_get(), height, width);
-#endif
break;
default:
return;
}
+#endif
}
void __load_started_cb(void *data, Evas_Object *obj, void *event_info)
#if defined(OS_TIZEN_TV)
/* On SIP close, Toolbar bring back to original position*/
if (is_imf_shown) {
- int width, height;
- // TODO: Webview and Rendering TG will implement following for Wayland.
-#if !defined(WAYLAND_BRINGUP)
+ int width = 0, height = 0;
+#if defined(USE_WAYLAND)
+ ecore_wl_screen_size_get(&width, &height);
+#else
ecore_x_window_size_get(ecore_x_window_root_first_get(), &width, &height);
#endif
//evas_object_resize(data->webview, width, height - TOOL_BOX_HEIGHT);