Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: ui/aura/env.cc

Issue 1991953002: Implement a runtime headless mode for Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index d4b5cdfe43d0d7914753efd2975cba71acaa66db..5b7fe69a5a574aac949fed48f97321ce397ecbac 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -18,6 +18,7 @@
#include "ui/aura/window_port_local.h"
#include "ui/events/event_target_iterator.h"
#include "ui/events/platform/platform_event_source.h"
+#include "ui/gfx/switches.h"
#if defined(USE_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -37,6 +38,10 @@ bool RunningInsideMus() {
"primordial-pipe-token");
}
+bool RunningInHeadlessMode() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kHeadless);
+}
+
} // namespace
// Observes destruction and changes of the FocusClient for a window.
@@ -162,7 +167,7 @@ Env::Env(Mode mode)
}
void Env::Init() {
- if (RunningInsideMus())
+ if (RunningInsideMus() || RunningInHeadlessMode())
return;
#if defined(USE_OZONE)
// The ozone platform can provide its own event source. So initialize the

Powered by Google App Engine
This is Rietveld 408576698