Convert GN visibility variables to lists.

Currently this is either a list or a string. However, this is causing some problems because templates can't add to the invoker's visibility list without knowing if the original is a string or a list.

In an effort to make this consistent, I'm converting all visibiltiy to be lists, and will remove support for strings in a future build.

This exempts cld from header checking since it was confusing GN's header checker. It adds a ppapi header target as well that will be used by libyuv (that requires a roll).

TBR=scottmg

Review URL: https://codereview.chromium.org/544423002

Cr-Commit-Position: refs/heads/master@{#293638}
diff --git a/base/allocator/BUILD.gn b/base/allocator/BUILD.gn
index d8e3b27..5f0b6fa 100644
--- a/base/allocator/BUILD.gn
+++ b/base/allocator/BUILD.gn
@@ -240,7 +240,7 @@
 }  # !is_android
 
 source_set("allocator_extension_thunks") {
-  visibility = "//base/*"
+  visibility = [ "//base/*" ]
   sources = [
     "allocator_extension_thunks.cc",
     "allocator_extension_thunks.h",
diff --git a/base/third_party/nspr/BUILD.gn b/base/third_party/nspr/BUILD.gn
index eb758d5..b1cf6487 100644
--- a/base/third_party/nspr/BUILD.gn
+++ b/base/third_party/nspr/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 source_set("nspr") {
-  visibility = "//base/*"
+  visibility = [ "//base/*" ]
   sources = [
     "prtime.cc",
     "prtime.h",
diff --git a/base/third_party/symbolize/BUILD.gn b/base/third_party/symbolize/BUILD.gn
index 0b4dd952..ddcb789 100644
--- a/base/third_party/symbolize/BUILD.gn
+++ b/base/third_party/symbolize/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 source_set("symbolize") {
-  visibility = "//base/*"
+  visibility = [ "//base/*" ]
   sources = [
     "config.h",
     "demangle.cc",
diff --git a/base/third_party/xdg_mime/BUILD.gn b/base/third_party/xdg_mime/BUILD.gn
index 3e51e33..72a3038 100644
--- a/base/third_party/xdg_mime/BUILD.gn
+++ b/base/third_party/xdg_mime/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 source_set("xdg_mime") {
-  visibility = "//base/*"
+  visibility = [ "//base/*" ]
   sources = [
     "xdgmime.c",
     "xdgmime.h",
diff --git a/base/third_party/xdg_user_dirs/BUILD.gn b/base/third_party/xdg_user_dirs/BUILD.gn
index d866960..62e7cdf 100644
--- a/base/third_party/xdg_user_dirs/BUILD.gn
+++ b/base/third_party/xdg_user_dirs/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 source_set("xdg_user_dirs") {
-  visibility = "//base/*"
+  visibility = [ "//base/*" ]
   sources = [
     "xdg_user_dir_lookup.cc",
     "xdg_user_dir_lookup.h",
diff --git a/build/secondary/testing/gtest/BUILD.gn b/build/secondary/testing/gtest/BUILD.gn
index f7c1e0d..cab9892 100644
--- a/build/secondary/testing/gtest/BUILD.gn
+++ b/build/secondary/testing/gtest/BUILD.gn
@@ -54,7 +54,7 @@
 }
 
 config("gtest_direct_config") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   defines = [ "UNIT_TEST" ]
 }
 
diff --git a/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn b/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn
index 9429139..2dc1b999 100644
--- a/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn
+++ b/build/secondary/third_party/cacheinvalidation/src/google/cacheinvalidation/BUILD.gn
@@ -6,7 +6,7 @@
 
 proto_library("cacheinvalidation_proto_cpp") {
   # Depend on cacheinvalidation instead.
-  visibility = "//third_party/cacheinvalidation/*"
+  visibility = [ "//third_party/cacheinvalidation/*" ]
 
   sources = [
     "client.proto",
diff --git a/build/secondary/third_party/nss/BUILD.gn b/build/secondary/third_party/nss/BUILD.gn
index 7c05da7..00c524c 100644
--- a/build/secondary/third_party/nss/BUILD.gn
+++ b/build/secondary/third_party/nss/BUILD.gn
@@ -385,7 +385,7 @@
   # TODO(rsleevi): http://crbug.com/128134 - Break the circular dependency
   # without requiring nssckbi to be built as a shared library.
   source_set("nssckbi") {
-    visibility = ":nss"  # This target is internal implementation detail.
+    visibility = [ ":nss" ]  # This target is internal implementation detail.
 
     sources = [
       "nss/lib/ckfw/builtins/anchor.c",
diff --git a/build/secondary/tools/grit/grit_rule.gni b/build/secondary/tools/grit/grit_rule.gni
index bec147ee..4cffc4e 100644
--- a/build/secondary/tools/grit/grit_rule.gni
+++ b/build/secondary/tools/grit/grit_rule.gni
@@ -258,7 +258,7 @@
   # The config and the action below get this visibility son only the generated
   # source set can depend on them. The variable "target_name" will get
   # overwritten inside the inner classes so we need to compute it here.
-  target_visibility = ":$target_name"
+  target_visibility = [ ":$target_name" ]
 
   # The current grit setup makes an file in $output_dir/grit/foo.h that
   # the source code expects to include via "grit/foo.h". It would be nice to
@@ -301,7 +301,16 @@
 
     args += grit_flags + assert_files_flags
 
-    visibility = target_visibility
+    if (defined(invoker.visibility)) {
+      # This needs to include both what the invoker specified (since they
+      # probably include generated headers from this target), as well as the
+      # generated source set (since there's no guarantee that the visibility
+      # specified by the invoker includes our target).
+      #
+      # Only define visibility at all if the invoker specified it. Otherwise,
+      # we want to keep the public "no visibility specified" default.
+      visibility = target_visibility + invoker.visibility
+    }
 
     deps = [ "//tools/grit:grit_sources" ]
     if (defined(invoker.deps)) {
diff --git a/build/toolchain/win/midl.gni b/build/toolchain/win/midl.gni
index e0c2dd4..7f068d01 100644
--- a/build/toolchain/win/midl.gni
+++ b/build/toolchain/win/midl.gni
@@ -37,7 +37,7 @@
   type_library_file = "{{source_name_part}}.tlb"
 
   action_foreach(action_name) {
-    visibility = ":$source_set_name"
+    visibility = [ ":$source_set_name" ]
 
     # This functionality is handled by the win-tool because the GYP build has
     # MIDL support built-in.
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 5bcb4e7..6577651 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -319,7 +319,7 @@
 }
 
 repack("packed_extra_resources") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   sources = [
     "$root_gen_dir/chrome/browser_resources.pak",
     "$root_gen_dir/chrome/app/theme/chrome_unscaled_resources.pak",
diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn
index 3113d78..9a62322 100644
--- a/chrome/app/BUILD.gn
+++ b/chrome/app/BUILD.gn
@@ -72,7 +72,7 @@
 # GYP version: chrome/chrome_resources.gyp:chrome_strings_map
 action("make_generated_resources_map") {
   # Targets should depend on generated_resources_map instead.
-  visibility = ":generated_resources_map"
+  visibility = [ ":generated_resources_map" ]
 
   script = "//chrome/browser/metrics/variations/generate_resources_map.py"
 
diff --git a/chrome/chrome_repack_locales.gni b/chrome/chrome_repack_locales.gni
index d788856..2d8e115 100644
--- a/chrome/chrome_repack_locales.gni
+++ b/chrome/chrome_repack_locales.gni
@@ -150,7 +150,7 @@
     locale_targets += [ ":$current_name" ]
 
     _repack_one_locale(current_name) {
-      visibility = ":$group_target_name"
+      visibility = [ ":$group_target_name" ]
       locale = input_locale
 
       # Compute the output name. Mac uses a different location.
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
index 34e3ef21..51c3908 100644
--- a/chrome/common/BUILD.gn
+++ b/chrome/common/BUILD.gn
@@ -244,7 +244,7 @@
   # Windows.
   import("//chrome/version.gni")
   process_version("version") {
-    visibility = ":common"
+    visibility = [ ":common" ]
     source = "chrome_version_info_posix.h.version"
     output = "$target_gen_dir/chrome_version_info_posix.h"
   }
diff --git a/components/BUILD.gn b/components/BUILD.gn
index 6e8c026b..c33ce034 100644
--- a/components/BUILD.gn
+++ b/components/BUILD.gn
@@ -7,7 +7,7 @@
 # Collection of all components. You wouldn't link to this, but this is rather
 # to reference the files so they can be compiled by the build system.
 group("all_components") {
-  visibility = "//:*"  # Only for the root targets to bring in.
+  visibility = [ "//:*" ]  # Only for the root targets to bring in.
 
   deps = [
     "//components/auto_login_parser",
diff --git a/components/autofill/core/browser/BUILD.gn b/components/autofill/core/browser/BUILD.gn
index a9b56d5..9a922b8 100644
--- a/components/autofill/core/browser/BUILD.gn
+++ b/components/autofill/core/browser/BUILD.gn
@@ -17,7 +17,7 @@
 
 # GYP version: components/autofill.gyp:autofill_regexes
 action("regexes") {
-  visibility = "//components/autofill/*"
+  visibility = [ "//components/autofill/*" ]
   script = "//build/escape_unicode.py"
 
   inputs = [
diff --git a/components/domain_reliability/BUILD.gn b/components/domain_reliability/BUILD.gn
index 335b1411..079aae03 100644
--- a/components/domain_reliability/BUILD.gn
+++ b/components/domain_reliability/BUILD.gn
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 action("bake_in_configs") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   script = "bake_in_configs.py"
 
   inputs = [
diff --git a/components/search_engines/BUILD.gn b/components/search_engines/BUILD.gn
index ce921e4..260e457 100644
--- a/components/search_engines/BUILD.gn
+++ b/components/search_engines/BUILD.gn
@@ -73,7 +73,7 @@
 }
 
 json_to_struct("prepopulated_engines") {
-  visibility = ":*"
+  visibility = [ ":*" ]
 
   source = "prepopulated_engines.json"
   schema_file = "prepopulated_engines_schema.json"
diff --git a/content/BUILD.gn b/content/BUILD.gn
index b4eeb26..7f749aa 100644
--- a/content/BUILD.gn
+++ b/content/BUILD.gn
@@ -49,7 +49,7 @@
 # This target exists to "hold" the content_export header so we can do proper
 # inclusion testing of it.
 source_set("export") {
-  visibility = "//content/*"
+  visibility = [ "//content/*" ]
   sources = [
     "content/common/content_export.h"
   ]
diff --git a/content/browser/devtools/BUILD.gn b/content/browser/devtools/BUILD.gn
index 89e93b96..bc2b60d9 100644
--- a/content/browser/devtools/BUILD.gn
+++ b/content/browser/devtools/BUILD.gn
@@ -37,7 +37,7 @@
 }
 
 action("gen_devtools_protocol_constants") {
-  visibility = ":devtools_protocol_constants"
+  visibility = [ ":devtools_protocol_constants" ]
 
   script = "//content/public/browser/devtools_protocol_constants_generator.py"
 
@@ -57,6 +57,6 @@
 }
 
 source_set("devtools_protocol_constants") {
-  visibility = ":resources"
+  visibility = [ ":resources" ]
   sources = get_target_outputs(":gen_devtools_protocol_constants")
 }
diff --git a/content/browser/tracing/BUILD.gn b/content/browser/tracing/BUILD.gn
index 42ba3b9..ae9c7df 100644
--- a/content/browser/tracing/BUILD.gn
+++ b/content/browser/tracing/BUILD.gn
@@ -12,7 +12,7 @@
 tracing_grd = "$tracing_gen_dir/tracing_resources.grd"
 
 action("generate_tracing_grd") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   script = "generate_trace_viewer_grd.py"
 
   input_pages = [
diff --git a/content/plugin/BUILD.gn b/content/plugin/BUILD.gn
index 80c42958..90d266e 100644
--- a/content/plugin/BUILD.gn
+++ b/content/plugin/BUILD.gn
@@ -7,7 +7,7 @@
 # This is the NPAPI plugin process. It isn't used on Linux.
 if (enable_plugins && !is_linux) {
   source_set("plugin") {
-    visibility = "//content/*"
+    visibility = [ "//content/*" ]
     sources = [
       "plugin_channel.cc",
       "plugin_channel.h",
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index 3ef1c6d..0b2a34b 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -316,7 +316,7 @@
 }
 
 grit("content_shell_resources_grit") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   source = "shell_resources.grd"
   outputs = [
     "grit/shell_resources.h",
@@ -336,14 +336,14 @@
 # Font copies.
 if (!is_mac) {
   copy("copy_ahem") {
-    visibility = ":*"
+    visibility = [ ":*" ]
     sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
     outputs = [ "$root_out_dir/AHEM____.TTF" ]
   }
 }
 if (use_x11) {
   copy("copy_x11_fonts") {
-    visibility = ":*"
+    visibility = [ ":*" ]
     sources = [
       "renderer/test_runner/resources/fonts/fonts.conf",
       "//third_party/gardiner_mod/GardinerModBug.ttf",
@@ -354,7 +354,7 @@
 }
 if (is_android) {
   copy("copy_android_fonts") {
-    visibility = ":*"
+    visibility = [ ":*" ]
     sources = [
       "renderer/test_runner/resources/fonts/android_main_fonts.xml",
       "renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
diff --git a/extensions/generated_extensions_api.gni b/extensions/generated_extensions_api.gni
index 0926d94..793ec64 100644
--- a/extensions/generated_extensions_api.gni
+++ b/extensions/generated_extensions_api.gni
@@ -67,7 +67,7 @@
 
   # Keep a copy of the target_name here since it will be trampled
   # in nested targets.
-  target_visibility = ":$target_name"
+  target_visibility = [ ":$target_name" ]
 
   generated_config_name = target_name + "_generated_config"
   config(generated_config_name) {
diff --git a/google_apis/gcm/BUILD.gn b/google_apis/gcm/BUILD.gn
index 4913324..cb6d043 100644
--- a/google_apis/gcm/BUILD.gn
+++ b/google_apis/gcm/BUILD.gn
@@ -58,7 +58,7 @@
 }
 
 proto_library("proto") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   sources = [
     "protocol/android_checkin.proto",
     "protocol/checkin.proto",
diff --git a/media/cast/logging/proto/BUILD.gn b/media/cast/logging/proto/BUILD.gn
index 2576c941..3018d29 100644
--- a/media/cast/logging/proto/BUILD.gn
+++ b/media/cast/logging/proto/BUILD.gn
@@ -18,7 +18,7 @@
 }
 
 proto_library("cast_logging_proto") {
-  visibility = ":proto"
+  visibility = [ ":proto" ]
   sources = [
     "raw_events.proto",
   ]
diff --git a/media/cast/test/proto/BUILD.gn b/media/cast/test/proto/BUILD.gn
index 85c19cfe..9c09c35 100644
--- a/media/cast/test/proto/BUILD.gn
+++ b/media/cast/test/proto/BUILD.gn
@@ -18,7 +18,7 @@
 }
 
 proto_library("cast_network_simulation_proto") {
-  visibility = ":proto"
+  visibility = [ ":proto" ]
   sources = [
     "network_simulation_model.proto",
   ]
diff --git a/mojo/environment/BUILD.gn b/mojo/environment/BUILD.gn
index cba8cac..ef7006d 100644
--- a/mojo/environment/BUILD.gn
+++ b/mojo/environment/BUILD.gn
@@ -25,7 +25,7 @@
 # GYP version: mojo_base.gyp:mojo_environment_chromium_impl
 component("chromium_impl") {
   output_name = "mojo_environment_impl"
-  visibility = "//mojo/*"
+  visibility = [ "//mojo/*" ]
 
   sources = [
     "default_async_waiter_impl.cc",
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni
index 7ee71b2..eeb32bd6 100644
--- a/mojo/public/tools/bindings/mojom.gni
+++ b/mojo/public/tools/bindings/mojom.gni
@@ -75,11 +75,18 @@
     "{{source_gen_dir}}/{{source_name_part}}_mojom.py",
   ]
 
-  target_visibility = ":$target_name"
+  if (defined(invoker.visibility)) {
+    # Need to save this because the the target_name is overwritten inside the
+    # action to be that of the action itself. Only define this in the case the
+    # var is used to avoid unused var error.
+    target_visibility = [ ":$target_name" ]
+  }
 
   generator_target_name = target_name + "_generator"
   action_foreach(generator_target_name) {
-    visibility = target_visibility
+    if (defined(invoker.visibility)) {
+      visibility = target_visibility + invoker.visibility
+    }
     script = generator_script
     inputs = generator_sources
     sources = invoker.sources
diff --git a/ppapi/BUILD.gn b/ppapi/BUILD.gn
index c0a4768..c51e252c 100644
--- a/ppapi/BUILD.gn
+++ b/ppapi/BUILD.gn
@@ -20,6 +20,12 @@
   sources = gypi_values.c_source_files
 }
 
+# Some targets need to depend on the PPAPI version only. This target exists so
+# they can include this header without header check warnings.
+source_set("ppapi_macros") {
+  sources = [ "c/pp_macros.h" ]
+}
+
 source_set("ppapi_cpp_objects") {
   sources = gypi_values.cpp_source_files
 
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index 58c8e48..86ed5a1 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -699,5 +699,5 @@
     "//base",
   ]
 
-  visibility = ":skia"
+  visibility = [ ":skia" ]
 }
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
index bb48833..7337461 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -15,7 +15,7 @@
 
 # Config internal to this build file.
 config("openssl_internal_config") {
-  visibility = ":*"  # Only targets in this file can depend on this.
+  visibility = [ ":*" ]  # Only targets in this file can depend on this.
 }
 
 # The list of BoringSSL files is kept in boringssl.gypi.
diff --git a/third_party/cld/BUILD.gn b/third_party/cld/BUILD.gn
index d3b5774..44416d4 100644
--- a/third_party/cld/BUILD.gn
+++ b/third_party/cld/BUILD.gn
@@ -8,6 +8,10 @@
 }
 
 static_library("cld") {
+  # This target includes its own copy of "base" which confuses the header
+  # checker.
+  check_includes = false
+
   sources = [
     "encodings/compact_lang_det/cldutil.cc",
     "encodings/compact_lang_det/cldutil.h",
diff --git a/third_party/dom_distiller_js/BUILD.gn b/third_party/dom_distiller_js/BUILD.gn
index a74c7924..91bc138 100644
--- a/third_party/dom_distiller_js/BUILD.gn
+++ b/third_party/dom_distiller_js/BUILD.gn
@@ -15,7 +15,7 @@
 }
 
 proto_library("dom_distiller_proto") {
-  visibility = ":*"
+  visibility = [ ":*" ]
   sources = [ "package/proto/dom_distiller.proto" ]
   proto_out_dir = "third_party/dom_distiller_js"
 }
diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn
index 72c9491..4119054 100644
--- a/third_party/protobuf/BUILD.gn
+++ b/third_party/protobuf/BUILD.gn
@@ -105,7 +105,8 @@
 # into that category. Do not use in Chrome code.
 
 source_set("protobuf_full") {
-  visibility = ":*"  # Prevent people from depending on this outside our file.
+  # Prevent people from depending on this outside our file.
+  visibility = [ ":*" ]
 
   sources = protobuf_lite_sources
   sources += [
diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto_library.gni
index 6382670..f228f65 100644
--- a/third_party/protobuf/proto_library.gni
+++ b/third_party/protobuf/proto_library.gni
@@ -55,7 +55,7 @@
   action_name = "${target_name}_gen"
   source_set_name = target_name
   action_foreach(action_name) {
-    visibility = ":$source_set_name"
+    visibility = [ ":$source_set_name" ]
 
     script = "//tools/protoc_wrapper/protoc_wrapper.py"
 
diff --git a/third_party/yasm/yasm_assemble.gni b/third_party/yasm/yasm_assemble.gni
index 5dc4c7c..78037b8 100644
--- a/third_party/yasm/yasm_assemble.gni
+++ b/third_party/yasm/yasm_assemble.gni
@@ -110,7 +110,8 @@
   source_set_name = target_name
 
   action_foreach(action_name) {
-    visibility = ":$source_set_name"  # Only the source set can depend on this.
+    # Only the source set can depend on this.
+    visibility = [ ":$source_set_name" ]
 
     script = "//third_party/yasm/run_yasm.py"
     sources = invoker.sources
diff --git a/tools/generate_library_loader/generate_library_loader.gni b/tools/generate_library_loader/generate_library_loader.gni
index 5246aef..e38beae 100644
--- a/tools/generate_library_loader/generate_library_loader.gni
+++ b/tools/generate_library_loader/generate_library_loader.gni
@@ -15,7 +15,7 @@
   output_h = "$root_gen_dir/library_loaders/" + invoker.output_h
   output_cc = "$root_gen_dir/library_loaders/" + invoker.output_cc
 
-  action_visibility = ":$target_name"
+  action_visibility = [ ":$target_name" ]
   action("${target_name}_loader") {
     visibility = action_visibility
 
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
index bf6f32a..a443645 100644
--- a/ui/gl/BUILD.gn
+++ b/ui/gl/BUILD.gn
@@ -258,7 +258,7 @@
 }
 
 action("generate_gl_bindings") {
-  visibility = ":*"  # Only targets in this file can see this.
+  visibility = [ ":*" ]  # Only targets in this file can see this.
 
   script = "generate_bindings.py"
 
diff --git a/ui/keyboard/webui/BUILD.gn b/ui/keyboard/webui/BUILD.gn
index 6672ca4..cf30681 100644
--- a/ui/keyboard/webui/BUILD.gn
+++ b/ui/keyboard/webui/BUILD.gn
@@ -13,7 +13,7 @@
 
 # GYP version: part of ui/keyboard/keyboard.gyp:keyboard
 source_set("webui") {
-  visibility = "//ui/keyboard"
+  visibility = [ "//ui/keyboard" ]
 
   sources = [
     "../keyboard_export.h",
diff --git a/ui/resources/BUILD.gn b/ui/resources/BUILD.gn
index e4dbd938..aa89035 100644
--- a/ui/resources/BUILD.gn
+++ b/ui/resources/BUILD.gn
@@ -15,7 +15,6 @@
 }
 
 grit("ui_resources_grd") {
-  visibility = ":resources"
   source = "ui_resources.grd"
   outputs = [
     "grit/ui_resources.h",
@@ -27,7 +26,6 @@
 }
 
 grit("ui_unscaled_resources_grd") {
-  visibility = ":resources"
   source = "ui_unscaled_resources.grd"
   outputs = [
     "grit/ui_unscaled_resources.h",
@@ -36,7 +34,6 @@
 }
 
 grit("webui_resources_grd") {
-  visibility = ":resources"
   source = "../webui/resources/webui_resources.grd"
   outputs = [
     "grit/webui_resources.h",
@@ -74,7 +71,7 @@
 # GYP version: ui/resources/ui_resources.gyp:ui_test_pak
 repack("repack_ui_test_pak") {
   # Depend on ui_test_pak instead of this one.
-  visibility = ":ui_test_pak"
+  visibility = [ ":ui_test_pak" ]
 
   sources = [ 
     "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",