Commit a599fb48 authored by Polina Bondarenko's avatar Polina Bondarenko Committed by Commit Bot

chromeos: enable ozone platform headless on CrOS

IsRunningAsSystemCompositor must return false, because input
should be disabled on ozone platform headless.

BUG=b:160309778
TEST=manual

Change-Id: I8a97b166b42a581a275c305355f0c4434e5adbbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276426Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Commit-Queue: Polina Bondarenko <pbond@chromium.org>
Auto-Submit: Polina Bondarenko <pbond@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786271}
parent 85867d03
......@@ -11,6 +11,7 @@ component("system") {
"//base",
"//chromeos:chromeos_export",
"//chromeos/constants",
"//ui/ozone:ozone_base",
]
sources = [
"core_scheduling.cc",
......
include_rules = [
"+ui/ozone/public"
]
......@@ -7,10 +7,15 @@
#include "base/command_line.h"
#include "base/system/sys_info.h"
#include "chromeos/constants/chromeos_switches.h"
#include "ui/ozone/public/ozone_switches.h"
namespace chromeos {
bool IsRunningAsSystemCompositor() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kDisableRunningAsSystemCompositor)) {
return false;
}
static bool is_running_on_chrome_os = base::SysInfo::IsRunningOnChromeOS();
return is_running_on_chrome_os ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
......
......@@ -129,6 +129,7 @@ jumbo_component("ozone_base") {
visibility += [
# Everyone should depend on //ui/ozone instead except a handful of
# things that would otherwise create a cycle.
"//chromeos/system:system",
"//ui/events/ozone/*",
"//ui/ozone/common/*",
"//ui/ozone/public/mojom",
......
......@@ -138,6 +138,7 @@ OzonePlatform* CreateOzonePlatformHeadless() {
base::FilePath location;
if (cmd->HasSwitch(switches::kOzoneDumpFile))
location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile);
cmd->AppendSwitch(switches::kDisableRunningAsSystemCompositor);
return new OzonePlatformHeadless(location);
}
......
......@@ -18,4 +18,8 @@ const char kEnableWaylandIme[] = "enable-wayland-ime";
// Disable explicit DMA-fences
const char kDisableExplicitDmaFences[] = "disable-explicit-dma-fences";
// Disable running as system compositor.
const char kDisableRunningAsSystemCompositor[] =
"disable-running-as-system-compositor";
} // namespace switches
......@@ -18,6 +18,9 @@ COMPONENT_EXPORT(OZONE_BASE) extern const char kEnableWaylandIme[];
COMPONENT_EXPORT(OZONE_BASE) extern const char kDisableExplicitDmaFences[];
COMPONENT_EXPORT(OZONE_BASE)
extern const char kDisableRunningAsSystemCompositor[];
} // namespace switches
#endif // UI_OZONE_PUBLIC_OZONE_SWITCHES_H_
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