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") { ...@@ -11,6 +11,7 @@ component("system") {
"//base", "//base",
"//chromeos:chromeos_export", "//chromeos:chromeos_export",
"//chromeos/constants", "//chromeos/constants",
"//ui/ozone:ozone_base",
] ]
sources = [ sources = [
"core_scheduling.cc", "core_scheduling.cc",
......
include_rules = [
"+ui/ozone/public"
]
...@@ -7,10 +7,15 @@ ...@@ -7,10 +7,15 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
#include "ui/ozone/public/ozone_switches.h"
namespace chromeos { namespace chromeos {
bool IsRunningAsSystemCompositor() { bool IsRunningAsSystemCompositor() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
::switches::kDisableRunningAsSystemCompositor)) {
return false;
}
static bool is_running_on_chrome_os = base::SysInfo::IsRunningOnChromeOS(); static bool is_running_on_chrome_os = base::SysInfo::IsRunningOnChromeOS();
return is_running_on_chrome_os || return is_running_on_chrome_os ||
base::CommandLine::ForCurrentProcess()->HasSwitch( base::CommandLine::ForCurrentProcess()->HasSwitch(
......
...@@ -129,6 +129,7 @@ jumbo_component("ozone_base") { ...@@ -129,6 +129,7 @@ jumbo_component("ozone_base") {
visibility += [ visibility += [
# Everyone should depend on //ui/ozone instead except a handful of # Everyone should depend on //ui/ozone instead except a handful of
# things that would otherwise create a cycle. # things that would otherwise create a cycle.
"//chromeos/system:system",
"//ui/events/ozone/*", "//ui/events/ozone/*",
"//ui/ozone/common/*", "//ui/ozone/common/*",
"//ui/ozone/public/mojom", "//ui/ozone/public/mojom",
......
...@@ -138,6 +138,7 @@ OzonePlatform* CreateOzonePlatformHeadless() { ...@@ -138,6 +138,7 @@ OzonePlatform* CreateOzonePlatformHeadless() {
base::FilePath location; base::FilePath location;
if (cmd->HasSwitch(switches::kOzoneDumpFile)) if (cmd->HasSwitch(switches::kOzoneDumpFile))
location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile);
cmd->AppendSwitch(switches::kDisableRunningAsSystemCompositor);
return new OzonePlatformHeadless(location); return new OzonePlatformHeadless(location);
} }
......
...@@ -18,4 +18,8 @@ const char kEnableWaylandIme[] = "enable-wayland-ime"; ...@@ -18,4 +18,8 @@ const char kEnableWaylandIme[] = "enable-wayland-ime";
// Disable explicit DMA-fences // Disable explicit DMA-fences
const char kDisableExplicitDmaFences[] = "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 } // namespace switches
...@@ -18,6 +18,9 @@ COMPONENT_EXPORT(OZONE_BASE) extern const char kEnableWaylandIme[]; ...@@ -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 kDisableExplicitDmaFences[];
COMPONENT_EXPORT(OZONE_BASE)
extern const char kDisableRunningAsSystemCompositor[];
} // namespace switches } // namespace switches
#endif // UI_OZONE_PUBLIC_OZONE_SWITCHES_H_ #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