Avoid using gypi_to_gn.py.

Change-Id: I9bac8317577feaadfa00ec88661175b7338ced4a
Reviewed-on: https://chromium-review.googlesource.com/c/1267596
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Shu Chen <shuchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599191}
diff --git a/third_party/google_input_tools/README.chromium b/third_party/google_input_tools/README.chromium
index 326606d..f0ec0c8 100644
--- a/third_party/google_input_tools/README.chromium
+++ b/third_party/google_input_tools/README.chromium
@@ -23,9 +23,7 @@
 
 builder.py: Python script for building inputview.js.
 closure.gni: GN template for calling the closure builder.
-inputview.gni: Convert build dependencies from gyp to gn format.
-inputview.gyp: Build file for generating inputview.js.
-inputview.gypi: Autogenerated by update script to define sources for inputview.
+inputview.gni: List all the files to be compiled.
 update.py: Python script for updating revision of google-input-tools.
 
 Modified extendedlayout.js to fix size calculations for scrolling of the
diff --git a/third_party/google_input_tools/builder.py b/third_party/google_input_tools/builder.py
index 4e86ec4..cffcb6b 100755
--- a/third_party/google_input_tools/builder.py
+++ b/third_party/google_input_tools/builder.py
@@ -6,9 +6,9 @@
 """Closure builder for Javascript."""
 
 import argparse
-import json
 import os
 import re
+import shlex
 
 _BASE_REGEX_STRING = r'^\s*goog\.%s\(\s*[\'"](.+)[\'"]\s*\)'
 require_regex = re.compile(_BASE_REGEX_STRING % 'require')
