Commit 1f314714 authored by Christopher Lam's avatar Christopher Lam Committed by Commit Bot

Convert media_router Closure Compilation from GYP to GN.

See go/closure-compile-gn for details.

This CL converts the Closure Compilation of chrome://media-router from GYP
to GN, and fixes a number of type-checking issues that were somehow
suppressed due to the way the compiler used to be run.

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/media_router:closure_compile

Bug: 632206

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I3a41ec8701a68ae71fa2a613401daf213c41e0ff
Reviewed-on: https://chromium-review.googlesource.com/1036709
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarapacible <apacible@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555972}
parent b5536353
...@@ -20,6 +20,7 @@ if (closure_compile) { ...@@ -20,6 +20,7 @@ if (closure_compile) {
"md_extensions:closure_compile", "md_extensions:closure_compile",
"md_history:closure_compile", "md_history:closure_compile",
"md_user_manager:closure_compile", "md_user_manager:closure_compile",
"media_router:closure_compile",
"offline_pages:closure_compile", "offline_pages:closure_compile",
"settings:closure_compile", "settings:closure_compile",
"signin/dice_sync_confirmation:closure_compile", "signin/dice_sync_confirmation: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")
group("closure_compile") {
deps = [
":media_router_resources",
"elements/issue_banner:closure_compile",
"elements/media_router_container:closure_compile",
"elements/media_router_header:closure_compile",
"elements/media_router_search_highlighter:closure_compile",
"elements/route_controls:closure_compile",
"elements/route_details:closure_compile",
]
}
js_type_check("media_router_resources") {
deps = [
":media_router",
":media_router_browser_api",
":media_router_data",
":media_router_ui_interface",
]
}
js_library("media_router") {
deps = [
":media_router_ui_interface",
"elements/media_router_container:media_router_container_interface",
"elements/media_router_header:media_router_header",
"//ui/webui/resources/js:cr",
]
}
js_library("media_router_browser_api") {
deps = [
":media_router_data",
]
externs_list = [ "$externs_path/chrome_send.js" ]
}
js_library("media_router_data") {
deps = [
"//ui/webui/resources/js:cr",
"//ui/webui/resources/js:load_time_data",
]
}
js_library("media_router_ui_interface") {
deps = [
":media_router_browser_api",
"elements/media_router_container:media_router_container_interface",
"elements/media_router_header:media_router_header",
"elements/route_controls:route_controls_interface",
]
}
# Copyright 2016 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': 'externs',
'includes': ['../../../../third_party/closure_compiler/include_js.gypi'],
},
{
'target_name': 'media_router',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'media_router_ui_interface',
'elements/media_router_header/compiled_resources2.gyp:media_router_header',
'elements/media_router_container/compiled_resources2.gyp:media_router_container_interface',
],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'media_router_browser_api',
'dependencies': [
'media_router_data',
'<(EXTERNS_GYP):chrome_send',
],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'media_router_data',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'media_router_ui_interface',
'dependencies': [
'media_router_browser_api',
'elements/media_router_header/compiled_resources2.gyp:media_router_header',
'elements/media_router_container/compiled_resources2.gyp:media_router_container_interface',
'elements/route_controls/compiled_resources2.gyp:route_controls_interface',
],
'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
# 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 = [
":issue_banner",
]
}
js_library("issue_banner") {
deps = [
"../..:media_router_data",
"//ui/webui/resources/js:i18n_behavior",
]
}
# Copyright 2016 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': 'issue_banner',
'dependencies': [
'../../compiled_resources2.gyp:media_router_data',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
# 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 = [
":media_router_container",
":media_router_container_interface",
":pseudo_sink_search_state",
]
}
js_library("media_router_container") {
deps = [
":pseudo_sink_search_state",
"../..:media_router_browser_api",
"../..:media_router_data",
"../../elements/issue_banner:issue_banner",
"../../elements/media_router_header:media_router_header",
"../../elements/media_router_search_highlighter:media_router_search_highlighter",
"../../elements/route_details:route_details",
]
externs_list = [ "../../externs.js" ]
}
js_library("media_router_container_interface") {
deps = [
"../..:media_router_data",
"../../elements/media_router_header:media_router_header",
]
}
js_library("pseudo_sink_search_state") {
deps = [
"../..:media_router_data",
]
}
# Copyright 2016 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': 'media_router_container',
'dependencies': [
'pseudo_sink_search_state',
'../../compiled_resources2.gyp:externs',
'../../compiled_resources2.gyp:media_router_browser_api',
'../../compiled_resources2.gyp:media_router_data',
'../../elements/issue_banner/compiled_resources2.gyp:issue_banner',
'../../elements/media_router_header/compiled_resources2.gyp:media_router_header',
'../../elements/media_router_search_highlighter/compiled_resources2.gyp:media_router_search_highlighter',
'../../elements/route_details/compiled_resources2.gyp:route_details',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'media_router_container_interface',
'dependencies': [
'../../compiled_resources2.gyp:media_router_data',
'../../elements/media_router_header/compiled_resources2.gyp:media_router_header',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'pseudo_sink_search_state',
'dependencies': [
'../../compiled_resources2.gyp:media_router_data',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
# 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 = [
":media_router_header",
]
}
js_library("media_router_header") {
deps = [
"../..:media_router_data",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:util",
]
}
# Copyright 2016 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': 'media_router_header',
'dependencies': [
'../../compiled_resources2.gyp:media_router_data',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
# 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 = [
":media_router_search_highlighter",
]
}
js_library("media_router_search_highlighter") {
deps = [
"//ui/webui/resources/js:util",
]
}
# Copyright 2016 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': 'media_router_search_highlighter',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
# 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 = [
":route_controls",
":route_controls_interface",
]
}
js_library("route_controls") {
deps = [
"../..:media_router_browser_api",
"../..:media_router_data",
"../..:media_router_ui_interface",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:load_time_data",
]
}
js_library("route_controls_interface") {
deps = [
"../..:media_router_data",
"//third_party/polymer/v1_0/components-chromium/paper-checkbox:paper-checkbox-extracted",
]
}
# 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': 'route_controls',
'dependencies': [
'../../compiled_resources2.gyp:media_router_browser_api',
'../../compiled_resources2.gyp:media_router_data',
'../../compiled_resources2.gyp:media_router_ui_interface',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'route_controls_interface',
'dependencies': [
'../../compiled_resources2.gyp:media_router_data',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
...@@ -75,7 +75,7 @@ Polymer({ ...@@ -75,7 +75,7 @@ Polymer({
/** /**
* Set to true when the user is dragging the volume bar. Volume updates from * Set to true when the user is dragging the volume bar. Volume updates from
* the browser will be ignored when set to true. * the browser will be ignored when set to true.
* @private {boolean} * @private
*/ */
isVolumeChanging_: { isVolumeChanging_: {
type: Boolean, type: Boolean,
...@@ -84,7 +84,7 @@ Polymer({ ...@@ -84,7 +84,7 @@ Polymer({
/** /**
* The timestamp for when the controller last submitted a seek request. * The timestamp for when the controller last submitted a seek request.
* @private {number} * @private
*/ */
lastSeekByUser_: { lastSeekByUser_: {
type: Number, type: Number,
...@@ -93,7 +93,7 @@ Polymer({ ...@@ -93,7 +93,7 @@ Polymer({
/** /**
* The timestamp for when |routeStatus| was last updated. * The timestamp for when |routeStatus| was last updated.
* @private {number} * @private
*/ */
lastStatusUpdate_: { lastStatusUpdate_: {
type: Number, type: Number,
...@@ -103,7 +103,7 @@ Polymer({ ...@@ -103,7 +103,7 @@ Polymer({
/** /**
* The timestamp for when the controller last submitted a volume change * The timestamp for when the controller last submitted a volume change
* request. * request.
* @private {boolean} * @private
*/ */
lastVolumeChangeByUser_: { lastVolumeChangeByUser_: {
type: Number, type: Number,
...@@ -112,7 +112,7 @@ Polymer({ ...@@ -112,7 +112,7 @@ Polymer({
/** /**
* Keep in sync with media remoting individual user setting. * Keep in sync with media remoting individual user setting.
* @private {boolean} * @private
*/ */
mediaRemotingEnabled_: { mediaRemotingEnabled_: {
type: Boolean, type: Boolean,
...@@ -401,7 +401,7 @@ Polymer({ ...@@ -401,7 +401,7 @@ Polymer({
this.FullscreenVideoOption_.REMOTE_SCREEN : this.FullscreenVideoOption_.REMOTE_SCREEN :
this.FullscreenVideoOption_.BOTH_SCREENS; this.FullscreenVideoOption_.BOTH_SCREENS;
} }
this.shouldShowRouteStatusTitle_ = newRouteStatus.title && this.shouldShowRouteStatusTitle_ = !!newRouteStatus.title &&
newRouteStatus.title != '' && newRouteStatus.title != '' &&
newRouteStatus.title != this.routeDescription_; newRouteStatus.title != this.routeDescription_;
}, },
......
# 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 = [
":route_details",
]
}
js_library("route_details") {
deps = [
"../..:media_router_data",
"../..:media_router_ui_interface",
"../route_controls:route_controls",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:load_time_data",
]
}
# Copyright 2016 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': 'route_details',
'dependencies': [
'../../compiled_resources2.gyp:media_router_data',
'../../compiled_resources2.gyp:media_router_ui_interface',
'../route_controls/compiled_resources2.gyp:route_controls',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
...@@ -191,7 +191,7 @@ Polymer({ ...@@ -191,7 +191,7 @@ Polymer({
* @private * @private
*/ */
shouldShowWebUiControls_: function(route) { shouldShowWebUiControls_: function(route) {
return route && route.supportsWebUiController; return !!route && !!route.supportsWebUiController;
}, },
/** /**
......
...@@ -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/media_router/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/ntp4/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/ntp4/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/pdf/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/pdf/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/print_preview/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/print_preview/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