Commit Graph
60 Commits
Author SHA1 Message Date
Jan Scheffler 21a7fac164 [JSDOC2TS]: Migrate node_main
Bug: chromium:1158760
Change-Id: I0b6d0c12f545e7df17290b76981261e93396b87d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2687504
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-10 20:58:13 +00:00
Peter Marshall 428508ab36 [l10n] Remove unused ModuleUIStrings files
As directories are migrated to the new -meta files, they no longer
need their ModuleUIStrings file.

Bug: 1136655
Change-Id: Iae983195fa24f6262d1d47d6093e82f4ce3df537
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2686658
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-10 16:37:51 +00:00
Tim van der Lippe 54780f2bca Remove platform/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: I036bc21f0ebf7f2e65c7d9a89281c1fbcb4a9033
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676156
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-05 13:39:48 +00:00
Tim van der Lippe 79e4d8531a Remove host/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: I3015c907604c739ee3d50a003f47faa6861215ea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676145
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-05 10:55:28 +00:00
Tim van der Lippe 5c423509db Remove i18n/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: I700e6d5fc8941ef54d4af10af01989ddf62165cc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676144
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-05 10:48:08 +00:00
Andres Olivares f138902e8f Change commandPrompt type to LocalizedString in ViewRegistration
Bug: 1169065, 1134103
Change-Id: If647a6f51309f87f3da8a895c96db463494554d3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2642909
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-25 18:00:55 +00:00
Andres Olivares f6862c1db1 [module.json extensions] node_main views
Bug: 1134103
Change-Id: I230dd3e12fbdb810793d72eabf8d23035c0aa5ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2638015
Commit-Queue: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-20 13:26:50 +00:00
vidorteg 3c56ca23d9 [Loc] Migrate node_main panel to Localization V2
- Migrate node_main to use Localization V2 APIs.
- Removed node_main grdps

Tested with en-XL.json
https://imgur.com/a/fky46TA

Bug: 1136655
Change-Id: I6fcb6328a8a053b084f094ac0c5b1f7e98449992
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2578185
Commit-Queue: Vidal Diazleal <vidorteg@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-12-10 00:10:57 +00:00
Jack Franklin 7cdd342471 [Dark Mode]: small CSS files
This CL updates CSS colors in five files:
* NodeConnectionsPanel
* TimelineOverviewPanel
* confirmDialog
* emptyWidget
* DOMlinkifier

These all had 1-2 colors to change so it felt OK to bundle them into
one.

Bug: 1152736
Change-Id: I5548fa1297589b775df45d8fbfbbab3d203cc69d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2575090
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-07 11:54:51 +00:00
Tim van der Lippe 7dcef88d8b Remove skip_compilation from module.json files
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I4c4fd280adb4f5f7b327239d08d80b2cb98b203b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560248
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-25 13:19:08 +00:00
Kalon Hinds 438d44197a [Loc] Migrate security to Localization V2
Bug: 1136655
Change-Id: I77e776f00249eb97f49e24681d19722f500c4c86
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2546327
Commit-Queue: Kalon Hinds <kahinds@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-11-19 01:34:11 +00:00
Tim van der Lippe 7b2c02c269 Use TypeScript-authored files in node_main/
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: Id76aed5f0635596b9f11b40586c54ff2c22251a5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2547287
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-18 17:51:02 +00:00
Tim van der Lippe 5d25d223b8 Typecheck node_main/NodeConnectionsPanel.js with TypeScript
R=andoli@chromium.org

Bug: 1011811
Change-Id: Iebf644822b2cbfd6ab8cb43ee214a70118fed019
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2529351
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2020-11-10 17:14:28 +00:00
Jack Franklin 71519f8efb Introduce enableLegacyPatching flag for CSS patching
As part of the dark mode migration we are adding
`enableLegacyPatching:true` to all call sites of `appendStyle` (and
related methods). If a user passes `false` for that flag, no CSS colour
patching will occur.

This CL is therefore a no-op from a user's perspective as we pass `true`
on every call to maintain existing behaviour, but once we start
migrating we will turn the option to `false`. Long term, once all code
is migrated and the old patching is removed, we will remove this flag
entirely once again.

