Commit bd74fc12 authored by Yuta Hijikata's avatar Yuta Hijikata Committed by Chromium LUCI CQ

Lacros: Ensure that the correct code is generated for lacros.

The change is in preparating to switching lacros-chrome from
target_os="linux" to target_os="chromeos". Since currently
lacros-chromes uses linux chrome's policy, we want to keep the behaviour
for now after the target_os switch.

Bug: 1052397
Change-Id: I0fd045f5bd0dc5524147545875b0446fd75dfca8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636100
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: default avatarIgor <igorcov@chromium.org>
Reviewed-by: default avatarPavol Marko <pmarko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845992}
parent 318dff18
......@@ -125,7 +125,6 @@ python2_action("policy_code_generate") {
args = [
# Input information
"--chrome-version-file=" + chrome_version_path,
"--target-platform=" + target_os,
"--policy-templates-file=" +
rebase_path("resources/policy_templates.json", root_build_dir),
......@@ -142,6 +141,14 @@ python2_action("policy_code_generate") {
rebase_path(app_restrictions_path, root_build_dir),
"--risk-tag-header=" + rebase_path(risk_tag_header_path, root_build_dir),
]
#TODO(crbug.com/1169547): Switch lacros-chrome to chromeos policy.
if (is_chromeos_lacros) {
# Currently lacros-chrome uses linux's policy instead of chromeos policy.
args += [ "--target-platform=linux" ]
} else {
args += [ "--target-platform=" + target_os ]
}
}
# TODO(crbug.com/1112471): Get this to run cleanly under Python 3.
......@@ -178,6 +185,14 @@ python2_action("full_runtime_code_generate") {
rebase_path(policy_common_definitions_full_runtime_proto_path,
root_build_dir),
]
#TODO(crbug.com/1169547): Switch lacros-chrome to chromeos policy.
if (is_chromeos_lacros) {
# Currently lacros-chrome uses linux's policy instead of chromeos policy.
args += [ "--target-platform=linux" ]
} else {
args += [ "--target-platform=" + target_os ]
}
}
policy_templates_grd_file = "resources/policy_templates.grd"
......@@ -376,7 +391,10 @@ static_library("generated") {
"//components/policy/proto:policy_common_definitions_compile_proto",
"//third_party/protobuf:protobuf_lite",
]
deps = [ "//build:branding_buildflags" ]
deps = [
"//build:branding_buildflags",
"//build:chromeos_buildflags",
]
}
if (gen_policy_templates_android && is_android) {
......
......@@ -477,6 +477,7 @@ def _WritePolicyConstantHeader(policies, policy_atomic_groups, target_platform,
'#include <string>\n'
'\n'
'#include "base/values.h"\n'
'#include "build/chromeos_buildflags.h"\n'
'#include "components/policy/core/common/policy_details.h"\n'
'#include "components/policy/core/common/policy_map.h"\n'
'#include "components/policy/proto/cloud_policy.pb.h"\n'
......@@ -492,7 +493,7 @@ def _WritePolicyConstantHeader(policies, policy_atomic_groups, target_platform,
'configuration resides.\n'
'extern const wchar_t kRegistryChromePolicyKey[];\n')
f.write('#if defined (OS_CHROMEOS)\n'
f.write('#if BUILDFLAG(IS_CHROMEOS_ASH)\n'
'// Sets default values for enterprise users.\n'
'void SetEnterpriseUsersDefaults(PolicyMap* policy_map);\n'
'#endif\n'
......@@ -1127,7 +1128,7 @@ namespace policy {
' return &kChromeSchemaData;\n'
'}\n\n')
f.write('#if defined (OS_CHROMEOS)\n'
f.write('#if BUILDFLAG(IS_CHROMEOS_ASH)\n'
'void SetEnterpriseUsersDefaults(PolicyMap* policy_map) {\n')
for policy in policies:
......
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