@@ -155,35 +155,21 @@
     absolute.  Otherwise, relative paths may be used.
   """
 
-  sources = None
-  if options.json_file:
-    # Optionally load list of source files from a json file. Useful when the
-    # list of files to process is too long for the command line.
-    with open(options.json_file, 'r') as json_file:
-      data = []
-      # Strip leading comments.
-      for line in json_file:
-        if not line.startswith('#'):
-          data.append(line)
-      json_object = json.loads(os.linesep.join(data).replace('\'', '\"'))
-      path = options.json_sources.split('.')
-      sources = json_object
-      for key in path:
-        sources = sources[key]
-      if options.path:
-        sources = [os.path.join(options.path, source) for source in sources]
-  else:
-    sources = options.sources
+  sources = []
+  # Optionally load list of source files from a json file. Useful when the
+  # list of files to process is too long for the command line.
+  with open(options.sources_list[0], 'r') as f:
+    sources = shlex.split(f.read())
+  if options.path:
+    sources = [os.path.join(options.path, source) for source in sources]
   return sources
 
 
 def main():
   """The entrypoint for this script."""
   parser = argparse.ArgumentParser()
-  parser.add_argument('--sources', nargs='*')
+  parser.add_argument('--sources-list', nargs=1)
   parser.add_argument('--target', nargs=1)
-  parser.add_argument('--json_file', nargs='?')
-  parser.add_argument('--json_sources', nargs='?')
   parser.add_argument('--path', nargs='?')
   options = parser.parse_args()
 
diff --git a/third_party/google_input_tools/closure.gni b/third_party/google_input_tools/closure.gni
index 74128440..e4279f5 100644
--- a/third_party/google_input_tools/closure.gni
+++ b/third_party/google_input_tools/closure.gni
@@ -11,26 +11,13 @@
     outputs = [
       invoker.target,
     ]
+    response_file_contents = sources
     args = [
       "--target",
       rebase_path(invoker.target, root_build_dir),
+      "--sources-list",
+      "{{response_file_name}}",
     ]
-    if (defined(invoker.json_file)) {
-      # Optionally parse list of sources from a json file. Useful when the list
-      # is sufficiently long to create problems with length restrictions on the
-      # command line.
-      assert(defined(invoker.json_sources))
-      args += [
-        "--json_file",
-        rebase_path(invoker.json_file, root_build_dir),
-        "--json_sources",
-        invoker.json_sources,
-      ]
-    } else {
-      # If the number of source files is short, they can be directly extracted
-      # from the command line.
-      args += [ "--sources" ] + sources
-    }
     if (defined(invoker.path)) {
       args += [
         "--path",
diff --git a/third_party/google_input_tools/inputview.gni b/third_party/google_input_tools/inputview.gni
index 0c5d836..79fd6c6 100644
--- a/third_party/google_input_tools/inputview.gni
+++ b/third_party/google_input_tools/inputview.gni
@@ -2,8 +2,239 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-inputview_gypi_values = exec_script("//build/gypi_to_gn.py",
-                                    [ rebase_path("inputview.gypi") ],
-                                    "scope",
-                                    [ "inputview.gypi" ])
-inputview_sources = rebase_path(inputview_gypi_values.inputview_sources)
+inputview_sources = rebase_path(
+        [
+          "src/chrome/os/common.js",
+          "src/chrome/os/constant.js",
+          "src/chrome/os/datasource.js",
+          "src/chrome/os/elementtype.js",
+          "src/chrome/os/env.js",
+          "src/chrome/os/events/keycodes.js",
+          "src/chrome/os/featurename.js",
+          "src/chrome/os/featuretracker.js",
+          "src/chrome/os/floatingwindow/floatingwindow.js",
+          "src/chrome/os/floatingwindow/floatingwindowdragger.js",
+          "src/chrome/os/floatingwindow/windowutil.js",
+          "src/chrome/os/inputview/adapter.js",
+          "src/chrome/os/inputview/candidatesinfo.js",
+          "src/chrome/os/inputview/canvas.js",
+          "src/chrome/os/inputview/conditionname.js",
+          "src/chrome/os/inputview/config/compact_letter_characters.js",
+          "src/chrome/os/inputview/config/compact_more_characters.js",
+          "src/chrome/os/inputview/config/compact_numberpad_characters.js",
+          "src/chrome/os/inputview/config/compact_symbol_characters.js",
+          "src/chrome/os/inputview/config/compact_util.js",
+          "src/chrome/os/inputview/config/constants.js",
+          "src/chrome/os/inputview/config/contextlayoututil.js",
+          "src/chrome/os/inputview/config/util.js",
+          "src/chrome/os/inputview/controller.js",
+          "src/chrome/os/inputview/covariance.js",
+          "src/chrome/os/inputview/css.js",
+          "src/chrome/os/inputview/direction.js",
+          "src/chrome/os/inputview/dom.js",
+          "src/chrome/os/inputview/elements/content/altdataview.js",
+          "src/chrome/os/inputview/elements/content/backspacekey.js",
+          "src/chrome/os/inputview/elements/content/candidate.js",
+          "src/chrome/os/inputview/elements/content/candidatebutton.js",
+          "src/chrome/os/inputview/elements/content/candidateview.js",
+          "src/chrome/os/inputview/elements/content/canvasview.js",
+          "src/chrome/os/inputview/elements/content/character.js",
+          "src/chrome/os/inputview/elements/content/characterkey.js",
+          "src/chrome/os/inputview/elements/content/charactermodel.js",
+          "src/chrome/os/inputview/elements/content/compactkey.js",
+          "src/chrome/os/inputview/elements/content/compactkeymodel.js",
+          "src/chrome/os/inputview/elements/content/dragbutton.js",
+          "src/chrome/os/inputview/elements/content/emojikey.js",
+          "src/chrome/os/inputview/elements/content/emojiview.js",
+          "src/chrome/os/inputview/elements/content/enswitcherkey.js",
+          "src/chrome/os/inputview/elements/content/enterkey.js",
+          "src/chrome/os/inputview/elements/content/expandedcandidateview.js",
+          "src/chrome/os/inputview/elements/content/floatingview.js",
+          "src/chrome/os/inputview/elements/content/functionalkey.js",
+          "src/chrome/os/inputview/elements/content/gaussianestimator.js",
+          "src/chrome/os/inputview/elements/content/gesturecanvasview.js",
+          "src/chrome/os/inputview/elements/content/gesturestroke.js",
+          "src/chrome/os/inputview/elements/content/handwritingview.js",
+          "src/chrome/os/inputview/elements/content/keyboardview.js",
+          "src/chrome/os/inputview/elements/content/keysetview.js",
+          "src/chrome/os/inputview/elements/content/menuitem.js",
+          "src/chrome/os/inputview/elements/content/menukey.js",
+          "src/chrome/os/inputview/elements/content/menuview.js",
+          "src/chrome/os/inputview/elements/content/modifierkey.js",
+          "src/chrome/os/inputview/elements/content/morekeysshiftoperation.js",
+          "src/chrome/os/inputview/elements/content/pageindicator.js",
+          "src/chrome/os/inputview/elements/content/point.js",
+          "src/chrome/os/inputview/elements/content/selectview.js",
+          "src/chrome/os/inputview/elements/content/softkey.js",
+          "src/chrome/os/inputview/elements/content/spacekey.js",
+          "src/chrome/os/inputview/elements/content/spanelement.js",
+          "src/chrome/os/inputview/elements/content/swipeview.js",
+          "src/chrome/os/inputview/elements/content/switcherkey.js",
+          "src/chrome/os/inputview/elements/content/tabbarkey.js",
+          "src/chrome/os/inputview/elements/content/toolbarbutton.js",
+          "src/chrome/os/inputview/elements/content/voiceview.js",
+          "src/chrome/os/inputview/elements/element.js",
+          "src/chrome/os/inputview/elements/layout/extendedlayout.js",
+          "src/chrome/os/inputview/elements/layout/handwritinglayout.js",
+          "src/chrome/os/inputview/elements/layout/linearlayout.js",
+          "src/chrome/os/inputview/elements/layout/softkeyview.js",
+          "src/chrome/os/inputview/elements/layout/verticallayout.js",
+          "src/chrome/os/inputview/elements/weightable.js",
+          "src/chrome/os/inputview/emojitype.js",
+          "src/chrome/os/inputview/events.js",
+          "src/chrome/os/inputview/globalsettings.js",
+          "src/chrome/os/inputview/handler/pointeractionbundle.js",
+          "src/chrome/os/inputview/handler/pointerhandler.js",
+          "src/chrome/os/inputview/handler/swipestate.js",
+          "src/chrome/os/inputview/handler/util.js",
+          "src/chrome/os/inputview/hwt_css.js",
+          "src/chrome/os/inputview/hwt_eventtype.js",
+          "src/chrome/os/inputview/hwt_util.js",
+          "src/chrome/os/inputview/imewindows/accents.js",
+          "src/chrome/os/inputview/imewindows/gesturepreviewwindow.js",
+          "src/chrome/os/inputview/inputtool.js",
+          "src/chrome/os/inputview/inputtoolcode.js",
+          "src/chrome/os/inputview/inputtooltype.js",
+          "src/chrome/os/inputview/keyboardcontainer.js",
+          "src/chrome/os/inputview/layouts/compactspacerow.js",
+          "src/chrome/os/inputview/layouts/rowsof101.js",
+          "src/chrome/os/inputview/layouts/rowsof102.js",
+          "src/chrome/os/inputview/layouts/rowsofcompact.js",
+          "src/chrome/os/inputview/layouts/rowsofjp.js",
+          "src/chrome/os/inputview/layouts/rowsofnumberpad.js",
+          "src/chrome/os/inputview/layouts/spacerow.js",
+          "src/chrome/os/inputview/layouts/util.js",
+          "src/chrome/os/inputview/m17nmodel.js",
+          "src/chrome/os/inputview/model.js",
+          "src/chrome/os/inputview/perftracker.js",
+          "src/chrome/os/inputview/pointerconfig.js",
+          "src/chrome/os/inputview/readystate.js",
+          "src/chrome/os/inputview/settings.js",
+          "src/chrome/os/inputview/sizespec.js",
+          "src/chrome/os/inputview/specnodename.js",
+          "src/chrome/os/inputview/statemanager.js",
+          "src/chrome/os/inputview/statetype.js",
+          "src/chrome/os/inputview/strokehandler.js",
+          "src/chrome/os/inputview/swipedirection.js",
+          "src/chrome/os/inputview/util.js",
+          "src/chrome/os/keyboard/eventtype.js",
+          "src/chrome/os/keyboard/layoutevent.js",
+          "src/chrome/os/keyboard/model.js",
+          "src/chrome/os/keyboard/parsedlayout.js",
+          "src/chrome/os/message/contexttype.js",
+          "src/chrome/os/message/name.js",
+          "src/chrome/os/message/source.js",
+          "src/chrome/os/message/type.js",
+          "src/chrome/os/sounds/soundcontroller.js",
+          "src/chrome/os/sounds/sounds.js",
+          "src/chrome/os/statistics.js",
+          "third_party/closure_library/closure/goog/a11y/aria/announcer.js",
+          "third_party/closure_library/closure/goog/a11y/aria/aria.js",
+          "third_party/closure_library/closure/goog/a11y/aria/attributes.js",
+          "third_party/closure_library/closure/goog/a11y/aria/datatables.js",
+          "third_party/closure_library/closure/goog/a11y/aria/roles.js",
+          "third_party/closure_library/closure/goog/array/array.js",
+          "third_party/closure_library/closure/goog/asserts/asserts.js",
+          "third_party/closure_library/closure/goog/async/animationdelay.js",
+          "third_party/closure_library/closure/goog/async/delay.js",
+          "third_party/closure_library/closure/goog/async/freelist.js",
+          "third_party/closure_library/closure/goog/async/nexttick.js",
+          "third_party/closure_library/closure/goog/async/run.js",
+          "third_party/closure_library/closure/goog/async/workqueue.js",
+          "third_party/closure_library/closure/goog/color/color.js",
+          "third_party/closure_library/closure/goog/color/names.js",
+          "third_party/closure_library/closure/goog/debug/debug.js",
+          "third_party/closure_library/closure/goog/debug/entrypointregistry.js",
+          "third_party/closure_library/closure/goog/debug/error.js",
+          "third_party/closure_library/closure/goog/debug/logbuffer.js",
+          "third_party/closure_library/closure/goog/debug/logger.js",
+          "third_party/closure_library/closure/goog/debug/logrecord.js",
+          "third_party/closure_library/closure/goog/disposable/disposable.js",
+          "third_party/closure_library/closure/goog/disposable/idisposable.js",
+          "third_party/closure_library/closure/goog/dom/browserfeature.js",
+          "third_party/closure_library/closure/goog/dom/classlist.js",
+          "third_party/closure_library/closure/goog/dom/dom.js",
+          "third_party/closure_library/closure/goog/dom/nodetype.js",
+          "third_party/closure_library/closure/goog/dom/safe.js",
+          "third_party/closure_library/closure/goog/dom/tagname.js",
+          "third_party/closure_library/closure/goog/dom/tags.js",
+          "third_party/closure_library/closure/goog/dom/vendor.js",
+          "third_party/closure_library/closure/goog/events/browserevent.js",
+          "third_party/closure_library/closure/goog/events/browserfeature.js",
+          "third_party/closure_library/closure/goog/events/event.js",
+          "third_party/closure_library/closure/goog/events/eventhandler.js",
+          "third_party/closure_library/closure/goog/events/eventid.js",
+          "third_party/closure_library/closure/goog/events/events.js",
+          "third_party/closure_library/closure/goog/events/eventtarget.js",
+          "third_party/closure_library/closure/goog/events/eventtype.js",
+          "third_party/closure_library/closure/goog/events/keycodes.js",
+          "third_party/closure_library/closure/goog/events/keyhandler.js",
+          "third_party/closure_library/closure/goog/events/listenable.js",
+          "third_party/closure_library/closure/goog/events/listener.js",
+          "third_party/closure_library/closure/goog/events/listenermap.js",
+          "third_party/closure_library/closure/goog/fs/url.js",
+          "third_party/closure_library/closure/goog/functions/functions.js",
+          "third_party/closure_library/closure/goog/fx/anim/anim.js",
+          "third_party/closure_library/closure/goog/fx/animation.js",
+          "third_party/closure_library/closure/goog/fx/dom.js",
+          "third_party/closure_library/closure/goog/fx/dragger.js",
+          "third_party/closure_library/closure/goog/fx/easing.js",
+          "third_party/closure_library/closure/goog/fx/transition.js",
+          "third_party/closure_library/closure/goog/fx/transitionbase.js",
+          "third_party/closure_library/closure/goog/html/safehtml.js",
+          "third_party/closure_library/closure/goog/html/safescript.js",
+          "third_party/closure_library/closure/goog/html/safestyle.js",
+          "third_party/closure_library/closure/goog/html/safestylesheet.js",
+          "third_party/closure_library/closure/goog/html/safeurl.js",
+          "third_party/closure_library/closure/goog/html/trustedresourceurl.js",
+          "third_party/closure_library/closure/goog/html/uncheckedconversions.js",
+          "third_party/closure_library/closure/goog/i18n/bidi.js",
+          "third_party/closure_library/closure/goog/iter/iter.js",
+          "third_party/closure_library/closure/goog/labs/useragent/browser.js",
+          "third_party/closure_library/closure/goog/labs/useragent/engine.js",
+          "third_party/closure_library/closure/goog/labs/useragent/platform.js",
+          "third_party/closure_library/closure/goog/labs/useragent/util.js",
+          "third_party/closure_library/closure/goog/log/log.js",
+          "third_party/closure_library/closure/goog/math/box.js",
+          "third_party/closure_library/closure/goog/math/coordinate.js",
+          "third_party/closure_library/closure/goog/math/coordinate3.js",
+          "third_party/closure_library/closure/goog/math/math.js",
+          "third_party/closure_library/closure/goog/math/rect.js",
+          "third_party/closure_library/closure/goog/math/size.js",
+          "third_party/closure_library/closure/goog/net/jsloader.js",
+          "third_party/closure_library/closure/goog/object/object.js",
+          "third_party/closure_library/closure/goog/positioning/abstractposition.js",
+          "third_party/closure_library/closure/goog/positioning/anchoredposition.js",
+          "third_party/closure_library/closure/goog/positioning/anchoredviewportposition.js",
+          "third_party/closure_library/closure/goog/positioning/positioning.js",
+          "third_party/closure_library/closure/goog/promise/promise.js",
+          "third_party/closure_library/closure/goog/promise/resolver.js",
+          "third_party/closure_library/closure/goog/promise/thenable.js",
+          "third_party/closure_library/closure/goog/reflect/reflect.js",
+          "third_party/closure_library/closure/goog/string/const.js",
+          "third_party/closure_library/closure/goog/string/string.js",
+          "third_party/closure_library/closure/goog/string/typedstring.js",
+          "third_party/closure_library/closure/goog/structs/collection.js",
+          "third_party/closure_library/closure/goog/structs/map.js",
+          "third_party/closure_library/closure/goog/structs/set.js",
+          "third_party/closure_library/closure/goog/structs/structs.js",
+          "third_party/closure_library/closure/goog/style/bidi.js",
+          "third_party/closure_library/closure/goog/style/style.js",
+          "third_party/closure_library/closure/goog/style/transform.js",
+          "third_party/closure_library/closure/goog/testing/watchers.js",
+          "third_party/closure_library/closure/goog/timer/timer.js",
+          "third_party/closure_library/closure/goog/ui/component.js",
+          "third_party/closure_library/closure/goog/ui/container.js",
+          "third_party/closure_library/closure/goog/ui/containerrenderer.js",
+          "third_party/closure_library/closure/goog/ui/control.js",
+          "third_party/closure_library/closure/goog/ui/controlcontent.js",
+          "third_party/closure_library/closure/goog/ui/controlrenderer.js",
+          "third_party/closure_library/closure/goog/ui/decorate.js",
+          "third_party/closure_library/closure/goog/ui/idgenerator.js",
+          "third_party/closure_library/closure/goog/ui/registry.js",
+          "third_party/closure_library/closure/goog/uri/utils.js",
+          "third_party/closure_library/closure/goog/useragent/product.js",
+          "third_party/closure_library/closure/goog/useragent/product_isversion.js",
+          "third_party/closure_library/closure/goog/useragent/useragent.js",
+          "third_party/closure_library/third_party/closure/goog/mochikit/async/deferred.js",
+        ])
diff --git a/third_party/google_input_tools/inputview.gypi b/third_party/google_input_tools/inputview.gypi
deleted file mode 100644
index a44614b..0000000
--- a/third_party/google_input_tools/inputview.gypi
+++ /dev/null
@@ -1,244 +0,0 @@
-# Copyright 2014 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 is auto-generated using update.py.
-{
-  'variables': {
-    'inputview_sources': [
-      'src/chrome/os/common.js',
-      'src/chrome/os/constant.js',
-      'src/chrome/os/datasource.js',
-      'src/chrome/os/elementtype.js',
-      'src/chrome/os/env.js',
-      'src/chrome/os/events/keycodes.js',
-      'src/chrome/os/featurename.js',
-      'src/chrome/os/featuretracker.js',
-      'src/chrome/os/floatingwindow/floatingwindow.js',
-      'src/chrome/os/floatingwindow/floatingwindowdragger.js',
-      'src/chrome/os/floatingwindow/windowutil.js',
-      'src/chrome/os/inputview/adapter.js',
-      'src/chrome/os/inputview/candidatesinfo.js',
-      'src/chrome/os/inputview/canvas.js',
-      'src/chrome/os/inputview/conditionname.js',
-      'src/chrome/os/inputview/config/compact_letter_characters.js',
-      'src/chrome/os/inputview/config/compact_more_characters.js',
-      'src/chrome/os/inputview/config/compact_numberpad_characters.js',
-      'src/chrome/os/inputview/config/compact_symbol_characters.js',
-      'src/chrome/os/inputview/config/compact_util.js',
-      'src/chrome/os/inputview/config/constants.js',
-      'src/chrome/os/inputview/config/contextlayoututil.js',
-      'src/chrome/os/inputview/config/util.js',
-      'src/chrome/os/inputview/controller.js',
-      'src/chrome/os/inputview/covariance.js',
-      'src/chrome/os/inputview/css.js',
-      'src/chrome/os/inputview/direction.js',
-      'src/chrome/os/inputview/dom.js',
-      'src/chrome/os/inputview/elements/content/altdataview.js',
-      'src/chrome/os/inputview/elements/content/backspacekey.js',
-      'src/chrome/os/inputview/elements/content/candidate.js',
-      'src/chrome/os/inputview/elements/content/candidatebutton.js',
-      'src/chrome/os/inputview/elements/content/candidateview.js',
-      'src/chrome/os/inputview/elements/content/canvasview.js',
-      'src/chrome/os/inputview/elements/content/character.js',
-      'src/chrome/os/inputview/elements/content/characterkey.js',
-      'src/chrome/os/inputview/elements/content/charactermodel.js',
-      'src/chrome/os/inputview/elements/content/compactkey.js',
-      'src/chrome/os/inputview/elements/content/compactkeymodel.js',
-      'src/chrome/os/inputview/elements/content/dragbutton.js',
-      'src/chrome/os/inputview/elements/content/emojikey.js',
-      'src/chrome/os/inputview/elements/content/emojiview.js',
-      'src/chrome/os/inputview/elements/content/enswitcherkey.js',
-      'src/chrome/os/inputview/elements/content/enterkey.js',
-      'src/chrome/os/inputview/elements/content/expandedcandidateview.js',
-      'src/chrome/os/inputview/elements/content/floatingview.js',
-      'src/chrome/os/inputview/elements/content/functionalkey.js',
-      'src/chrome/os/inputview/elements/content/gaussianestimator.js',
-      'src/chrome/os/inputview/elements/content/gesturecanvasview.js',
-      'src/chrome/os/inputview/elements/content/gesturestroke.js',
-      'src/chrome/os/inputview/elements/content/handwritingview.js',
-      'src/chrome/os/inputview/elements/content/keyboardview.js',
-      'src/chrome/os/inputview/elements/content/keysetview.js',
-      'src/chrome/os/inputview/elements/content/menuitem.js',
-      'src/chrome/os/inputview/elements/content/menukey.js',
-      'src/chrome/os/inputview/elements/content/menuview.js',
-      'src/chrome/os/inputview/elements/content/modifierkey.js',
-      'src/chrome/os/inputview/elements/content/morekeysshiftoperation.js',
-      'src/chrome/os/inputview/elements/content/pageindicator.js',
-      'src/chrome/os/inputview/elements/content/point.js',
-      'src/chrome/os/inputview/elements/content/selectview.js',
-      'src/chrome/os/inputview/elements/content/softkey.js',
-      'src/chrome/os/inputview/elements/content/spacekey.js',
-      'src/chrome/os/inputview/elements/content/spanelement.js',
-      'src/chrome/os/inputview/elements/content/swipeview.js',
-      'src/chrome/os/inputview/elements/content/switcherkey.js',
-      'src/chrome/os/inputview/elements/content/tabbarkey.js',
-      'src/chrome/os/inputview/elements/content/toolbarbutton.js',
-      'src/chrome/os/inputview/elements/content/voiceview.js',
-      'src/chrome/os/inputview/elements/element.js',
-      'src/chrome/os/inputview/elements/layout/extendedlayout.js',
-      'src/chrome/os/inputview/elements/layout/handwritinglayout.js',
-      'src/chrome/os/inputview/elements/layout/linearlayout.js',
-      'src/chrome/os/inputview/elements/layout/softkeyview.js',
-      'src/chrome/os/inputview/elements/layout/verticallayout.js',
-      'src/chrome/os/inputview/elements/weightable.js',
-      'src/chrome/os/inputview/emojitype.js',
-      'src/chrome/os/inputview/events.js',
-      'src/chrome/os/inputview/globalsettings.js',
-      'src/chrome/os/inputview/handler/pointeractionbundle.js',
-      'src/chrome/os/inputview/handler/pointerhandler.js',
-      'src/chrome/os/inputview/handler/swipestate.js',
-      'src/chrome/os/inputview/handler/util.js',
-      'src/chrome/os/inputview/hwt_css.js',
-      'src/chrome/os/inputview/hwt_eventtype.js',
-      'src/chrome/os/inputview/hwt_util.js',
-      'src/chrome/os/inputview/imewindows/accents.js',
-      'src/chrome/os/inputview/imewindows/gesturepreviewwindow.js',
-      'src/chrome/os/inputview/inputtool.js',
-      'src/chrome/os/inputview/inputtoolcode.js',
-      'src/chrome/os/inputview/inputtooltype.js',
-      'src/chrome/os/inputview/keyboardcontainer.js',
-      'src/chrome/os/inputview/layouts/compactspacerow.js',
-      'src/chrome/os/inputview/layouts/rowsof101.js',
-      'src/chrome/os/inputview/layouts/rowsof102.js',
-      'src/chrome/os/inputview/layouts/rowsofcompact.js',
-      'src/chrome/os/inputview/layouts/rowsofjp.js',
-      'src/chrome/os/inputview/layouts/rowsofnumberpad.js',
-      'src/chrome/os/inputview/layouts/spacerow.js',
-      'src/chrome/os/inputview/layouts/util.js',
-      'src/chrome/os/inputview/m17nmodel.js',
-      'src/chrome/os/inputview/model.js',
-      'src/chrome/os/inputview/perftracker.js',
-      'src/chrome/os/inputview/pointerconfig.js',
-      'src/chrome/os/inputview/readystate.js',
-      'src/chrome/os/inputview/settings.js',
-      'src/chrome/os/inputview/sizespec.js',
-      'src/chrome/os/inputview/specnodename.js',
-      'src/chrome/os/inputview/statemanager.js',
-      'src/chrome/os/inputview/statetype.js',
-      'src/chrome/os/inputview/strokehandler.js',
-      'src/chrome/os/inputview/swipedirection.js',
-      'src/chrome/os/inputview/util.js',
-      'src/chrome/os/keyboard/eventtype.js',
-      'src/chrome/os/keyboard/layoutevent.js',
-      'src/chrome/os/keyboard/model.js',
-      'src/chrome/os/keyboard/parsedlayout.js',
-      'src/chrome/os/message/contexttype.js',
-      'src/chrome/os/message/name.js',
-      'src/chrome/os/message/source.js',
-      'src/chrome/os/message/type.js',
-      'src/chrome/os/sounds/soundcontroller.js',
-      'src/chrome/os/sounds/sounds.js',
-      'src/chrome/os/statistics.js',
-      'third_party/closure_library/closure/goog/a11y/aria/announcer.js',
-      'third_party/closure_library/closure/goog/a11y/aria/aria.js',
-      'third_party/closure_library/closure/goog/a11y/aria/attributes.js',
-      'third_party/closure_library/closure/goog/a11y/aria/datatables.js',
-      'third_party/closure_library/closure/goog/a11y/aria/roles.js',
-      'third_party/closure_library/closure/goog/array/array.js',
-      'third_party/closure_library/closure/goog/asserts/asserts.js',
-      'third_party/closure_library/closure/goog/async/animationdelay.js',
-      'third_party/closure_library/closure/goog/async/delay.js',
-      'third_party/closure_library/closure/goog/async/freelist.js',
-      'third_party/closure_library/closure/goog/async/nexttick.js',
-      'third_party/closure_library/closure/goog/async/run.js',
-      'third_party/closure_library/closure/goog/async/workqueue.js',
-      'third_party/closure_library/closure/goog/color/color.js',
-      'third_party/closure_library/closure/goog/color/names.js',
-      'third_party/closure_library/closure/goog/debug/debug.js',
-      'third_party/closure_library/closure/goog/debug/entrypointregistry.js',
-      'third_party/closure_library/closure/goog/debug/error.js',
-      'third_party/closure_library/closure/goog/debug/logbuffer.js',
-      'third_party/closure_library/closure/goog/debug/logger.js',
-      'third_party/closure_library/closure/goog/debug/logrecord.js',
-      'third_party/closure_library/closure/goog/disposable/disposable.js',
-      'third_party/closure_library/closure/goog/disposable/idisposable.js',
-      'third_party/closure_library/closure/goog/dom/browserfeature.js',
-      'third_party/closure_library/closure/goog/dom/classlist.js',
-      'third_party/closure_library/closure/goog/dom/dom.js',
-      'third_party/closure_library/closure/goog/dom/nodetype.js',
-      'third_party/closure_library/closure/goog/dom/safe.js',
-      'third_party/closure_library/closure/goog/dom/tagname.js',
-      'third_party/closure_library/closure/goog/dom/tags.js',
-      'third_party/closure_library/closure/goog/dom/vendor.js',
-      'third_party/closure_library/closure/goog/events/browserevent.js',
-      'third_party/closure_library/closure/goog/events/browserfeature.js',
-      'third_party/closure_library/closure/goog/events/event.js',
-      'third_party/closure_library/closure/goog/events/eventhandler.js',
-      'third_party/closure_library/closure/goog/events/eventid.js',
-      'third_party/closure_library/closure/goog/events/events.js',
-      'third_party/closure_library/closure/goog/events/eventtarget.js',
-      'third_party/closure_library/closure/goog/events/eventtype.js',
-      'third_party/closure_library/closure/goog/events/keycodes.js',
-      'third_party/closure_library/closure/goog/events/keyhandler.js',
-      'third_party/closure_library/closure/goog/events/listenable.js',
-      'third_party/closure_library/closure/goog/events/listener.js',
-      'third_party/closure_library/closure/goog/events/listenermap.js',
-      'third_party/closure_library/closure/goog/fs/url.js',
-      'third_party/closure_library/closure/goog/functions/functions.js',
-      'third_party/closure_library/closure/goog/fx/anim/anim.js',
-      'third_party/closure_library/closure/goog/fx/animation.js',
-      'third_party/closure_library/closure/goog/fx/dom.js',
-      'third_party/closure_library/closure/goog/fx/dragger.js',
-      'third_party/closure_library/closure/goog/fx/easing.js',
-      'third_party/closure_library/closure/goog/fx/transition.js',
-      'third_party/closure_library/closure/goog/fx/transitionbase.js',
-      'third_party/closure_library/closure/goog/html/safehtml.js',
-      'third_party/closure_library/closure/goog/html/safescript.js',
-      'third_party/closure_library/closure/goog/html/safestyle.js',
-      'third_party/closure_library/closure/goog/html/safestylesheet.js',
-      'third_party/closure_library/closure/goog/html/safeurl.js',
-      'third_party/closure_library/closure/goog/html/trustedresourceurl.js',
-      'third_party/closure_library/closure/goog/html/uncheckedconversions.js',
-      'third_party/closure_library/closure/goog/i18n/bidi.js',
-      'third_party/closure_library/closure/goog/iter/iter.js',
-      'third_party/closure_library/closure/goog/labs/useragent/browser.js',
-      'third_party/closure_library/closure/goog/labs/useragent/engine.js',
-      'third_party/closure_library/closure/goog/labs/useragent/platform.js',
-      'third_party/closure_library/closure/goog/labs/useragent/util.js',
-      'third_party/closure_library/closure/goog/log/log.js',
-      'third_party/closure_library/closure/goog/math/box.js',
-      'third_party/closure_library/closure/goog/math/coordinate.js',
-      'third_party/closure_library/closure/goog/math/coordinate3.js',
-      'third_party/closure_library/closure/goog/math/math.js',
-      'third_party/closure_library/closure/goog/math/rect.js',
-      'third_party/closure_library/closure/goog/math/size.js',
-      'third_party/closure_library/closure/goog/net/jsloader.js',
-      'third_party/closure_library/closure/goog/object/object.js',
-      'third_party/closure_library/closure/goog/positioning/abstractposition.js',
-      'third_party/closure_library/closure/goog/positioning/anchoredposition.js',
-      'third_party/closure_library/closure/goog/positioning/anchoredviewportposition.js',
-      'third_party/closure_library/closure/goog/positioning/positioning.js',
-      'third_party/closure_library/closure/goog/promise/promise.js',
-      'third_party/closure_library/closure/goog/promise/resolver.js',
-      'third_party/closure_library/closure/goog/promise/thenable.js',
-      'third_party/closure_library/closure/goog/reflect/reflect.js',
-      'third_party/closure_library/closure/goog/string/const.js',
-      'third_party/closure_library/closure/goog/string/string.js',
-      'third_party/closure_library/closure/goog/string/typedstring.js',
-      'third_party/closure_library/closure/goog/structs/collection.js',
-      'third_party/closure_library/closure/goog/structs/map.js',
-      'third_party/closure_library/closure/goog/structs/set.js',
-      'third_party/closure_library/closure/goog/structs/structs.js',
-      'third_party/closure_library/closure/goog/style/bidi.js',
-      'third_party/closure_library/closure/goog/style/style.js',
-      'third_party/closure_library/closure/goog/style/transform.js',
-      'third_party/closure_library/closure/goog/testing/watchers.js',
-      'third_party/closure_library/closure/goog/timer/timer.js',
-      'third_party/closure_library/closure/goog/ui/component.js',
-      'third_party/closure_library/closure/goog/ui/container.js',
-      'third_party/closure_library/closure/goog/ui/containerrenderer.js',
-      'third_party/closure_library/closure/goog/ui/control.js',
-      'third_party/closure_library/closure/goog/ui/controlcontent.js',
-      'third_party/closure_library/closure/goog/ui/controlrenderer.js',
-      'third_party/closure_library/closure/goog/ui/decorate.js',
-      'third_party/closure_library/closure/goog/ui/idgenerator.js',
-      'third_party/closure_library/closure/goog/ui/registry.js',
-      'third_party/closure_library/closure/goog/uri/utils.js',
-      'third_party/closure_library/closure/goog/useragent/product.js',
-      'third_party/closure_library/closure/goog/useragent/product_isversion.js',
-      'third_party/closure_library/closure/goog/useragent/useragent.js',
-      'third_party/closure_library/third_party/closure/goog/mochikit/async/deferred.js'
-    ]
-  }
-}
diff --git a/third_party/google_input_tools/update.py b/third_party/google_input_tools/update.py
index 8d6df8e..a9341ab 100755
--- a/third_party/google_input_tools/update.py
+++ b/third_party/google_input_tools/update.py
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-# Copyright 2014 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
 # found in the LICENSE file.
 
@@ -17,15 +17,6 @@
 require_regex = re.compile(_BASE_REGEX_STRING % 'require')
 provide_regex = re.compile(_BASE_REGEX_STRING % 'provide')
 
-preamble = [
-    '# Copyright 2014 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 is auto-generated using update.py.',
-    ''
-]
-
 # Entry-points required to build a virtual keyboard.
 namespaces = [
     'i18n.input.chrome.inputview.Controller',
@@ -235,16 +226,15 @@
 
 
 def generate_build_file(target_files):
-  """Updates inputview.gypi.
+  """Updates inputview.json.
 
   Args:
     target_files: List of files required to build inputview.js.
   """
 
   sorted_files = sorted(target_files)