Bug: 1122511
Change-Id: I76b818e83b7d5ee0175e1548759373f53481e0ab
No-Presubmit: True
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2516345
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-03 14:11:46 +00:00
Tim van der Lippe 3c7eedcd60 Remove all definitions of usesObjectNotation
This was a temporary method, used during the migration to use
objects in dispatcher callbacks. Since all dispatchers now receive
the event as an object, we can remove these temporary methods.

R=aerotwist@chromium.org

Fixed: 1138492
Bug: 1011811
Change-Id: Ib7fbfae567ebc9b2be0a5d760458e5b0c7edc12e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484723
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-20 10:59:51 +00:00
Tim van der Lippe 46e1bcace9 Remove pre_generates_legacy from module.json files
This was a temporary flag used during the build_release_applications
to GN migration.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: I8a772bcc4bee31dbd3270bf7ef62d8c97941024a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484716
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-19 16:12:09 +00:00
Tim van der Lippe ead1fa43d0 Move remaining legacy files to GN
R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ibb247dd02a5032604824517be4276c4b83c8fc8c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2479140
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-19 09:25:50 +00:00
Tim van der Lippe c166b7033f Typecheck node_main/NodeMain.js with TypeScript
R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I05f1c6356248ceebebf6da572db6bbe06cfd1652
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2475718
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-10-15 15:16:43 +00:00
Jesus David Garcia Gomez d24d3c2bc1 Add scroll to devtools for node connection screen.
This CL will fix a issue when the devtools for node is open and the
console is also open too high and the connection information is hidden.

This CL will add an scrollbar to show the users that there is more
content.

Before: https://i.imgur.com/MlRAyeA.gif
After: https://i.imgur.com/eABPcPM.gif

Bug: 1115655
Change-Id: I4e3507ada79bc38e5fe194c6aaea5cce2ca7252b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2351175
Reviewed-by: Tony Ross <tross@microsoft.com>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jesus David Garcia Gomez <jegarc@microsoft.com>
2020-10-08 16:51:57 +00:00
Tim van der Lippe cac65d4fa0 Remove skip_rollup
This was a temporary flag as part of the devtools_entrypoint migration.
Since that migration has concluded, we can now remove all references
to it and clean up `build_release_applications.py`.

R=jacktfranklin@chromium.org,aerotwist@chromium.org

Bug: 1101738
Change-Id: I3ef9ec1a99bc9fc1758532124db22b3b4b1a5e2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391140
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-08 15:44:09 +00:00
Tim van der Lippe 19a45dfd55 Remove is_legacy_javascript_entrypoint
This removes the now-obsolete is_legacy_javascript_entrypoint build flag,
which was used as part of the devtools_entrypoint migration.

This uncovered that accessibility was still using devtools_pre_built
and a file was missing from the GRD variable.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Fixed: 1101738
Change-Id: Ie1556ccc1d1563c855417de18e896308de0cfe19
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2356305
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-28 12:32:29 +00:00
Jan Scheffler fc2a4cb69b Migrate front_end/node_main to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I0fcd0d4a933fb41b3447b0bf3831d1937aebd539
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2329775
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-30 15:56:20 +00:00
Tim van der Lippe 37512b0d25 Remove empty script arrays from module.json files
If the module uses `modules` to load the JavaScript files, then
we can remove the `scripts` array altogether. Note that there
are still some modules left that use `scripts`, most notably
the `lighthouse_worker`, which is a remote module.

R=aerotwist@chromium.org

Bug: 1105476
Change-Id: Ie303e9835f5ce6d42ccae7b3a305d8f3df1af84c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302597
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-17 10:05:33 +00:00
Jan Scheffler 804bf423d4 Fix stylelint-config-standard issues in node_main/nodeConnectionsPanel.css
Bug: chromium:1083142
Change-Id: I116b43ea674f9461b70c8eb4e2b0f87066ee0325
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2282350
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-07-06 11:48:21 +00:00
Mathias Bynens b0c1f4bce2 Fix stylelint-config-standard violations
Bug: chromium:1083142
Change-Id: I5ea4cc5d0f83e52856383ba37a47472e33eb19a2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204113
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-05-15 17:05:27 +00:00
Tim van der Lippe f49e23286b Replace single class invocations of createElementWithClass
This applies the following replacement to the codebase:

