DevTools: introduce devtools_paths.py to manage paths

The new devtools_paths.py detects whether the frontend code
is hosted in the Chromium repository, in an external repository during
standalone build, or in an external repository during integrated build.

R=aerotwist@chromium.org

Change-Id: I800ab63f985d203359e387f9c81df9270929b437
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1839791
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703014}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dd36b0f6b3fdbaa069facb239773596ae816febb
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 1ada106..5c3c6ae 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -25,7 +25,7 @@
 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""DevTools JSDoc validator presubmit script
+"""DevTools presubmit script
 
 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
 for more details about the presubmit API built into gcl.
@@ -50,7 +50,7 @@
     original_sys_path = sys.path
     try:
         sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts")]
-        import local_node
+        import devtools_paths
     finally:
         sys.path = original_sys_path
 
@@ -77,7 +77,7 @@
 
     # Use eslint to autofix the braces.
     # Also fix semicolon to avoid confusing clang-format.
-    eslint_process = popen([local_node.node_path(), local_node.eslint_path(), '--config', '.eslintrc.js', '--fix'] + affected_files)
+    eslint_process = popen([devtools_paths.node_path(), devtools_paths.eslint_path(), '--config', '.eslintrc.js', '--fix'] + affected_files)
     eslint_process.communicate()
 
     # Need to run clang-format again to align the braces
@@ -228,11 +228,11 @@
     original_sys_path = sys.path
     try:
         sys.path = sys.path + [input_api.os_path.join(input_api.PresubmitLocalPath(), "scripts")]
-        import local_node
+        import devtools_paths
     finally:
         sys.path = original_sys_path
 
-    node_path = local_node.node_path()
+    node_path = devtools_paths.node_path()
 
     if script_arguments is None:
         script_arguments = []