| 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
|
|
|