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

Unified Diff: base/sys_info_chromeos.cc

Issue 2585633004: ozone: Allow ozone evdev/kvm features to be enabled without running on ChromeOS. (Closed)
Patch Set: fix bad rebase 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
Index: base/sys_info_chromeos.cc
diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc
index 29f83845dc52edbf3113cf4412bb7e3a77eb8acf..6b3e0eb691c8c3fca0b08665aa9f1be70b4e3d15 100644
--- a/base/sys_info_chromeos.cc
+++ b/base/sys_info_chromeos.cc
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <stdint.h>
+#include "base/base_switches.h"
+#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
@@ -50,6 +52,15 @@ class ChromeOSVersionInfo {
public:
ChromeOSVersionInfo() {
Parse();
+
+ // Running as system compositor by default when running on ChromeOS.
+ is_running_as_system_compositor_ = is_running_on_chromeos_;
+
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kEnableSystemCompositorMode))
+ is_running_as_system_compositor_ = true;
+ if (command_line->HasSwitch(switches::kDisableSystemCompositorMode))
+ is_running_as_system_compositor_ = false;
}
void Parse() {
@@ -106,6 +117,9 @@ class ChromeOSVersionInfo {
return lsb_release_map_;
}
bool is_running_on_chromeos() const { return is_running_on_chromeos_; }
+ bool is_running_as_system_compositor() const {
+ return is_running_as_system_compositor_;
+ }
private:
void ParseLsbRelease(const std::string& lsb_release) {
@@ -161,6 +175,7 @@ class ChromeOSVersionInfo {
int32_t minor_version_;
int32_t bugfix_version_;
bool is_running_on_chromeos_;
+ bool is_running_as_system_compositor_;
};
static LazyInstance<ChromeOSVersionInfo>::Leaky
@@ -229,4 +244,9 @@ void SysInfo::SetChromeOSVersionInfoForTest(const std::string& lsb_release,
g_chrome_os_version_info.Get().Parse();
}
+// static
+bool SysInfo::IsRunningAsSystemCompositor() {
+ return GetChromeOSVersionInfo().is_running_as_system_compositor();
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698