Commit 183ecee2 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI: Leverage resource_path for jstemplate_compiled.js grd entry.

By using the new |resource_path| attribute an unnecessary intermediate
ui/webui/resources/js/jstemplate_compiled.js file which was using
<include> and |flattenhtml| is eliminated.

Bug: 1132403
Change-Id: I74c1c33b567df3023ccba2b0fed87da097ff37ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2470332
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817062}
parent 6e869c2f
...@@ -71,9 +71,7 @@ def _CheckWebDevStyle(input_api, output_api): ...@@ -71,9 +71,7 @@ def _CheckWebDevStyle(input_api, output_api):
cwd = input_api.PresubmitLocalPath() cwd = input_api.PresubmitLocalPath()
sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')] sys.path += [input_api.os_path.join(cwd, '..', '..', '..', 'tools')]
from web_dev_style import presubmit_support from web_dev_style import presubmit_support
IGNORELIST = ['ui/webui/resources/js/jstemplate_compiled.js'] results += presubmit_support.CheckStyle(input_api, output_api)
file_filter = lambda f: f.LocalPath() not in IGNORELIST
results += presubmit_support.CheckStyle(input_api, output_api, file_filter)
finally: finally:
sys.path = old_sys_path sys.path = old_sys_path
return results return results
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file serves as a proxy to bring the included js file from /third_party
// into its correct location under the resources directory tree, whence it is
// delivered via a chrome://resources URL. See ../webui_resources.grd.
// Note: this <include> is not behind a single-line comment because the first
// line of the file is source code (so the first line would be skipped) instead
// of a licence header.
// clang-format off
<include src="../../../../third_party/jstemplate/jstemplate_compiled.js">
...@@ -16,8 +16,9 @@ without changes to the corresponding grd file. --> ...@@ -16,8 +16,9 @@ without changes to the corresponding grd file. -->
<if expr="chromeos"> <if expr="chromeos">
<include name="IDR_WEBUI_JS_I18N_TEMPLATE_PROCESS_JS" file="js/i18n_template_process.js" type="BINDATA" /> <include name="IDR_WEBUI_JS_I18N_TEMPLATE_PROCESS_JS" file="js/i18n_template_process.js" type="BINDATA" />
</if> </if>
<include name="IDR_WEBUI_JS_JSTEMPLATE_COMPILED_JS" file="js/jstemplate_compiled.js" <include name="IDR_WEBUI_JS_JSTEMPLATE_COMPILED_JS"
flattenhtml="true" type="BINDATA"/> file="../../../third_party/jstemplate/jstemplate_compiled.js"
resource_path="js/jstemplate_compiled.js" type="BINDATA"/>
<!-- Roboto Font. Roboto-Regular and Roboto-Light is already available on <!-- Roboto Font. Roboto-Regular and Roboto-Light is already available on
Android, and Roboto-Medium is not used on Android. All 6 weights of Android, and Roboto-Medium is not used on Android. All 6 weights of
Roboto are available on Chrome OS.--> Roboto are available on Chrome OS.-->
......
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