Commit 7c7d8f97 authored by Christopher Lam's avatar Christopher Lam Committed by Commit Bot

Convert remaining non-CrOS Closure Compiles to GN.

See go/closure-compile-gn for details.

This CL converts ntp4 and offline_pages to GN Closure compilation. It
also deletes the webstore_widget GYP file which is no longer used.

A local closure compile can be run by setting closure_compile = true in
args.gn, and then running ninja -C out/Default webui_closure_compile.
A more localized compile may look like:
ninja -C out/Default chrome/browser/resources/ntp4:closure_compile

TBR=fukino@chromium.org

Bug: 632206
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id6f4c248eaf19a63084e1734bc987b5f8a7c11fc
Reviewed-on: https://chromium-review.googlesource.com/1049209Reviewed-by: default avatarcalamity <calamity@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Reviewed-by: default avatarJustin DeWitt <dewittj@chromium.org>
Commit-Queue: calamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559464}
parent 58e3dc5d
...@@ -1158,6 +1158,9 @@ if (closure_compile) { ...@@ -1158,6 +1158,9 @@ if (closure_compile) {
if (is_chromeos) { if (is_chromeos) {
data_deps += [ "ui/file_manager:closure_compile" ] data_deps += [ "ui/file_manager:closure_compile" ]
} }
if (is_android) {
data_deps += [ "components/offline_pages/resources:closure_compile" ]
}
} }
} }
......
...@@ -10,29 +10,37 @@ assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome") ...@@ -10,29 +10,37 @@ assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome")
if (closure_compile) { if (closure_compile) {
group("closure_compile") { group("closure_compile") {
deps = [ deps = [
"cryptotoken:closure_compile",
"engagement:closure_compile", "engagement:closure_compile",
] ]
if (is_linux || is_win || is_mac) { if (is_linux || is_win || is_mac) {
deps += [ deps += [
"cryptotoken:closure_compile",
"md_bookmarks:closure_compile", "md_bookmarks:closure_compile",
"md_downloads:closure_compile", "md_downloads:closure_compile",
"md_extensions:closure_compile",
"md_history:closure_compile", "md_history:closure_compile",
"md_user_manager:closure_compile",
"media_router:closure_compile", "media_router:closure_compile",
"offline_pages:closure_compile", "ntp4:closure_compile",
"pdf:closure_compile", "pdf:closure_compile",
"print_preview:closure_compile", "print_preview:closure_compile",
"settings:closure_compile", "settings:closure_compile",
]
}
if (is_chromeos) {
deps += [
"md_user_manager:closure_compile",
"signin/dice_sync_confirmation:closure_compile", "signin/dice_sync_confirmation:closure_compile",
"webapks:closure_compile",
"welcome/dice_welcome:closure_compile", "welcome/dice_welcome:closure_compile",
] ]
} }
if (enable_extensions) {
deps += [ "md_extensions:closure_compile" ]
}
if (is_android) { if (is_android) {
deps += [ "snippets_internals:closure_compile" ] deps += [
"offline_pages:closure_compile",
"snippets_internals:closure_compile",
"webapks:closure_compile",
]
} }
} }
} }
......
# Copyright 2018 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.
import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
":apps_page",
]
}
js_library("apps_page") {
sources = [
"//third_party/jstemplate/jsevalcontext.js",
"//third_party/jstemplate/jstemplate.js",
"//third_party/jstemplate/util.js",
"//ui/webui/resources/js/action_link.js",
"//ui/webui/resources/js/assert.js",
"//ui/webui/resources/js/cr.js",
"//ui/webui/resources/js/cr/event_target.js",
"//ui/webui/resources/js/cr/ui.js",
"//ui/webui/resources/js/cr/ui/bubble.js",
"//ui/webui/resources/js/cr/ui/card_slider.js",
"//ui/webui/resources/js/cr/ui/command.js",
"//ui/webui/resources/js/cr/ui/context_menu_button.js",
"//ui/webui/resources/js/cr/ui/context_menu_handler.js",
"//ui/webui/resources/js/cr/ui/drag_wrapper.js",
"//ui/webui/resources/js/cr/ui/expandable_bubble.js",
"//ui/webui/resources/js/cr/ui/focus_manager.js",
"//ui/webui/resources/js/cr/ui/menu.js",
"//ui/webui/resources/js/cr/ui/menu_button.js",
"//ui/webui/resources/js/cr/ui/menu_item.js",
"//ui/webui/resources/js/cr/ui/position_util.js",
"//ui/webui/resources/js/cr/ui/touch_handler.js",
"//ui/webui/resources/js/event_tracker.js",
"//ui/webui/resources/js/load_time_data.js",
"//ui/webui/resources/js/parse_html_subset.js",
"//ui/webui/resources/js/promise_resolver.js",
"//ui/webui/resources/js/util.js",
"apps_page.js",
"dot_list.js",
"logging.js",
"nav_dot.js",
"new_tab.js",
"page_list_view.js",
"page_switcher.js",
"tile_page.js",
"trash.js",
]
externs_list = [
"$externs_path/chrome.js",
"$externs_path/chrome_send.js",
]
}
...@@ -569,7 +569,7 @@ cr.define('ntp', function() { ...@@ -569,7 +569,7 @@ cr.define('ntp', function() {
/** /**
* Creates a new AppsPage object. * Creates a new AppsPage object.
* @constructor * @constructor
* @extends {TilePage} * @extends {ntp.TilePage}
*/ */
function AppsPage() { function AppsPage() {
var el = new TilePage(appsPageGridValues); var el = new TilePage(appsPageGridValues);
......
# Copyright 2017 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.
{
'targets': [
{
'target_name': 'apps_page',
'variables': {
'script_args': ['--custom_sources'],
'source_files': [
'<(DEPTH)/third_party/closure_compiler/externs/chrome.js',
'<(DEPTH)/third_party/closure_compiler/externs/chrome_send.js',
'<(DEPTH)/third_party/jstemplate/util.js',
'<(DEPTH)/third_party/jstemplate/jsevalcontext.js',
'<(DEPTH)/third_party/jstemplate/jstemplate.js',
'<(DEPTH)/ui/webui/resources/js/action_link.js',
'<(DEPTH)/ui/webui/resources/js/assert.js',
'<(DEPTH)/ui/webui/resources/js/cr.js',
'<(DEPTH)/ui/webui/resources/js/event_tracker.js',
'<(DEPTH)/ui/webui/resources/js/load_time_data.js',
'<(DEPTH)/ui/webui/resources/js/parse_html_subset.js',
'<(DEPTH)/ui/webui/resources/js/promise_resolver.js',
'<(DEPTH)/ui/webui/resources/js/util.js',
'<(DEPTH)/ui/webui/resources/js/cr/event_target.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/bubble.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/card_slider.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/command.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/context_menu_handler.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/drag_wrapper.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/expandable_bubble.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/focus_manager.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/menu.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/menu_item.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/position_util.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/menu_button.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/context_menu_button.js',
'<(DEPTH)/ui/webui/resources/js/cr/ui/touch_handler.js',
'logging.js',
'tile_page.js',
'dot_list.js',
'trash.js',
'page_switcher.js',
'page_list_view.js',
'nav_dot.js',
'new_tab.js',
'apps_page.js',
],
},
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
# copyright 2017 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.
{
'targets': [
{
'target_name': 'webview_tag',
'dependencies': [
'<(EXTERNS_GYP):chrome_extensions',
],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
}
]
}
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
{
'targets': [ import("//third_party/closure_compiler/compile_js.gni")
{
'target_name': 'renovations', js_type_check("closure_compile") {
'includes': ['../../../third_party/closure_compiler/compile_js2.gypi'], deps = [
}, ":renovations",
], ]
}
js_library("renovations") {
} }
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
function renovation_wikipedia() { function renovation_wikipedia() {
// Get list of elements to expand. // Get list of elements to expand.
elems = document.querySelectorAll( let elems =
"div.collapsible-block,h2.collapsible-heading"); document.querySelectorAll('div.collapsible-block,h2.collapsible-heading');
// Apply 'open-block' class to elements. This makes the sections' // Apply 'open-block' class to elements. This makes the sections'
// content visible. // content visible.
for (i = 0; i < elems.length; ++i) { for (let i = 0; i < elems.length; ++i) {
// If a block was already expanded, re-adding the 'open-block' // If a block was already expanded, re-adding the 'open-block'
// class will do nothing; no need to check if it's there already. // class will do nothing; no need to check if it's there already.
elems.item(i).className += " open-block"; elems.item(i).className += " open-block";
...@@ -21,18 +21,18 @@ function renovation_wikipedia() { ...@@ -21,18 +21,18 @@ function renovation_wikipedia() {
// disabled). We get the list of these elements in order. For every // disabled). We get the list of these elements in order. For every
// lazy image placeholder, there is always a corresponding noscript // lazy image placeholder, there is always a corresponding noscript
// element. // element.
placeholders = document.querySelectorAll( let placeholders = document.querySelectorAll(
".image > span.lazy-image-placeholder, \ '.image > span.lazy-image-placeholder, ' +
.mwe-math-element > span.lazy-image-placeholder"); '.mwe-math-element > span.lazy-image-placeholder');
noscripts = document.querySelectorAll( let noscripts = document.querySelectorAll(
".image > noscript, .mwe-math-element > noscript"); '.image > noscript, .mwe-math-element > noscript');
// Next we delete all the placeholders, then move the img elements // Next we delete all the placeholders, then move the img elements
// out of the noscripts, deleting the noscript element in the // out of the noscripts, deleting the noscript element in the
// process. // process.
for (i = 0; i < placeholders.length; ++i) { for (let i = 0; i < placeholders.length; ++i) {
placeholders.item(i).remove(); placeholders.item(i).remove();
innerText = noscripts.item(i).innerText; let innerText = noscripts.item(i).innerText;
noscripts.item(i).outerHTML = innerText; noscripts.item(i).outerHTML = innerText;
} }
} }
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
'<(DEPTH)/chrome/browser/resources/chromeos/select_to_speak/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/chromeos/select_to_speak/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/chromeos/switch_access/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/chromeos/switch_access/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/chromeos/sys_internals/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/chromeos/sys_internals/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/ntp4/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/cr_components/compiled_resources2.gyp:*', '<(DEPTH)/ui/webui/resources/cr_components/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/cr_elements/compiled_resources2.gyp:*', '<(DEPTH)/ui/webui/resources/cr_elements/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:*', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:*',
......
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