(\S+) = createElementWithClass\('(\w+)', '([^'\s]+)'\);

to

$1 = document.createElement('$2');\n$1.classList.add('$3');

R=aerotwist@chromium.org

No-Presubmit: true
Bug: 1011811, 1077215
Change-Id: I0d76b39f1ed8cd4a44f18f94e398db934ba4b09c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176112
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-01 16:54:52 +00:00
Mathias Bynens 5e43b27e8b Reformat module.json files
This patch makes it so that all module.json files use the same
consistent indentation that matches .editorconfig and the rest
of the codebase. At the request of reviewers, one such file
(front_end/emulated_devices/module.json) has been excluded
from this patch. It will be reformatted in a separate CL.

Note that this patch does not “roll CodeMirror”, although a
pre-commit hook forces me to include that phrase in the commit
message because the module.json file in the relevant folder is
modified.

Bug: chromium:1070492
Change-Id: Ib31ed5232461e2f80bf05f31105fc919f6639b0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2127007
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-14 05:35:23 +00:00
Simon Zünd 182134236e Rename namespace import for protocol_client to ProtocolClient
R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Idf3e9eb8f6d52db78f563de53b7576ec6c9b9cdc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107557
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-19 12:08:52 +00:00
Simon Zünd 3b0c540211 Rename front_end/protocol to front_end/protocol_client
This CL is part of the work to switch over to the TypeScript compiler
for type checking.

R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Ic709a193b252df7e9027c00cf20d8afe525a215a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107539
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 18:06:20 +00:00
Paul Lewis daac106699 [global] Remaps self.SDK.targetManager
This CL changes references to self.SDK.targetManager (the global
instance of SDK.SDKModel.TargetManager) over to
SDK.SDKModel.TargetManager.instance(). To keep both TypeScript and
Closure happy we must make a method on the TargetManager class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I6ca35024c21cf24254fd6273138a1ab3e163ee00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2088092
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-05 14:58:03 +00:00
Tim van der Lippe c02a97ca2c Fix imports for Common.Event typedef
All references now use the fully qualified
"Common.EventTarget.EventTargetEvent". It renames it to
"EventTargetEvent" to prevent a name-clash with the native "Event" type.

Bug: 1006759
Change-Id: I13fcdfd613041da146d741a0d1f785bfc905a7a8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056481
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe 0fd93555a5 Migrate node_main/ to import cross-module
Bug: 1006759
Change-Id: Idd569811aefcfe1b7845175c9d6d2235b9abf701
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054559
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 16:11:10 +00:00
Paul Lewis 4ae5f4f5ce [Global] Update refs to SDK.targetManager
Bug: 1006759
Change-Id: I0686ef929b89e75c2ea8a731c593d955eca85935
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2015119
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 10:56:40 +00:00
Mike Jackson d0a5e77bf6 Fix NodeJS Logo URI reference
The NodeJS logo was point to a file that no longer exists. Updating to
point to the SVG logo instead.

