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

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: Review nits Created 4 years 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
« no previous file with comments | « headless/lib/headless_content_main_delegate.cc ('k') | ui/base/ime/input_method_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index d4b5cdfe43d0d7914753efd2975cba71acaa66db..3a49c7cec6de1a60d773e235e9bd336154373980 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.
@@ -170,6 +175,8 @@ void Env::Init() {
// let the mus process initialize ozone instead.
ui::OzonePlatform::InitializeForUI();
#endif
+ if (RunningInHeadlessMode())
sky 2016/12/06 14:27:31 Would it make more sense for a headless PlatformEv
Sami 2016/12/07 11:51:26 Great idea! Done.
+ return;
if (!ui::PlatformEventSource::GetInstance())
event_source_ = ui::PlatformEventSource::CreateDefault();
}
« no previous file with comments | « headless/lib/headless_content_main_delegate.cc ('k') | ui/base/ime/input_method_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698