-  with open('inputview.gypi', 'w') as file_handle:
-    file_handle.write(os.linesep.join(preamble))
-    json_data = {'variables': {'inputview_sources': sorted_files}}
+  with open('inputview.json', 'w') as file_handle:
+    json_data = {'inputview_sources': sorted_files}
     json_str = json.dumps(json_data, indent=2, separators=(',', ': '))
     file_handle.write(json_str.replace('\"', '\''))
 
@@ -290,8 +280,8 @@
 
   (options, _) = parser.parse_args()
 
-  input_path = get_google_input_tools_sandbox_from_options(options)
-  closure_library_path = get_closure_library_sandbox_from_options(options)
+  input_path = get_google_input_tools_sandbox_from_options(options)[0]
+  closure_library_path = get_closure_library_sandbox_from_options(options)[0]
 
   if not os.path.isdir(input_path):
     print 'Could not find google-input-tools sandbox.'
diff --git a/ui/keyboard/BUILD.gn b/ui/keyboard/BUILD.gn
index f478b0b..d8eca86 100644
--- a/ui/keyboard/BUILD.gn
+++ b/ui/keyboard/BUILD.gn
@@ -133,9 +133,6 @@
 build_closure("inputview") {
   sources = inputview_sources
   target = "$target_gen_dir/resources/inputview.js"
-  json_file = "//third_party/google_input_tools/inputview.gypi"
-  sources += [ json_file ]
-  json_sources = "variables.inputview_sources"
   path = rebase_path("//third_party/google_input_tools")
 }