Change-Id: I0b35d6d3a82aea062c1200821d6a0e6eb7ecb67e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2014285
Commit-Queue: Mike Jackson <mjackson@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-01-22 06:32:23 +00:00
Mike Jackson 71ec71182c Fix broken Node Connection Panel.
Loading the node connection panel is broken due to an unhandled javascript exception:

  Uncaught (in promise) TypeError: NodeMain.NodeConnectionsView is not a constructor
      at new NodeConnectionsPanel (NodeConnectionsPanel.js:1)
      at Runtime.sharedInstance (shell.js:75)
      at Extension._createInstance (shell.js:112)
      at async ProvidedView.widget (View.js:25)
      at async Promise.all (://devtools/bundled/index 1)

This is a regression likely caused by
  https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1950167

You can repro this by:

 - node --inspect
 - open about:inspect
 - click "Open dedicated DevTools for Node"
 - select Connection Panel.

It'll be blank. You should see a list of targets, and an "add connection" button.

Change-Id: Ifcc7dead303dcd45ef4445f82f17b6277a323181
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2014283
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Commit-Queue: Mike Jackson <mjackson@microsoft.com>
2020-01-22 06:12:23 +00:00
Paul Lewis 7483c1d8ab Migrates node_main/ to ESM internally
Bug: 1006759
Change-Id: Ifabc2e1087a5e9a7877d9fad1c6661474c177ef3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994972
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-13 15:39:05 +00:00
Paul Lewis 57b82d61dd Migrates node_main/ to esm
Bug: 1006759
Change-Id: I59f12ddf2a856ac9c40a8fc784a8ea4856d8be30
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1950167
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-07 15:27:28 +00:00
Mathias Bynens 9680e2e8b0 Drop -webkit-user-select in favor of user-select
Bug: chromium:1031475
Change-Id: Ibbf222135c97e79ae3be816216fec9675d643952
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1953613
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2019-12-06 10:31:53 +00:00
Tim van der Lippe 50cfa9b19d Migrate host/ to ESM
Bug: 1006759
Change-Id: Ib72e0acbb20c4579e708cd79a67ffd0bc2073b70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829102
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701509}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b2641f7a9893b50ab7f74d8bc5b7ca7743b0a530
2019-10-01 10:40:58 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Christy Chen 6b8db62302 DevTools: Add placeholders in grdp files to avoid translations
Wrap terms with placeholders in grdp file to avoid localizing some terms
that are:
1. Proprietary names (Brandings, devices names)
2. Code snippts

More documentation coming with CL
https://chromium-review.googlesource.com/c/chromium/src/+/1740079

Bug: 941561
Change-Id: I9b952519663a5378f789c1961b98caa577e67a20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825587
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Christy Chen <chrche@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#700752}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3c11e4aba88bc2403c94d4292160128a90414dbc
2019-09-27 16:50:05 +00:00
Tim van der Lippe 7b190160cd Move InspectorFrontendHostAPI to externs
This was an interface that was already treated as an extern, but was not
explicitly in the externs.js file.

Bug: 1006759
Change-Id: I95301c059cc1213931498788cff553f955abb646
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829098
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#700724}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c6c1bf57acb1c9ed7304674e7d5df51122cb22b1
2019-09-27 15:10:44 +00:00
Christy Chen fc8ed9f851 DevTools: Localize tags for command menu search to work properly
The tags in Module.json are not localized. This change localize them,
so when users type the word in command menu with languages other than
English, the results can show up correctly.

Two scripts edited (check_localized_strings.js, CommandMenu.js).
Grdp changes are generated automatically, with manually added descriptions.

