Commit 24a1509f authored by Gustavo Noronha's avatar Gustavo Noronha

Disable X11 and GTK+ dependencies

Disable X11 code, remove cefclient from build to remove gtk dependency.
parent d4ed7f22
......@@ -218,7 +218,6 @@ gypi_paths2 = exec_script("//build/gypi_to_gn.py",
group("cef") {
testonly = true
deps = [
":cefclient",
":cefsimple",
":ceftests",
]
......@@ -838,10 +837,9 @@ static_library("libcef_static") {
"libcef/browser/osr/render_widget_host_view_osr_linux.cc",
"libcef/browser/printing/print_dialog_linux.cc",
"libcef/browser/printing/print_dialog_linux.h",
"libcef/browser/native/window_x11.cc",
"libcef/browser/native/window_x11.h",
]
deps += [
"//build/config/freetype",
"//third_party/fontconfig",
......@@ -986,16 +984,23 @@ static_library("libcef_static") {
# Part of //ui/aura:test_support which is testingonly.
"//ui/aura/test/aura_test_utils.cc",
"//ui/aura/test/aura_test_utils.h",
"//ui/aura/test/ui_controls_factory_aurax11.cc",
"//ui/aura/test/x11_event_sender.cc",
"//ui/aura/test/x11_event_sender.h",
# Part of //ui/events:test_support which is testingonly.
"//ui/events/test/platform_event_waiter.cc",
"//ui/events/test/platform_event_waiter.h",
# Part of //ui/views:test_support which is testingonly.
"//ui/views/test/ui_controls_factory_desktop_aurax11.cc",
"//ui/views/test/ui_controls_factory_desktop_aurax11.h",
]
if (use_x11) {
sources += [
# Support for UI input events.
# Part of //ui/aura:test_support which is testingonly.
"//ui/aura/test/ui_controls_factory_aurax11.cc",
"//ui/aura/test/x11_event_sender.cc",
"//ui/aura/test/x11_event_sender.h",
# Part of //ui/views:test_support which is testingonly.
"//ui/views/test/ui_controls_factory_desktop_aurax11.cc",
"//ui/views/test/ui_controls_factory_desktop_aurax11.h",
]
}
}
} else {
sources += [
......@@ -1756,6 +1761,7 @@ if (is_mac) {
]
}
} else {
if (use_x11) {
#
# cefclient targets.
#
......@@ -1864,6 +1870,7 @@ if (is_mac) {
}
}
}
} # use_x11
#
......@@ -1909,9 +1916,11 @@ if (is_mac) {
sources += gypi_paths2.includes_linux +
gypi_paths2.cefsimple_sources_linux
libs = [
"X11",
]
if (use_x11) {
libs = [
"X11",
]
}
if (!is_component_build) {
# Set rpath to find our own libfreetype even in a non-component build.
......@@ -1969,9 +1978,11 @@ if (is_mac) {
sources += gypi_paths2.shared_sources_linux +
gypi_paths2.ceftests_sources_linux
libs = [
"X11",
]
if (use_x11) {
libs = [
"X11",
]
}
deps += [
":copy_ceftests_files",
......
......@@ -42,9 +42,15 @@ typedef struct _XDisplay XDisplay;
#include "include/internal/cef_string.h"
// Handle types.
#if defined(USE_AURA)
#define cef_cursor_handle_t void*
#define cef_event_handle_t XEvent*
#define cef_window_handle_t unsigned long
#elif
#define cef_cursor_handle_t unsigned long
#define cef_event_handle_t XEvent*
#define cef_window_handle_t unsigned long
#endif
#define kNullCursorHandle 0
#define kNullEventHandle NULL
......
......@@ -14,7 +14,7 @@
#include "libcef/browser/context.h"
#include "libcef/browser/native/menu_runner_linux.h"
#include "libcef/browser/native/window_delegate_view.h"
#include "libcef/browser/native/window_x11.h"
//#include "libcef/browser/native/window_ozone.h"
#include "libcef/browser/thread_util.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
......@@ -27,7 +27,7 @@
#include "ui/events/keycodes/keyboard_code_conversion_xkb.h"
#include "ui/events/keycodes/keysym_to_unicode.h"
#include "ui/gfx/font_render_params.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
#include "ui/views/mus/desktop_window_tree_host_mus.h"
#include "ui/views/widget/widget.h"
namespace {
......@@ -47,8 +47,12 @@ CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux(
SkColor background_color)
: CefBrowserPlatformDelegateNative(window_info, background_color),
host_window_created_(false),
window_widget_(nullptr),
window_x11_(nullptr) {}
window_widget_(nullptr)
#if 0
,window_x11_(nullptr)
#endif
{
}
void CefBrowserPlatformDelegateNativeLinux::BrowserDestroyed(
CefBrowserHostImpl* browser) {
......@@ -61,7 +65,7 @@ void CefBrowserPlatformDelegateNativeLinux::BrowserDestroyed(
}
bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
DCHECK(!window_x11_);
//DCHECK(!window_ozone_);
DCHECK(!window_widget_);
if (window_info_.width == 0)
......@@ -72,6 +76,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
gfx::Rect rect(window_info_.x, window_info_.y, window_info_.width,
window_info_.height);
#if 0
// Create a new window object. It will delete itself when the associated X11
// window is destroyed.
window_x11_ = new CefWindowX11(browser_, window_info_.parent_window, rect);
......@@ -91,7 +96,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
window_widget_->Show();
window_x11_->Show();
#endif
// As an additional requirement on Linux, we must set the colors for the
// render widgets in webkit.
content::RendererPreferences* prefs =
......@@ -123,8 +128,10 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
}
void CefBrowserPlatformDelegateNativeLinux::CloseHostWindow() {
#if 0
if (window_x11_)
window_x11_->Close();
#endif
}
CefWindowHandle CefBrowserPlatformDelegateNativeLinux::GetHostWindowHandle()
......@@ -147,19 +154,20 @@ void CefBrowserPlatformDelegateNativeLinux::SendFocusEvent(bool setFocus) {
// hierarchy. This does not change the native keyboard focus.
browser_->web_contents()->Focus();
}
#if 0
if (window_x11_) {
// Give native focus to the DesktopNativeWidgetAura for the root window.
// Needs to be done via the ::Window so that keyboard focus is assigned
// correctly.
window_x11_->Focus();
}
#endif
}
void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
// Call the parent method to dismiss any existing popups.
CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted();
#if 0
if (!window_x11_)
return;
......@@ -177,20 +185,23 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
content::RenderWidgetHostImpl::From(
browser_->web_contents()->GetRenderViewHost()->GetWidget())
->SendScreenRects();
#endif
}
void CefBrowserPlatformDelegateNativeLinux::SizeTo(int width, int height) {
#if 0
if (window_x11_) {
window_x11_->SetBounds(
gfx::Rect(window_x11_->bounds().origin(), gfx::Size(width, height)));
}
#endif
}
gfx::Point CefBrowserPlatformDelegateNativeLinux::GetScreenPoint(
const gfx::Point& view) const {
if (windowless_handler_)
return windowless_handler_->GetParentScreenPoint(view);
#if 0
if (!window_x11_)
return view;
......@@ -200,6 +211,8 @@ gfx::Point CefBrowserPlatformDelegateNativeLinux::GetScreenPoint(
const gfx::Rect& bounds_in_screen = window_x11_->GetBoundsInScreen();
return gfx::Point(bounds_in_screen.x() + view.x(),
bounds_in_screen.y() + view.y());
#endif
return gfx::Point(0, 0);
}
void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) {
......@@ -260,7 +273,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent(
default:
NOTREACHED();
}
#if 0
// Populate DOM values that will be passed to JavaScript handlers via
// KeyboardEvent.
result.dom_code = static_cast<int>(
......@@ -276,6 +289,7 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateKeyEvent(
result.SetModifiers(result.GetModifiers() |
TranslateModifiers(key_event.modifiers));
#endif
}
void CefBrowserPlatformDelegateNativeLinux::TranslateClickEvent(
......@@ -369,7 +383,8 @@ CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
if (!event.os_event)
return NULL;
return const_cast<CefEventHandle>(event.os_event->native_event());
//return const_cast<CefEventHandle>(event.os_event->native_event());
return NULL;
}
std::unique_ptr<CefMenuRunner>
......
......@@ -7,7 +7,7 @@
#include "libcef/browser/native/browser_platform_delegate_native.h"
class CefWindowX11;
//class CefWindowOzone;
// Windowed browser implementation for Linux.
class CefBrowserPlatformDelegateNativeLinux
......@@ -59,7 +59,7 @@ class CefBrowserPlatformDelegateNativeLinux
// associated root window is destroyed.
views::Widget* window_widget_;
CefWindowX11* window_x11_;
//CefWindowOzone* window_ozone_;
};
#endif // CEF_LIBCEF_BROWSER_NATIVE_BROWSER_PLATFORM_DELEGATE_NATIVE_LINUX_H_
......@@ -15,6 +15,7 @@
#include "ui/base/x/x11_util.h"
#include "ui/gfx/x/x11_types.h"
#if 0
namespace {
// Based on ui/base/cursor/cursor_loader_x11.cc.
......@@ -163,25 +164,27 @@ XCursorCache* cursor_cache = nullptr;
}
} // namespace
#endif
void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget(
bool is_guest_view_hack) {
// Create a hidden 1x1 window. It will delete itself on close.
window_ = new CefWindowX11(NULL, None, gfx::Rect(0, 0, 1, 1));
compositor_widget_ = window_->xwindow();
//window_ = new CefWindowX11(NULL, None, gfx::Rect(0, 0, 1, 1));
//compositor_widget_ = window_->xwindow();
}
void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget(
const gfx::Size&) {}
void CefRenderWidgetHostViewOSR::PlatformDestroyCompositorWidget() {
DCHECK(window_);
window_->Close();
//DCHECK(window_);
//window_->Close();
compositor_widget_ = gfx::kNullAcceleratedWidget;
}
ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor(
blink::WebCursorInfo::Type type) {
#if 0
if (type == WebCursorInfo::kTypeNone) {
if (!invisible_cursor_) {
invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(),
......@@ -191,4 +194,6 @@ ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor(
} else {
return GetXCursor(ToCursorID(type));
}
#endif
return nullptr;
}
......@@ -20,9 +20,6 @@
#include "ui/aura/test/ui_controls_factory_aura.h"
#include "ui/aura/window.h"
#include "ui/base/test/ui_controls_aura.h"
#if defined(OS_LINUX)
#include "ui/views/test/ui_controls_factory_desktop_aurax11.h"
#endif
#endif
#if defined(OS_WIN)
......@@ -37,6 +34,7 @@ void InitializeUITesting() {
if (!initialized) {
ui_controls::EnableUIControls();
#if 0
#if defined(USE_AURA)
#if defined(OS_LINUX)
ui_controls::InstallUIControlsAura(
......@@ -45,7 +43,7 @@ void InitializeUITesting() {
ui_controls::InstallUIControlsAura(aura::test::CreateUIControlsAura(NULL));
#endif
#endif
#endif
initialized = true;
}
}
......
......@@ -12,11 +12,6 @@
#include "ui/views/widget/widget.h"
#include "ui/views/window/native_frame_view.h"
#if defined(OS_LINUX)
#include <X11/Xlib.h>
#include "ui/gfx/x/x11_types.h"
#endif
#if defined(OS_WIN)
#include "ui/display/screen.h"
#include "ui/views/win/hwnd_util.h"
......@@ -270,6 +265,7 @@ void CefWindowView::CreateWidget() {
// |widget| must be activatable for focus handling to work correctly.
DCHECK(widget->widget_delegate()->CanActivate());
#if 0
#if defined(OS_LINUX)
if (is_frameless_) {
::Window window = view_util::GetWindowHandle(widget);
......@@ -306,6 +302,7 @@ void CefWindowView::CreateWidget() {
PropModeReplace, (unsigned char*)&hints, 5);
}
#endif // defined(OS_LINUX)
#endif
}
CefRefPtr<CefWindow> CefWindowView::GetCefWindow() const {
......
......@@ -4,10 +4,11 @@
#include "tests/cefsimple/simple_app.h"
#include <X11/Xlib.h>
//#include <X11/Xlib.h>
#include "include/base/cef_logging.h"
#if 0
namespace {
int XErrorHandlerImpl(Display* display, XErrorEvent* event) {
......@@ -26,6 +27,7 @@ int XIOErrorHandlerImpl(Display* display) {
}
} // namespace
#endif
// Entry point function for all processes.
int main(int argc, char* argv[]) {
......@@ -41,10 +43,12 @@ int main(int argc, char* argv[]) {
return exit_code;
}
#if 0
// Install xlib error handlers so that the application won't be terminated
// on non-fatal errors.
XSetErrorHandler(XErrorHandlerImpl);
XSetIOErrorHandler(XIOErrorHandlerImpl);
#endif
// Specify CEF global settings here.
CefSettings settings;
......
......@@ -4,8 +4,11 @@
#include "tests/cefsimple/simple_handler.h"
#if defined(USE_X11)
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#endif
#include <string>
#include "include/base/cef_logging.h"
......@@ -14,7 +17,7 @@
void SimpleHandler::PlatformTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) {
std::string titleStr(title);
#if defined(USE_X11)
// Retrieve the X11 display shared with Chromium.
::Display* display = cef_get_xdisplay();
DCHECK(display);
......@@ -41,4 +44,5 @@ void SimpleHandler::PlatformTitleChange(CefRefPtr<CefBrowser> browser,
// is Compound Text. This shouldn't matter 90% of the time since this is the
// fallback to the UTF8 property above.
XStoreName(display, browser->GetHost()->GetWindowHandle(), titleStr.c_str());
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment