ozone: //content: clean up from USE_X11
This is another CL that removes USE_X11 define and gn arg usage from //content and also removes IsUsingOzonePlatform condition as it's no longer needed as it always resolves to true. Bug: 1096425 Change-Id: Ibbf2e861b46ffd8156dfe6fd5c6df75c54b83ba9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198073 Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Maksim Sisov <msisov@igalia.com> Cr-Commit-Position: refs/heads/main@{#937765}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
b1ba329c99
commit
2ac2c31fcb
content
browser
common
gpu
public
renderer
shell
test
web_test
@ -2256,10 +2256,6 @@ source_set("browser") {
|
||||
deps += [ "//ui/events" ]
|
||||
}
|
||||
|
||||
if (use_x11) {
|
||||
deps += [ "//ui/base/x" ]
|
||||
}
|
||||
|
||||
if (use_ozone) {
|
||||
deps += [ "//ui/ozone:buildflags" ]
|
||||
}
|
||||
@ -2644,13 +2640,6 @@ source_set("browser") {
|
||||
deps += [ "//third_party/fontconfig" ]
|
||||
}
|
||||
|
||||
if (use_x11) {
|
||||
deps += [
|
||||
"//ui/events/platform/x11",
|
||||
"//ui/gfx/x",
|
||||
]
|
||||
}
|
||||
|
||||
if (use_pangocairo) {
|
||||
configs += [ "//build/config/linux/pangocairo" ]
|
||||
}
|
||||
|
@ -224,12 +224,6 @@
|
||||
#include "content/browser/media/cdm_registry_impl.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
#include "gpu/config/gpu_driver_bug_workaround_type.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/base/x/x11_util.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if defined(USE_NSS_CERTS)
|
||||
#include "crypto/nss_util.h"
|
||||
#endif
|
||||
@ -533,13 +527,6 @@ int BrowserMainLoop::EarlyInitialization() {
|
||||
DCHECK(SandboxHostLinux::GetInstance()->IsInitialized());
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
if (!features::IsUsingOzonePlatform() && UsingInProcessGpu() &&
|
||||
!x11::Connection::Get()->Ready()) {
|
||||
LOG(ERROR) << "Failed to open an X11 connection.";
|
||||
}
|
||||
#endif
|
||||
|
||||
// GLib's spawning of new processes is buggy, so it's important that at this
|
||||
// point GLib does not need to start DBUS. Chrome should always start with
|
||||
// DBUS_SESSION_BUS_ADDRESS properly set. See crbug.com/309093.
|
||||
@ -1394,16 +1381,6 @@ bool BrowserMainLoop::InitializeToolkit() {
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA)
|
||||
|
||||
#if defined(USE_X11)
|
||||
if (!features::IsUsingOzonePlatform() &&
|
||||
!parsed_command_line_.HasSwitch(switches::kHeadless) &&
|
||||
!x11::Connection::Get()->Ready()) {
|
||||
LOG(ERROR) << "Unable to open X display.";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Env creates the compositor. Aura widgets need the compositor to be created
|
||||
// before they can be initialized by the browser.
|
||||
env_ = aura::Env::CreateInstance();
|
||||
|
@ -75,10 +75,6 @@
|
||||
#include "ui/gl/gpu_preference.h"
|
||||
#include "ui/gl/gpu_switching_manager.h"
|
||||
|
||||
#if defined(USE_OZONE) || defined(USE_X11)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
#include "base/android/application_status_listener.h"
|
||||
#endif
|
||||
@ -100,19 +96,13 @@ namespace content {
|
||||
|
||||
namespace {
|
||||
|
||||
// On X11 (Ozone and non-Ozone), we do not know GpuMemoryBuffer configuration
|
||||
// support until receiving the initial GPUInfo.
|
||||
// On X11, we do not know GpuMemoryBuffer configuration support until receiving
|
||||
// the initial GPUInfo.
|
||||
bool CanUpdateGmbGpuPreferences() {
|
||||
#if defined(USE_OZONE)
|
||||
if (features::IsUsingOzonePlatform()) {
|
||||
return !ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.fetch_buffer_formats_for_gmb_on_gpu;
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_X11)
|
||||
DCHECK(!features::IsUsingOzonePlatform());
|
||||
return false;
|
||||
return !ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.fetch_buffer_formats_for_gmb_on_gpu;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
@ -1377,11 +1367,9 @@ void GpuDataManagerImplPrivate::UpdateGpuPreferences(
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
if (features::IsUsingOzonePlatform()) {
|
||||
gpu_preferences->message_pump_type = ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.message_pump_type_for_gpu;
|
||||
}
|
||||
gpu_preferences->message_pump_type = ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.message_pump_type_for_gpu;
|
||||
#endif
|
||||
|
||||
#if defined(OS_MAC)
|
||||
|
@ -65,26 +65,12 @@
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#endif
|
||||
#endif // defined(USE_OZONE)
|
||||
|
||||
namespace content {
|
||||
namespace {
|
||||
|
||||
#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11)
|
||||
bool GetGmbConfigFromGpu() {
|
||||
#if defined(USE_OZONE)
|
||||
if (features::IsUsingOzonePlatform()) {
|
||||
return ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.fetch_buffer_formats_for_gmb_on_gpu;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
WebUIDataSource* CreateGpuHTMLSource() {
|
||||
WebUIDataSource* source = WebUIDataSource::Create(kChromeUIGpuHost);
|
||||
source->OverrideContentSecurityPolicy(
|
||||
@ -371,8 +357,10 @@ base::Value GpuMemoryBufferInfo(const gfx::GpuExtraInfo& gpu_extra_info) {
|
||||
gpu::GpuMemoryBufferSupport gpu_memory_buffer_support;
|
||||
|
||||
gpu::GpuMemoryBufferConfigurationSet native_config;
|
||||
#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11)
|
||||
if (GetGmbConfigFromGpu()) {
|
||||
#if defined(USE_OZONE_PLATFORM_X11)
|
||||
if (ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.fetch_buffer_formats_for_gmb_on_gpu) {
|
||||
for (const auto& config : gpu_extra_info.gpu_memory_buffer_support_x11) {
|
||||
native_config.emplace(config);
|
||||
}
|
||||
|
@ -36,16 +36,11 @@ viz::mojom::GpuService* GetGpuService(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11)
|
||||
#if defined(USE_OZONE_PLATFORM_X11)
|
||||
bool ShouldSetBufferFormatsFromGpuExtraInfo() {
|
||||
#if defined(USE_OZONE)
|
||||
if (features::IsUsingOzonePlatform()) {
|
||||
return ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.fetch_buffer_formats_for_gmb_on_gpu;
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
return ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
.fetch_buffer_formats_for_gmb_on_gpu;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -84,9 +79,8 @@ GpuMemoryBufferManagerSingleton::GetInstance() {
|
||||
}
|
||||
|
||||
void GpuMemoryBufferManagerSingleton::OnGpuExtraInfoUpdate() {
|
||||
#if defined(USE_X11) || defined(USE_OZONE_PLATFORM_X11)
|
||||
// X11 and non-Ozone/X11 fetch buffer formats on gpu and pass them via gpu
|
||||
// extra info.
|
||||
#if defined(USE_OZONE_PLATFORM_X11)
|
||||
// X11 fetches buffer formats on gpu and passes them via gpu extra info.
|
||||
if (!ShouldSetBufferFormatsFromGpuExtraInfo())
|
||||
return;
|
||||
|
||||
|
@ -41,22 +41,6 @@ const char kShellExecutableName[] = "content_shell";
|
||||
const char kMojoCoreLibraryName[] = "libmojo_core.so";
|
||||
#endif
|
||||
|
||||
const char* kSwitchesToCopy[] = {
|
||||
#if defined(USE_OZONE)
|
||||
// Keep the kOzonePlatform switch that the Ozone must use.
|
||||
switches::kOzonePlatform,
|
||||
#endif
|
||||
// Some tests use custom cmdline that doesn't hold switches from previous
|
||||
// cmdline. Only a couple of switches are copied. That can result in
|
||||
// incorrect initialization of a process. For example, the work that we do
|
||||
// to have use_x11 && use_ozone, requires UseOzonePlatform feature flag to
|
||||
// be passed to all the process to ensure correct path is chosen.
|
||||
// TODO(https://crbug.com/1096425): update this comment once USE_X11 goes
|
||||
// away.
|
||||
switches::kEnableFeatures,
|
||||
switches::kDisableFeatures,
|
||||
};
|
||||
|
||||
base::FilePath GetCurrentDirectory() {
|
||||
base::FilePath current_directory;
|
||||
CHECK(base::GetCurrentDirectory(¤t_directory));
|
||||
@ -81,9 +65,15 @@ class LaunchAsMojoClientBrowserTest : public ContentBrowserTest {
|
||||
GetFilePathNextToCurrentExecutable(kShellExecutableName));
|
||||
command_line.AppendSwitchPath(switches::kContentShellDataPath,
|
||||
temp_dir_.GetPath());
|
||||
#if defined(USE_OZONE)
|
||||
const base::CommandLine& cmdline = *base::CommandLine::ForCurrentProcess();
|
||||
const char* kSwitchesToCopy[] = {
|
||||
// Keep the kOzonePlatform switch that the Ozone must use.
|
||||
switches::kOzonePlatform,
|
||||
};
|
||||
command_line.CopySwitchesFrom(cmdline, kSwitchesToCopy,
|
||||
base::size(kSwitchesToCopy));
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
command_line.AppendSwitchASCII(switches::kUseGL,
|
||||
|
@ -267,7 +267,7 @@ void RenderViewHostImpl::GetPlatformSpecificPrefs(
|
||||
// TODO(crbug.com/1066605): Consider exposing this as a FIDL parameter.
|
||||
prefs->focus_ring_color = SK_AlphaTRANSPARENT;
|
||||
#endif
|
||||
#if defined(USE_OZONE) || defined(USE_X11)
|
||||
#if defined(USE_OZONE)
|
||||
prefs->selection_clipboard_buffer_available =
|
||||
ui::Clipboard::IsSupportedClipboardBuffer(
|
||||
ui::ClipboardBuffer::kSelection);
|
||||
|
@ -332,7 +332,7 @@ source_set("common") {
|
||||
deps += [ "//ppapi/proxy:ipc_sources" ]
|
||||
}
|
||||
|
||||
if (!use_x11 && !use_ozone) {
|
||||
if (!use_ozone) {
|
||||
sources -= [ "cursors/webcursor_ozone.cc" ]
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ std::string GetUserAgentPlatform() {
|
||||
return "";
|
||||
#elif defined(OS_MAC)
|
||||
return "Macintosh; ";
|
||||
#elif defined(USE_X11) || defined(USE_OZONE)
|
||||
#elif defined(USE_OZONE)
|
||||
return "X11; "; // strange, but that's what Firefox uses
|
||||
#elif defined(OS_ANDROID)
|
||||
return "Linux; ";
|
||||
|
@ -118,14 +118,6 @@ target(link_target_type, "gpu_sources") {
|
||||
deps += [ "//components/metal_util" ]
|
||||
}
|
||||
|
||||
if (use_x11) {
|
||||
deps += [
|
||||
"//ui/events/platform/x11",
|
||||
"//ui/gfx/linux:gpu_memory_buffer_support_x11",
|
||||
"//ui/gfx/x",
|
||||
]
|
||||
}
|
||||
|
||||
if (use_ozone) {
|
||||
deps += [ "//ui/ozone" ]
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "mojo/public/cpp/bindings/binder_map.h"
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#include "ui/ozone/public/ozone_platform.h"
|
||||
#endif
|
||||
|
||||
@ -25,8 +24,7 @@ void ExposeGpuInterfacesToBrowser(
|
||||
}
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
if (features::IsUsingOzonePlatform())
|
||||
ui::OzonePlatform::GetInstance()->AddInterfaces(binders);
|
||||
ui::OzonePlatform::GetInstance()->AddInterfaces(binders);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -82,13 +82,6 @@
|
||||
#include "sandbox/win/src/sandbox.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
#include "ui/base/x/x11_ui_thread.h" // nogncheck
|
||||
#include "ui/base/x/x11_util.h" // nogncheck
|
||||
#include "ui/gfx/linux/gpu_memory_buffer_support_x11.h" // nogncheck
|
||||
#include "ui/gfx/x/x11_switches.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#include "content/gpu/gpu_sandbox_hook_linux.h"
|
||||
#include "content/public/common/sandbox_init.h"
|
||||
@ -262,24 +255,7 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePumpType::DEFAULT);
|
||||
#elif defined(USE_X11) || defined(USE_OZONE)
|
||||
#if defined(USE_X11)
|
||||
if (!features::IsUsingOzonePlatform()) {
|
||||
// We need a UI loop so that we can grab the Expose events. See
|
||||
// GLSurfaceGLX and https://crbug.com/326995.
|
||||
if (!x11::Connection::Get()->Ready())
|
||||
return RESULT_CODE_GPU_DEAD_ON_ARRIVAL;
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePumpType::UI);
|
||||
event_source = ui::PlatformEventSource::CreateDefault();
|
||||
// Set up the X11UiThread before the sandbox gets set up. This cannot be
|
||||
// done later since opening the connection requires socket() and
|
||||
// connect().
|
||||
ui::X11UiThread::SetConnection(x11::Connection::Get()->Clone().release());
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_OZONE)
|
||||
#elif defined(USE_OZONE)
|
||||
// The MessagePump type required depends on the Ozone platform selected at
|
||||
// runtime.
|
||||
if (!main_thread_task_executor) {
|
||||
@ -287,7 +263,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
gpu_preferences.message_pump_type);
|
||||
}
|
||||
#endif
|
||||
#elif defined(OS_LINUX) || defined(OS_CHROMEOS)
|
||||
#error "Unsupported Linux platform."
|
||||
#elif defined(OS_MAC)
|
||||
@ -367,19 +342,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
GpuProcess gpu_process(io_thread_priority);
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
// ui::GbmDevice() takes >50ms with amdgpu, so kick off
|
||||
// GpuMemoryBufferSupportX11 creation on another thread now.
|
||||
if (!features::IsUsingOzonePlatform() &&
|
||||
gpu_preferences.enable_native_gpu_memory_buffers) {
|
||||
base::ThreadPool::PostTask(
|
||||
FROM_HERE, base::BindOnce([]() {
|
||||
SCOPED_UMA_HISTOGRAM_TIMER("Linux.X11.GbmSupportX11CreationTime");
|
||||
ui::GpuMemoryBufferSupportX11::GetInstance();
|
||||
}));
|
||||
}
|
||||
#endif
|
||||
|
||||
auto* client = GetContentClient()->gpu();
|
||||
if (client)
|
||||
client->PostIOThreadCreated(gpu_process.io_task_runner());
|
||||
|
@ -141,7 +141,7 @@ IPC_STRUCT_TRAITS_BEGIN(blink::RendererPreferences)
|
||||
IPC_STRUCT_TRAITS_MEMBER(arrow_bitmap_height_vertical_scroll_bar_in_dips)
|
||||
IPC_STRUCT_TRAITS_MEMBER(arrow_bitmap_width_horizontal_scroll_bar_in_dips)
|
||||
#endif
|
||||
#if defined(USE_X11) || defined(USE_OZONE)
|
||||
#if defined(USE_OZONE)
|
||||
IPC_STRUCT_TRAITS_MEMBER(selection_clipboard_buffer_available)
|
||||
#endif
|
||||
IPC_STRUCT_TRAITS_END()
|
||||
|
@ -242,18 +242,6 @@ class InitialNavigationObserver : public WebContentsObserver {
|
||||
} // namespace
|
||||
|
||||
BrowserTestBase::BrowserTestBase() {
|
||||
#if defined(USE_OZONE) && defined(USE_X11)
|
||||
// In case of the USE_OZONE + USE_X11 build, the OzonePlatform can either be
|
||||
// enabled or disabled. However, tests may override the FeatureList that will
|
||||
// result in unknown state for the UseOzonePlatform feature. Thus, the
|
||||
// features::IsUsingOzonePlatform has static const initializer that won't be
|
||||
// changed despite FeatureList being overridden. However, it requires to call
|
||||
// this method at least once so that the value is set correctly. This place
|
||||
// looks the most appropriate as tests haven't started to add own FeatureList
|
||||
// yet and we still have the original value set by base::TestSuite.
|
||||
ignore_result(features::IsUsingOzonePlatform());
|
||||
#endif
|
||||
|
||||
CHECK(!g_instance_already_created)
|
||||
<< "Each browser test should be run in a new process. If you are adding "
|
||||
"a new browser test suite that runs on Android, please add it to "
|
||||
@ -513,19 +501,6 @@ void BrowserTestBase::SetUp() {
|
||||
&disabled_features);
|
||||
}
|
||||
|
||||
#if defined(USE_X11) && defined(USE_OZONE)
|
||||
// Append OzonePlatform to the enabled features so that the CommandLine
|
||||
// instance has correct values, and other processes if any (GPU, for example),
|
||||
// also use correct path. features::IsUsingOzonePlatform() has static const
|
||||
// initializer, which means the value of the features::IsUsingOzonePlatform()
|
||||
// doesn't change even if tests override the FeatureList. Thus, it's correct
|
||||
// to call it now as it is set way earlier than tests override the features.
|
||||
//
|
||||
// TODO(https://crbug.com/1096425): remove this as soon as use_x11 goes away.
|
||||
if (features::IsUsingOzonePlatform())
|
||||
enabled_features += ",UseOzonePlatform";
|
||||
#endif
|
||||
|
||||
if (!enabled_features.empty()) {
|
||||
command_line->AppendSwitchASCII(switches::kEnableFeatures,
|
||||
enabled_features);
|
||||
|
@ -26,10 +26,6 @@
|
||||
#include "ui/aura/env.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_FUCHSIA)
|
||||
#include "ui/ozone/public/ozone_switches.h"
|
||||
#endif
|
||||
|
@ -127,22 +127,10 @@
|
||||
#include "base/win/windows_version.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA) && defined(USE_X11)
|
||||
#include "ui/events/event_constants.h"
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
#include "ui/events/test/events_test_utils.h"
|
||||
#include "ui/events/test/events_test_utils_x11.h"
|
||||
#include "ui/events/x/x11_event_translation.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11) && defined(USE_OZONE)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#endif
|
||||
|
||||
using blink::TestWebFrameContentDumper;
|
||||
using blink::WebFrame;
|
||||
using blink::WebGestureEvent;
|
||||
@ -158,7 +146,7 @@ namespace {
|
||||
|
||||
static const int kProxyRoutingId = 13;
|
||||
|
||||
#if (defined(USE_AURA) && defined(USE_X11)) || defined(USE_OZONE)
|
||||
#if defined(USE_OZONE)
|
||||
// Converts MockKeyboard::Modifiers to ui::EventFlags.
|
||||
int ConvertMockKeyboardModifier(MockKeyboard::Modifiers modifiers) {
|
||||
static struct ModifierMap {
|
||||
@ -381,49 +369,6 @@ class RenderViewImplTest : public RenderViewTest {
|
||||
return param;
|
||||
}
|
||||
|
||||
#if defined(USE_X11)
|
||||
int SendKeyEventX11(MockKeyboard::Layout layout,
|
||||
int key_code,
|
||||
MockKeyboard::Modifiers modifiers,
|
||||
std::u16string* output) {
|
||||
// We ignore |layout|, which means we are only testing the layout of the
|
||||
// current locale. TODO(mazda): fix this to respect |layout|.
|
||||
CHECK(output);
|
||||
const int flags = ConvertMockKeyboardModifier(modifiers);
|
||||
|
||||
ui::ScopedXI2Event xevent;
|
||||
xevent.InitKeyEvent(ui::ET_KEY_PRESSED,
|
||||
static_cast<ui::KeyboardCode>(key_code), flags);
|
||||
auto event1 = ui::BuildKeyEventFromXEvent(*xevent);
|
||||
NativeWebKeyboardEvent keydown_event(*event1);
|
||||
SendNativeKeyEvent(keydown_event);
|
||||
|
||||
// X11 doesn't actually have native character events, but give the test
|
||||
// what it wants.
|
||||
xevent.InitKeyEvent(ui::ET_KEY_PRESSED,
|
||||
static_cast<ui::KeyboardCode>(key_code), flags);
|
||||
auto event2 = ui::BuildKeyEventFromXEvent(*xevent);
|
||||
event2->set_character(
|
||||
DomCodeToUsLayoutCharacter(event2->code(), event2->flags()));
|
||||
ui::KeyEventTestApi test_event2(event2.get());
|
||||
test_event2.set_is_char(true);
|
||||
NativeWebKeyboardEvent char_event(*event2);
|
||||
SendNativeKeyEvent(char_event);
|
||||
|
||||
xevent.InitKeyEvent(ui::ET_KEY_RELEASED,
|
||||
static_cast<ui::KeyboardCode>(key_code), flags);
|
||||
auto event3 = ui::BuildKeyEventFromXEvent(*xevent);
|
||||
NativeWebKeyboardEvent keyup_event(*event3);
|
||||
SendNativeKeyEvent(keyup_event);
|
||||
|
||||
char16_t c = DomCodeToUsLayoutCharacter(
|
||||
UsLayoutKeyboardCodeToDomCode(static_cast<ui::KeyboardCode>(key_code)),
|
||||
flags);
|
||||
output->assign(1, c);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE)
|
||||
int SendKeyEventOzone(MockKeyboard::Layout layout,
|
||||
int key_code,
|
||||
@ -495,12 +440,6 @@ class RenderViewImplTest : public RenderViewTest {
|
||||
SendNativeKeyEvent(keyup_event);
|
||||
|
||||
return length;
|
||||
#elif defined(USE_X11)
|
||||
#if defined(USE_OZONE)
|
||||
if (features::IsUsingOzonePlatform())
|
||||
return SendKeyEventOzone(layout, key_code, modifiers, output);
|
||||
#endif
|
||||
return SendKeyEventX11(layout, key_code, modifiers, output);
|
||||
#elif defined(USE_OZONE)
|
||||
return SendKeyEventOzone(layout, key_code, modifiers, output);
|
||||
#else
|
||||
|
@ -307,10 +307,6 @@ static_library("content_shell_lib") {
|
||||
deps += [ "//ui/gtk" ]
|
||||
}
|
||||
|
||||
if (use_x11) {
|
||||
deps += [ "//ui/events/devices/x11" ]
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
deps += [
|
||||
"//components/embedder_support/android:view",
|
||||
|
@ -49,18 +49,6 @@
|
||||
#include "net/base/network_change_notifier.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_OZONE) || defined(USE_X11)
|
||||
#include "ui/base/ui_base_features.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_X11)
|
||||
#include "ui/base/x/x11_util.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA) && defined(USE_X11)
|
||||
#include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
|
||||
#include "ui/base/ime/init/input_method_initializer.h"
|
||||
#endif
|
||||
@ -127,15 +115,6 @@ ShellBrowserMainParts::ShellBrowserMainParts(
|
||||
|
||||
ShellBrowserMainParts::~ShellBrowserMainParts() = default;
|
||||
|
||||
#if !defined(OS_MAC)
|
||||
void ShellBrowserMainParts::PreCreateMainMessageLoop() {
|
||||
#if defined(USE_AURA) && defined(USE_X11)
|
||||
if (!features::IsUsingOzonePlatform())
|
||||
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void ShellBrowserMainParts::PostCreateMainMessageLoop() {
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
chromeos::DBusThreadManager::Initialize();
|
||||
|
@ -33,8 +33,10 @@ class ShellBrowserMainParts : public BrowserMainParts {
|
||||
// BrowserMainParts overrides.
|
||||
int PreEarlyInitialization() override;
|
||||
int PreCreateThreads() override;
|
||||
void PostCreateThreads() override;
|
||||
#if defined(OS_MAC)
|
||||
void PreCreateMainMessageLoop() override;
|
||||
#endif
|
||||
void PostCreateThreads() override;
|
||||
void PostCreateMainMessageLoop() override;
|
||||
void ToolkitInitialized() override;
|
||||
int PreMainMessageLoopRun() override;
|
||||
|
@ -2767,10 +2767,6 @@ test("content_unittests") {
|
||||
deps += [ "//third_party/boringssl" ]
|
||||
}
|
||||
|
||||
if (use_x11) {
|
||||
deps += [ "//ui/gfx/x" ]
|
||||
}
|
||||
|
||||
if (is_linux || is_chromeos) {
|
||||
sources += [ "../common/set_process_title_linux_unittest.cc" ]
|
||||
deps += [ "//content/common:set_process_title_linux" ]
|
||||
|
@ -56,27 +56,17 @@ namespace content {
|
||||
|
||||
namespace {
|
||||
|
||||
const char* kSwitchesToCopy[] = {
|
||||
#if defined(USE_OZONE)
|
||||
// Keep the kOzonePlatform switch that the Ozone must use.
|
||||
switches::kOzonePlatform,
|
||||
#endif
|
||||
// Some tests use custom cmdline that doesn't hold switches from previous
|
||||
// cmdline. Only a couple of switches are copied. That can result in
|
||||
// incorrect initialization of a process. For example, the work that we do
|
||||
// to have use_x11 && use_ozone, requires UseOzonePlatform feature flag to
|
||||
// be passed to all the process to ensure correct path is chosen.
|
||||
// TODO(https://crbug.com/1096425): update this comment once USE_X11 goes
|
||||
// away.
|
||||
switches::kEnableFeatures,
|
||||
switches::kDisableFeatures,
|
||||
};
|
||||
|
||||
base::CommandLine CreateCommandLine() {
|
||||
const base::CommandLine& cmdline = *base::CommandLine::ForCurrentProcess();
|
||||
base::CommandLine command_line = base::CommandLine(cmdline.GetProgram());
|
||||
#if defined(USE_OZONE)
|
||||
const char* kSwitchesToCopy[] = {
|
||||
// Keep the kOzonePlatform switch that the Ozone must use.
|
||||
switches::kOzonePlatform,
|
||||
};
|
||||
command_line.CopySwitchesFrom(cmdline, kSwitchesToCopy,
|
||||
base::size(kSwitchesToCopy));
|
||||
#endif
|
||||
return command_line;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/chromecast_build.gni")
|
||||
import("//build/config/ui.gni") # For the use_x11 and toolkit_views variables.
|
||||
import("//build/config/ui.gni") # For the toolkit_views variables.
|
||||
import("//mojo/public/tools/bindings/mojom.gni")
|
||||
import("//ppapi/buildflags/buildflags.gni") # For the enable_plugins variable.
|
||||
import("//printing/buildflags/buildflags.gni")
|
||||
@ -208,10 +208,6 @@ static_library("web_test_browser") {
|
||||
"//ppapi:blink_test_plugin",
|
||||
]
|
||||
}
|
||||
|
||||
if (use_x11) {
|
||||
deps += [ "//ui/events/devices/x11" ]
|
||||
}
|
||||
}
|
||||
|
||||
static_library("web_test_renderer") {
|
||||
|
@ -37,9 +37,6 @@
|
||||
#include "content/shell/browser/shell_plugin_service_filter.h"
|
||||
#endif
|
||||
|
||||
#if defined(USE_AURA) && defined(USE_X11)
|
||||
#include "ui/events/devices/x11/touch_factory_x11.h" // nogncheck
|
||||
#endif
|
||||
#if defined(USE_AURA) && (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
|
||||
#include "ui/base/ime/init/input_method_initializer.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user