Bug: 941561
Change-Id: I3dc1f8f8b72e21748f5fa84c1c60b9597aa0414a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809673
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#698223}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b75a4b07ffd26a61fef0344123701241bb75002c
2019-09-19 22:18:44 +00:00
Mandy Chen 50fd396d65 DevTools: Add auto-generated descriptions to all grdp files
In the previous patch (https://crrev.com/c/1678842) I added auto-generated
descriptions to changes_strings.grdp. In this patch, I'm adding the rest
of the descriptions. A follow-up patch will be made to add a presubmit
check that all grdp messages have descriptions.

Bug: 941561
Change-Id: I61e65143e7d5160ce1e880c58ec56afdf03819cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1688716
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#675723}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f2d042ca17f3b033b58df41adbeaeaaf0be427c1
2019-07-09 18:03:08 +00:00
Amanda Baker ca50282159 DevTools: Provide error message for Devices Settings Pane (ListWidget)
This change provides the infrastructure to give the user an error
message whenever they enter invalid input into one of the fields of the
ListWidget.Editor.

It also provides the specific error message for the Devices Settings
pane.

Screenshot of error message dialogue: https://imgur.com/a/wD4akTa

This work was originally part of https://chromium-review.googlesource.com/c/chromium/src/+/1562830


Bug: 963183
Change-Id: Ie984366f5f85880cacaaeaea69f5187c5313ac6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1629757
Commit-Queue: Amanda Baker <ambake@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#673884}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c346cec0ac5cf9dd2c32acdc44a16d241a9375dd
2019-07-02 00:01:28 +00:00
Mandy Chen b07d998d11 DevTools: Convert concatenated string and link to embedded link in string in the node connections pane
Use UI.formatLocalize to embed a link inside a localizable string.
This is a sequent patch to https://crrev.com/c/1658750

Bug: 941561
Change-Id: I1b265d7cf893da4dfa2fc7057bfc55650885c13c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660632
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#669382}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ab6a5999838cafae3c9a8764ed1482d3f09eda3e
2019-06-14 21:30:34 +00:00
Mandy Chen 785526337d DevTools: Add ''' in grdp files for leading and trailing whitespace
Currently the leading and trailing whitespace in grdp messages is trimmed
by the grit tool. I modified grdp message generation scripts to add '''
for these messages so the whitespace is preserved. Existing such messages
are fixed.

Bug: 941561

Change-Id: Ib11a6cac5fc7359958a29474c03c449a62e4116a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636630
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#668239}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: bcffd0543b389a4992eab60acaa4d652b6471e9f
2019-06-12 00:55:43 +00:00
Lorne Mitchell c56ff2d968 Reland of "DevTools: Added GRD/GRDP files for all localizable strings in the DevTools."
This is a reland of https://chromium-review.googlesource.com/c/chromium/src/+/1613921/, which was reverted (Bug=966547) because
third_party/blink/renderer/devtools/front_end/langpacks/devtools_ui_strings.grd was being picked up by Google's internal localization pipeline.

Bug=941561

Change-Id: I9a97e16e367716189d34944b76605c9321d47092
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627921
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#664013}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 613ca444d07326b6f087c083af79a636a858a7d9
2019-05-28 23:35:03 +00:00
Krishna Govind 897c867a07 Revert "DevTools: Added GRD/GRDP files for all localizable strings in the DevTools."
This reverts commit 2f05fdbf2ab3458b4b3a3f2a86f908a3a7d04f79.

Reason for revert: Breaks chrome translation, crbug 966547

Original change's description:
> DevTools: Added GRD/GRDP files for all localizable strings in the DevTools.
> 
> This change includes...
> * A main GRD file for the DevTools (front_end/langpacks/devtools_ui_strings.grd)
> * GRDP files organized by subfolder
> * A node script that keeps the GRD/GRDP files in sync with the keys in the DevTools frontend
> * A git cl presubmit --upload check that runs the node script
> 
> Note: Subsequent changes will add a build step to generate a .pak file that contains these DevTools strings. You can read about the overall approach here (https://bugs.chromium.org/p/chromium/issues/detail?id=941561).
> 
> 
> Details of this design:
> ======================
> We followed a similar pattern used by WebUI where strings are encoded in GRIT GRD/P files, which are used by a localization service to perform translations. They are also consumed in the build step to generate a .pak file, which is loaded by the browser's resource system.
> 
> Chromium documentation:
> * https://www.chromium.org/developers/tools-we-use-in-chromium/grit/grit-users-guide
> * https://www.chromium.org/developers/design-documents/ui-localization
> 
> Frontend strings:
> -----------------
> These are the localizable strings that are displayed to the user.
> 
> GRDP <message> strings:
> -----------------------
> Each frontend string has a corresponding <message> entry in a GRDP file. These entries are what the localization service will use to perform localizations. It's also the input to the GRIT compiler, which generates a .pak file, which is loaded by the browser's resource_bundle system.
> 
> GRDP <messsage> placeholders:
> ----------------------------
> Frontend strings use placeholders, which are used to substitute in values at runtime.
> For example,
> 'This string has %s two placeholder %.2f.'
> 
> Since the order of the string may change in a different language, we need to encode the order of the placeholders. As such, in the GRDP file you'll find %s replaced with $[1-9].
> 
> For example,
> 'This string has <ph name="ph1">$1s</ph> two placeholder <ph name="ph2">$2.2f</ph>.'
> 
> Also, note that the precision and type of the placeholder is maintained (i.e. .2f).
> 
> Detecting changes:
> -----------------
> The check_localizable_resources.js script performs the following check and generates an error if there are any changes that need to be made to a GRDP file.
> 
> 1. Parses the frontend strings and hashes them.
> 2. Reads the messages from the GRDP files and hashes them.
> 3. Uses a difference between these two sets to report which strings need to be added and/or removed from GRDP files.
> 
> Optionally, the user can specify --autofix and it will automatically update the appropriate GRDP files.
> 
> Presubmit check:
> ---------------
> Running git cl presubmit --upload will run the check_localizable_resources.js script with the --autofix argument.
> 
> If there are any changes, they reported to the user like this.
> 
> ** Presubmit ERRORS **
> Error: Found changes to localizable DevTools strings.
> DevTools localizable resources checker has updated the appropriate grdp file(s).
> Manually write a description for any new <message> entries.
> Use git status to see what has changed.
> 
> BUG=941561
> 
> Change-Id: I5ac1656a037a6aaffeb4f64b103c4daec28be39a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613921
> Reviewed-by: Joel Einbinder <einbinder@chromium.org>
> Reviewed-by: Alexei Filippov <alph@chromium.org>
> Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#662371}

TBR=alph@chromium.org,einbinder@chromium.org,exterkamp@chromium.org,jeffish@microsoft.com,lomitch@microsoft.com

Change-Id: Ic4ca7d000d10b2bc61b585198469ca30f051dc62
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 941561
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627943
Reviewed-by: Krishna Govind <govind@chromium.org>
Commit-Queue: Krishna Govind <govind@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#662798}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ceb872b6f6a02d707783563a225c77bb0c62170a
2019-05-23 20:33:45 +00:00
Lorne Mitchell 072e6f877f DevTools: Added GRD/GRDP files for all localizable strings in the DevTools.
This change includes...
* A main GRD file for the DevTools (front_end/langpacks/devtools_ui_strings.grd)
* GRDP files organized by subfolder
* A node script that keeps the GRD/GRDP files in sync with the keys in the DevTools frontend
* A git cl presubmit --upload check that runs the node script

Note: Subsequent changes will add a build step to generate a .pak file that contains these DevTools strings. You can read about the overall approach here (https://bugs.chromium.org/p/chromium/issues/detail?id=941561).


Details of this design:
======================
We followed a similar pattern used by WebUI where strings are encoded in GRIT GRD/P files, which are used by a localization service to perform translations. They are also consumed in the build step to generate a .pak file, which is loaded by the browser's resource system.

Chromium documentation:
* https://www.chromium.org/developers/tools-we-use-in-chromium/grit/grit-users-guide
* https://www.chromium.org/developers/design-documents/ui-localization

Frontend strings:
-----------------
These are the localizable strings that are displayed to the user.

GRDP <message> strings:
-----------------------
Each frontend string has a corresponding <message> entry in a GRDP file. These entries are what the localization service will use to perform localizations. It's also the input to the GRIT compiler, which generates a .pak file, which is loaded by the browser's resource_bundle system.

GRDP <messsage> placeholders:
----------------------------
Frontend strings use placeholders, which are used to substitute in values at runtime.
For example,
'This string has %s two placeholder %.2f.'

Since the order of the string may change in a different language, we need to encode the order of the placeholders. As such, in the GRDP file you'll find %s replaced with $[1-9].

For example,
'This string has <ph name="ph1">$1s</ph> two placeholder <ph name="ph2">$2.2f</ph>.'

Also, note that the precision and type of the placeholder is maintained (i.e. .2f).

Detecting changes:
-----------------
The check_localizable_resources.js script performs the following check and generates an error if there are any changes that need to be made to a GRDP file.

1. Parses the frontend strings and hashes them.
2. Reads the messages from the GRDP files and hashes them.
3. Uses a difference between these two sets to report which strings need to be added and/or removed from GRDP files.

Optionally, the user can specify --autofix and it will automatically update the appropriate GRDP files.

Presubmit check:
---------------
Running git cl presubmit --upload will run the check_localizable_resources.js script with the --autofix argument.

If there are any changes, they reported to the user like this.

** Presubmit ERRORS **
Error: Found changes to localizable DevTools strings.
DevTools localizable resources checker has updated the appropriate grdp file(s).
Manually write a description for any new <message> entries.
Use git status to see what has changed.

BUG=941561

Change-Id: I5ac1656a037a6aaffeb4f64b103c4daec28be39a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1613921
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#662371}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2f05fdbf2ab3458b4b3a3f2a86f908a3a7d04f79
2019-05-22 21:58:44 +00:00