0
Commit Graph

572 Commits

Author SHA1 Message Date
f434905980 [AF] Remove local card migration from payment methods settings page
This is CL 2/X in removing Bulk Local Card Migration flows.

Bug: 377383176
Change-Id: I711ed9113577354c985a07d2d4ce68cb7c58d3d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6378379
Reviewed-by: Tim <tjudkins@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Olivia Saul <jsaul@google.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rainhard Findling <rainhard@chromium.org>
Reviewed-by: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1437241}
2025-03-24 18:06:14 -07:00
c934e43596 Handle AutofillAI opt-in change in custom handler
Motivation:
- AutofillAI opt-in is a boolean profile pref. However, we also want it
  to be keyed by GAIA id. This is to ensure that the following sequence
  of events works:
  * Profile is signed in with account 1. User opts into AutofillAI.
  * Profile is signed out and signed into account 2.
  * Profile should no longer be opted into AutofillAI.
  * Profile signs out of account 2 and back into account 1.
  * Profile should be opted into AutofillAI again.
- Effectively, this means using a dict pref (hashed GAIA id to bool)
  instead of the existing boolean pref.
- However, the CustomToggleButtonElement does not support that and we
  thus need to write our own pref writing.

This CL therefore introduces a fake pref that the
SettingsToggleButtonElement reads to/writes from and adds an
autofillPrivate API to communicate toggle changes to the native side.

The CL does not yet read/write GAIA-keyed prefs. This will come as a
follow-up CL.

Bug: 404485362
Change-Id: I66f42b4ef61c76572c58dc40429f5c28d31fb38d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6375245
Reviewed-by: Tim <tjudkins@chromium.org>
Commit-Queue: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Theo Cristea <theocristea@google.com>
Auto-Submit: Jan Keitel <jkeitel@google.com>
Cr-Commit-Position: refs/heads/main@{#1436261}
2025-03-21 13:36:22 -07:00
7bf662ea4a Extend Autofill Ai private API to support countries and dates
This information will be used by the Autofill Ai settings page to add
<select> elements for countries and dates.

Bug: 393318914
Change-Id: Ie5d81f56745170b5e2aec09a1d892f3a6fc31214
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6348919
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Theo Cristea <theocristea@google.com>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Cr-Commit-Position: refs/heads/main@{#1432333}
2025-03-13 13:35:47 -07:00
646c42c839 Separate GenerateCountryList into 2 functions, for profile and account
The aim of this CL is to not query `AddressDataManager` when the country
list is used only for profile storage.

The motivation behind this is that Autofill Ai will need to use the same
function to generate the country list for profile storage, and Autofill
Ai logic should be as decoupled as possible from regular Autofill logic.

Bug: 393318914
Change-Id: Ibc333b4a86a674f2c1917fc3447a14bfdc979a3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6347597
Commit-Queue: Theo Cristea <theocristea@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1432044}
2025-03-13 05:45:53 -07:00
4f7e454959 [Extensions] Clean up unused type definitions in developer_private.idl
There were a number of unused type definitions in developer_private.idl.
Clean them up and remove them from the TS definitions as well.

Bug: None
Change-Id: I17b2611a3cf77fa7bc2013048739a9196a9924ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6344254
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Tim <tjudkins@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Auto-Submit: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1431257}
2025-03-11 17:41:22 -07:00
2c06255463 Use only [Entity|Attribute][Instance|Type|TypeName] in settings code
Use only EntityInstance, EntityType(Name), AttributeInstance and
AttributeType(name) in Autofill AI code related to settings.

The settings code also sometimes used ambiguous names like "Entity" and
"Attribute".

The non-settings code already uses the conventions listed above. We
should have consistent and non-ambiguous naming across settings and
non-settings code.

We are aware that this change increases the name length of certain
variables and methods. But we decided as a team that we want to stick
with these conventions.

Bug: 393318914
Change-Id: I489f57d39274d1c7b58dc84db0b963aabb218b58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6329535
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Theo Cristea <theocristea@google.com>
Cr-Commit-Position: refs/heads/main@{#1430754}
2025-03-11 04:12:26 -07:00
9ce21b67dd Add OnEntityInstancesChanged event in autofill private API
This event observes `EntityDataManager::Observer` and is broadcasted
whenever an entity instance is added, edited, or deleted.

This event will be used in a follow-up CL to update the list of entity
instances available on the settings page.

Right now, if a user adds, edits, or deletes an entity instance via the
settings page, the entities are not updated live. The user has to
refresh the page.

The goal of this event is to make the live updates happen.

Bug: 393318914
Change-Id: I1887e93cf22eff013176e9bab70581b45e8571bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6329356
Commit-Queue: Theo Cristea <theocristea@google.com>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1429692}
2025-03-07 12:57:41 -08:00
1321d3763d Replace usage of is_chromeos_ash with is_chromeos in tools.
This is part of Lacros sunset. Since Lacros is gone, the two variables
mean the same thing.

Note that args for generated_script, deploy_lacros was removed in
crrev.com/c/5933926.

Bug: 373972275
Change-Id: I840e8b9d188fc4fb8fd5d4c66a1da5449c758dbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6320699
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Cr-Commit-Position: refs/heads/main@{#1428073}
2025-03-04 17:04:13 -08:00
b3aeed90ef Prevent restart of admin-installed extensions.
Multiple exploits use changing an extension setting value to force the
extension restart. This CL blocks the change to the setting value and
applies the new value after Chrome restarts. This new flow is limited
only to admin-installed extensions on ChromeOS devices.

This is a stopgap solution until a more holistic solution to this
problem is identified.

Bug: 380465766
Test: autotest c/b/extensions/delayed_setting_change_browsertest.cc c/test/data/webui/extensions/extensions_browsertest.cc
Test: autotest c/b/e/api/developer_private/extension_info_generator_unittest.cc c/b/e/extension_prefs_unittest.cc
Change-Id: Ic1f71c04f31d810ff071e8cde7e04c9e6643207c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6263692
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Auto-Submit: Giovanni Pezzino <giovax@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Commit-Queue: Giovanni Pezzino <giovax@google.com>
Cr-Commit-Position: refs/heads/main@{#1427397}
2025-03-03 14:31:47 -08:00
4632137087 Remove user annotations from WebUI
User annotations will be removed from the code base. They have been
replaced by Autofill's EntityDataManager.

Bug: 395040395
Change-Id: I5b7a195c28912246ffa537a6e9653a0e951e0ae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6308891
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1426485}
2025-02-28 11:48:49 -08:00
b5eaf40e74 [BNPL] Implement getPayOverTimeIssuerList functionality in autofillPrivate
This CL supports the below function:
GetPayOverTimeIssuerList(): Retrieves all linked BNPL issuers from
PaymentsDataManager and makes accessible to be displayed in the settings
page.

Design: go/autofill-bnpl

Bug: 356443046, b/395706873
Change-Id: I8631f37c661af7cefcd30843b25cdac48f1a7863
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6279629
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Tim <tjudkins@chromium.org>
Reviewed-by: Vinny Persky <vinnypersky@google.com>
Commit-Queue: Wilson Low <wilsonlow@google.com>
Cr-Commit-Position: refs/heads/main@{#1426204}
2025-02-28 02:36:08 -08:00
d2d0b08f69 Extend Autofill Private API to provide more info about entities
This CL adds 3 new methods to the API that will be used in
chrome://settings/autofillAi.

`getEntityInstanceByGuid` returns a complete entity instance by its
guid. This will be called when a user clicks on the "Edit entity
instance" button. Upon click, the entity instance will be retrieved by
its guid, so that the pre-existing values of its attributes are
populated in the form.

`getAllEntityTypes` provides a list of all possible entity types, along
with some strings for each entity. This will be called when the user
clicks on the "Add new entity instance" button. Upon click, a list of
all entity types will be shown, and the user has to choose one of them.

`getAllAttributeTypesForEntity` provides a list of all attributes an
entity can have. This will be called when the user adds or edits an
entity instance, in order to display all possible attributes that the
user can set.

Bug: 393318055
Change-Id: Iee3a268cd0cd5b5baaa303f5a8a28b8372e46f88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6244464
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Commit-Queue: Theo Cristea <theocristea@google.com>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1425600}
2025-02-26 23:41:45 -08:00
e2dcc59adf WebUI: Infer skipLibCheck=true in ts_library() when it is safe.
Specifically:
 1) Adding a new //tools/typescript/definitions:build_ts ts_library()
    target which uses `skipLibCheck=false` and type checks all
    definition files once.
 2) Making all other ts_library() targets (specifically the ones defined
    in build_webui() and webui_ts_library()) to depend on the new
    target.
 3) Modifying ts_library() to automatically add `skipLibCheck=true`
    when
    `skipLibCheck` is not specified anywhere in the inheritance chain
    AND
    no definition files outside of tools/typescript/definitions exist.
 4) Also fixed TsLibraryTest.testEnableSourceMaps which was erroneously
    passing due to a bug in _read_file() that was always reading from
    the same folder, ignoring its input parameter, resulting in
    comparing the expected file with itself. The actual file contains
    an absolute path embedded in the generated sourcemap and therefore
    the comparison needs to be relaxed to work across across machines.

 and  mitigate any missed type coverage from , such that any
TypeScript errors within tools/typescript/definitions/*.d.ts are still
caught during the build.

Essentially this change modifies the build such that some type
checking work that was done by the TS compiler N times (where N=number
of ts_library() targets) is only done once.

Combined with the follow-up related CL this improves TS build times by
~21.5% (43.8s -> 34.4s) on a local Linux build with
`use_remoteexec=false`. This CL alone accounts for the majority of
that improvement (~20% out of 21.5%).

Bug: 397737230
Change-Id: I14bc721e0e2a16ded0d71909d77a8e9b468f3519
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6292793
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1425476}
2025-02-26 16:50:57 -08:00
025cb0ce09 Add more interfaces for the autofill private's "Entity instance" API
This CL introduces the `EntityType` and `AttributeType` interfaces in
the autofill private API. These interfaces contain both the encoded type
name, and the type name as a human readable string.

The human readable strings will be used in the "Autofill with Ai"
section of chrome://settings, specifically in the add & edit dialogs.

The `EntityType` also contains 2 other properties: `addEntityString` and
`editEntityString`, which will also be used in the entity add & edit
dialogs.

These 2 interfaces will also be used by 2 other methods added in an
immediate follow-up CL: crrev.com/c/6244464.

This CL also introduces the `EntityInstanceWithLabels` interface, which
contains the bare minimum information needed to display an entity
instance.
The settings UI page can display dozens of entities, so the attributes
should only be fetched when a user is editing an entity.
This CL integrates the `EntityInstanceWithLabels` interface into the
current settings UI.

Bug: 393318055
Change-Id: I011a9f0fb470ad02512e901585c874ffe8711405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6276067
Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org>
Commit-Queue: Theo Cristea <theocristea@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Cr-Commit-Position: refs/heads/main@{#1425378}
2025-02-26 13:26:04 -08:00
c7a7248d3c WebUI: Validate all parent tsconfig files in ts_library().
Previously only the last tsconfig file in the inheritance chain would be
validated (usually specified with `tsconfig_base=` or automatically
inferred when not specified). Any parent files referenced via "extends:
..." would not be validated.

This is in preparation of walking the tsconfig inheritance chain to
automatically deduce when to use `skipLibCheck=true` to improve overall
TypeScript build time performance.

Bug: 397737230
Change-Id: I0ccd5fe3758fe915e437d8bc443fcb85a85c0159
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6300796
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424909}
2025-02-25 17:46:56 -08:00
8e4694b90c WebUI: Move "/strings.m.js" path mapping outside of ts_library().
ts_library() should be WebUI-agnostic as much as possible and
WebUI-specific concepts should be dealt with in higher WebUI-aware
layers like build_webui(), build_webui_tests() or webui_ts_library().

Bug: 397737230
Change-Id: I970fd62886bac82685bc36e618c4fdc5f7d5a5e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6289211
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424245}
2025-02-24 17:13:55 -08:00
d9cd22f735 Implement the autofill private API functions for Autofill with AI
These functions can be used to add, update, remove, and load entities.

This API is meant to eventually replace the User Annotations API, which
was used so far by "Autofill with AI" in settings, and which is now
deprecated.

Change-Id: Ibee8952acbfa0e8a75bf0de5755844c62fef91dd
Bug: 393318055
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6214214
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Reviewed-by: Bruno Braga <brunobraga@google.com>
Commit-Queue: Theo Cristea <theocristea@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423361}
2025-02-21 12:50:39 -08:00
86cb3ddf99 WebUI: Prep for removing useDefineForClassFields dependency.
- Add a new 389737066_migration_lit.js jscodeshift codemod that
   automatically updates Lit code as needed.
 - Update validate_tsconfig.py to restrict valid values for allowed
   flags.
 - Add tsconfig_base_lit_389737066.json and
   tsconfig_base_polymer_389737066.json configurations for Lit and
   Polymer respectively.

In this CL simply adding all the necessary pieces for subsequent CLs
to actually update Lit/Polymer code as needed.

Bug: 389737066
Change-Id: I52120556df27c95d21acff83f95e1afcdf92d2b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6266790
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422306}
2025-02-19 18:15:53 -08:00
ff2b2c0a11 Remove obsolete chromeosInfoPrivate.isRunningOnLacros
Lacros is gone, this function is not used anymore.

Bug: b:354842935
AX-Relnotes: n/a.
Change-Id: Idcae62bfb8e2922c63d5c74f5e9e0e3c66258ac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6255537
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: John Lee <johntlee@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420317}
2025-02-13 22:01:11 -08:00
a6e998da2b Remove bootstrapping for AutofillAi
The current iteration of AutofillAi only contains data that is not
already contained in "classic" Autofill sources. Therefore
bootstrapping no longer makes sense.

Bug: 395555410
Change-Id: I05368bbc273766426e265c202a922137ba5cb775
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6252831
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Justin Lulejian <jlulejian@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1419712}
2025-02-12 22:47:37 -08:00
f1f8b44081 [Extensions] Create ExtensionInfo for user scripts per extension toggle.
This creates the browser-side ExtensionPref storage and developer API
extension configuration update for a (follow-up) UI toggle.

It models incognitoAccess, but it is different in that it's concept of
"enabled" is defined differently. "enabled" means the toggle shows in
the UI and it is true if the extension has been granted the userScripts
extension permission (and the feature is enabled).

Note: all the typescript changes are necessary in order to keep some
webUI tests from failing due to undefined `userScriptsAccess`.

Bug: 390138269
Change-Id: I977d475d8410e80f56f5a96866de08c8ca9bccee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6188159
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Auto-Submit: Justin Lulejian <jlulejian@chromium.org>
Commit-Queue: Kelvin Jiang <kelvinjiang@chromium.org>
Reviewed-by: Kelvin Jiang <kelvinjiang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1416099}
2025-02-05 04:04:19 -08:00
4e5f4e1c9d Include account and local headings in Bookmarks Manager
* If the user has both a syncing and non-syncing bookmarks bar,
introduce heading nodes below the root
* Otherwise display the tree as-is

Bug: 354893306
Change-Id: I5b95c4c184665b7134fc9b09a5b3658108c205f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6121696
Reviewed-by: Monica Basta <msalama@chromium.org>
Commit-Queue: James Lee <ljjlee@google.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414809}
2025-02-03 02:03:20 -08:00
d6de4ac244 Print Preview: Fork tests for ChromeOS and Desktop
Followup to initial fork of the code by forking the tests. This CL
copies without modification all files in
chrome/test/data/webui/print_preview to
chrome/test/data/webui/chromeos/print_preview, with the following
exceptions:
(1) updating BUILD.gn file to apply on the appropriate path mappings
    per platform (eliminating if_chromeos logic in BUILD.gn)
(2) updating *.cc files to pass the correct path for the ChromeOS
    tests (i.e. path is now "chromeos/print_preview/file_name.js" not
    "print_preview/file_name.js")
(3) adding OWNERS files for both sides of the fork.

This CL does not
(1) Clean up <if expr> differentiating CrOS and non-CrOS codepaths
    from either side of the fork
(2) Clean up #if BUILDFLAG() in the *.cc files
(3) Remove platform-specific files from either side of the fork
These are cleanup tasks to be performed after the initial fork by
teams as resources and priorities allow.

Bug: 393260699
Change-Id: Ief201026361ecadfa843cf18e54cc2f6a8f59110
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6220245
Reviewed-by: Gavin Williams <gavinwill@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414379}
2025-01-31 13:36:16 -08:00
3285a16502 Print Preview: Fork for CrOS to c/b/resources/ash/print_preview
This CL copies the Print Preview TS/HTML/CSS codebase to
chrome/browser/resources/ash/print_preview. This new copy of the code
is included only on ChromeOS, and chrome/browser/resources/print_preview
is included on other Desktop platforms.

To facilitate review and performing the fork quickly, this CL
intentionally does NOT:
(1) Fork Print Preview tests (expected to be done in a fast follow)
(2) Clean up <if expr> differentiating CrOS and non-CrOS codepaths
(3) Remove platform-specific files from either side of the fork
(4) Migrate the CrOS version to use Ash cr_elements

(2) - (4) are cleanup tasks to be performed after the initial fork
by teams that have an interest in improving their side of the fork.

This is a clean fork, adding additional tests for one side is
not in scope. Code coverage is identical before and after this CL.

Bug: 393260699
Low-Coverage-Reason: LARGE_SCALE_REFACTOR
Change-Id: I7cb3e7f3f0b3c33e97e6c01a9bc76a27ce5dec6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6216343
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414317}
2025-01-31 12:08:24 -08:00
2d45d47e92 [passwords] Remove isAccountStoreDefault() typescript binding
Unblocked by crrev.com/c/5965281. Replace with
isAccountStorageEnabled().

Fixed: 369341336
Change-Id: I1b57675d47288b7e32786ac8ce35d7a97312e5cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5965139
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: Kelvin Jiang <kelvinjiang@chromium.org>
Reviewed-by: Tim <tjudkins@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/main@{#1412610}
2025-01-28 15:49:49 -08:00
2a05f5c7d3 WebUI: Leverage build_webui() in chrome://password-manager-internals.
This is a prerequisite for migrating chrome://password-manager-internals
to TypeScript.

Bug: 40150605
Change-Id: Ie58aff8be5dceaef691a3874e725492bfa7f12dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6195892
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Teresa Mao <temao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411959}
2025-01-27 15:58:57 -08:00
e39e20fe4e Refer to //ui/webui/COMMON_METADATA from other DIR_METADATA files.
Bug: None
Change-Id: I310e84d84e671210ec171bc54b22f72a57ba26ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6196851
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1411934}
2025-01-27 15:13:08 -08:00
1a80b5b1db WebUI: Migrate components/management to TypeScript.
Bug: None
Change-Id: I489c1b5f63aa759d76d88cef86c11949f5e08330
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6181406
Commit-Queue: Teresa Mao <temao@chromium.org>
Reviewed-by: Tina Wang <tinazwang@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1410025}
2025-01-22 16:13:24 -08:00
6e632b06f9 Reland "Disallow changing accelerators for system-managed commands in web UI"
This is a reland of commit b335e4cce4

The GlobalAcceleratorListener is not initialized on linux-wayland-rel
because the Ozone Wayland backend doesn't provide a
GlobalAcceleratorListener and the GlobalShortcutsPortal feature flag
is not yet enabled. Because of this a null check is necessary.

Original change's description:
> Disallow changing accelerators for system-managed commands in web UI
>
> Some platforms manage shortcuts in their system settings (eg.
> when using GlobalAcceleratorListenerLinux), so adjusting the shortcut
> in the web UI has no effect. This change disables the edit button
> and sets the shortcut text to "Set in system settings" to make this
> clear.
>
> Bug: 40759171
> Change-Id: Iaa3d17a40d9eaa94b251923f4a329874585ce455
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6151358
> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1406518}

Bug: 40759171
Change-Id: I3da80a3afd122987f68ca5bb6c827722da4233d4
Cq-Include-Trybots: luci.chromium.try:linux-wayland-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6177188
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1409929}
2025-01-22 13:21:42 -08:00
8a8eb0a946 WebUI: Apply validateJavaScriptAllowed CrOS-only exceptions on CrOS.
These were previously applied on all builds unnecessarily.

Bug: None
Change-Id: I354d4226c3399cc0a640c0ebb752a700304853de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6188747
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1409701}
2025-01-22 08:48:01 -08:00
f6d66f728a Split AutofillPrivateRemoveEntryFunction
The function is currently responsible for deleting either an address,
credit card or IBAN from settings. This has has caused bugs like
crrev.com/c/6182191 in the past.

This function splits it into AutofillPrivateRemoveAddressFunction and
AutofillPrivateRemovePaymentsEntityFunction.

The enum entry used to track usage metrics is deprecated and two new
enum values are added.

Bug: 40100455
Change-Id: I2162ea4d237f3d71ed2839fd58539c2e585a3cef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6181901
Commit-Queue: Florian Leimgruber <fleimgruber@google.com>
Reviewed-by: Tim <tjudkins@chromium.org>
Reviewed-by: Kelvin Jiang <kelvinjiang@chromium.org>
Reviewed-by: Jan Keitel <jkeitel@google.com>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1409532}
2025-01-22 01:24:04 -08:00
0cd0f7b6e8 WebUI: Declare ts_library() deps corresponding tsconfigs as GN inputs.
This improves error messaging when a non ts_library() target is added as
a dependency of a ts_library() target, by throwing a GN error early,
instead of throwing a script error from within
tools/typescript/ts_library.py or build/config/siso/typescript_all.star
later.

Bug: None
Change-Id: Ib0fad017ae32ecdc05ad58b0f0b77ba2be0e717f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6182160
Reviewed-by: Sean Kau <skau@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1409188}
2025-01-21 11:31:25 -08:00
7749fb4600 Remove validatePhoneNumbers() from autofill_private.d.ts
crrev.com/c/4675723 removed the implementation, but not the declaration
in the ts file.

Bug: 40100455
Change-Id: I2fa00b1b769a4cafee3137da44efe087db3d5ae1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6182126
Commit-Queue: Florian Leimgruber <fleimgruber@google.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1408912}
2025-01-21 01:48:59 -08:00
50b293f888 CrOS WebUI: Leverage build_webui() in chrome://crostini-upgrader
This is in preparation of migrating from old "lite" Mojo bindings to TS
Mojo bindings, as well as paves the way for migrating to TypeScript.

Bug: 40169715
Change-Id: If634de5831737a853f33e727079600bb3da30fa2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6176499
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407044}
2025-01-15 16:58:13 -08:00
9a80393ca7 [lensoverlay] Intercept PDF navigations and update current viewport.
This change adds a new event to the `pdfViewerPrivate` extension API
that listens for URL updates from the browser. If the URL contains a
fragment with parsable PDF viewport parameters, then the PDF viewer will
update the viewport accordingly.

The PDF navigations are intercepted when coming from the Lens side panel
if they match the current URL loaded in the live page and the PDF
document helper exists for one of the RenderFrameHosts in the
WebContents.

Change-Id: I8cc3742670278371f298e5c79822bb362883ced7
Bug: b:383575917, 390023108
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6160067
Reviewed-by: Duncan Mercer <mercerd@google.com>
Reviewed-by: John Lee <johntlee@chromium.org>
Commit-Queue: Juan Mojica <juanmojica@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Kelvin Jiang <kelvinjiang@chromium.org>
Reviewed-by: Tim <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406765}
2025-01-15 09:02:56 -08:00
d81e87278f CrOS WebUI: Leverage build_webui() in chrome://crostini-installer
This is in preparation of migrating from old "lite" Mojo bindings to TS
Mojo bindings, as well as paves the way for migrating to TypeScript.

Bug: 40169715
Change-Id: I2ce2fded2530812372376f180d4a0072cdb6bee9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6171322
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406570}
2025-01-15 00:42:25 -08:00
2e833892fe Revert "Disallow changing accelerators for system-managed commands in web UI"
This reverts commit b335e4cce4.

Reason for revert: Suspected to be the culprit of test failures: https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20Tests%20(Wayland)/70201/overview

Original change's description:
> Disallow changing accelerators for system-managed commands in web UI
>
> Some platforms manage shortcuts in their system settings (eg.
> when using GlobalAcceleratorListenerLinux), so adjusting the shortcut
> in the web UI has no effect. This change disables the edit button
> and sets the shortcut text to "Set in system settings" to make this
> clear.
>
> Bug: 40759171
> Change-Id: Iaa3d17a40d9eaa94b251923f4a329874585ce455
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6151358
> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
> Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
> Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1406518}

Bug: 40759171
Change-Id: Iad95132397574fb6368a0369f705f0518cb910b4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6171642
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Takumi Fujimoto <takumif@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Takumi Fujimoto <takumif@chromium.org>
Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406535}
2025-01-14 22:58:13 -08:00
b335e4cce4 Disallow changing accelerators for system-managed commands in web UI
Some platforms manage shortcuts in their system settings (eg.
when using GlobalAcceleratorListenerLinux), so adjusting the shortcut
in the web UI has no effect. This change disables the edit button
and sets the shortcut text to "Set in system settings" to make this
clear.

Bug: 40759171
Change-Id: Iaa3d17a40d9eaa94b251923f4a329874585ce455
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6151358
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406518}
2025-01-14 21:24:22 -08:00
66d4c74be2 WebUI: Leverage build_webui() in components/management.
This is a prerequisite for migrating components/management/ to TypeScript.

Bug: 40150605
Change-Id: I24dfc3eed4f1485bac13ae86580f7bd86dfa4c49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6155836
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Teresa Mao <temao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1406396}
2025-01-14 15:07:54 -08:00
e82f63ecbd [WebUI] Move shortcut input from extensions to cr_components
Currently the shortcut input element is in the extensions subfolder.
This CL moves the shortcut input element to be under cr_componets so
that it can be used in places other than extensions.

Fixed: 378143781
Change-Id: I6197e9258dcc90dec12191d03cc12320173e944e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6161296
Commit-Queue: Steven Luong <stluong@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1405819}
2025-01-13 16:41:20 -08:00
07033a10b1 WebUI: Remove several obsolete validateJavaScriptAllowed exceptions.
These are obsolete since these folders have been migrated to TypeScript.

Bug: b/315002705,b/245336251,b/274059668
Change-Id: Ife052183a5a8e3b1e2b225933d8152758fc4c350
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6166216
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404979}
2025-01-10 13:15:19 -08:00
dd60458751 WebUI: Leverage build_webui() in chrome://translate-internals
This is in preparation of removing a JS minification step happening
within Grit on Android builds, as Grit should not be responsible for
performing minification.

It also paves the way for migrating to TypeScript in a follow-up CL.

Bug: 340278433,40150605
Change-Id: I4b22bdea7a57de8fbe21dd6957040894f65196ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6161637
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404684}
2025-01-10 02:42:10 -08:00
f0b0065911 WebUI: Leverage build_webui() in chrome://safe-browsing
This is in preparation of removing a JS minification step happening
within Grit on Android builds, as Grit should not be responsible for
performing minification.

It also paves the way for migrating to TypeScript in a follow-up CL.

Bug: 340278433,40150605
Change-Id: Ic15feddfefce7cb6a21eb3610cd553d4d1a95ffd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6162602
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1404627}
2025-01-09 23:50:50 -08:00
f5783dcf49 Migrate chrome://gcm-internals to TypeScript.
Bug: None
Change-Id: I643e0e008302952be312eab34d8247f624f63729
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6146645
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403452}
2025-01-08 01:14:52 -08:00
f41bf79405 WebUI: Leverage build_webui() in chrome://gcm-internals.
This is in preparation of removing a JS minification step happening
within Grit on Android builds, as Grit should not be responsible for
performing minification.

It also paves the way for migrating to TypeScript in the follow-up CL.

Bug: 340278433,40150605
Change-Id: I53c63735a53398654a6959905ea3dc78b1240eef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6147766
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Jian Li <jianli@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Jian Li <jianli@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1403443}
2025-01-08 00:37:47 -08:00
00bc9a723d WebUI: Leverage build_webui() in chrome://net-internals.
This is in preparation of removing a JS minification step happening
within Grit on Android builds, as Grit should not be responsible for
performing minification.

Bug: 340278433
Change-Id: I08be4fc9d5163215cb39c7a1891de19fe54d21ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6147527
Reviewed-by: Teresa Mao <temao@chromium.org>
Commit-Queue: Teresa Mao <temao@chromium.org>
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403070}
2025-01-07 09:54:52 -08:00
c7121975ff WebUI: Leverage build_webui() in chrome://net-export
This is in preparation of removing a JS minification step happening
within Grit on Android builds, as Grit should not be responsible for
performing minification.

It also paves the way for migrating to TypeScript in the follow-up CL.

Bug: 340278433,40150605
Change-Id: I6fcc18f05d26029350e920c6fe8d760c52f123ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6148930
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: mmenke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1403052}
2025-01-07 09:43:23 -08:00
7519382161 WebUI: Leverage build_webui() in chrome://webrtc-internals.
This is in preparation of removing a JS minification step happening
within Grit on Android builds, as Grit should not be responsible for
performing minification.

Bug: 340278433
Change-Id: I5f6a1df8b24a34be3b806c137419546b7c628d1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6147566
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1402576}
2025-01-06 12:10:02 -08:00
caede6efad ChromeOS JS->TS bindings: Migrate demo_mode_app_ui to TS webui bindings
Since this page has only 2 small files, also migrating source code to
TS to retain typechecking.

Bug: 384098175
Change-Id: I50b697028ae3090cf2baf121b237dd3e5a9b278e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6124209
Reviewed-by: Xiqi Ruan <xiqiruan@chromium.org>
Reviewed-by: Fred Shih <ffred@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Li Lin <llin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401918}
2025-01-03 12:01:02 -08:00
9254b5ae92 [CodeHealth] Update inspect WebUI to use build_webui
Roll out build_webui() to the inspect WebUI. Move
chrome/browser/ui/webui/inspect_ui.{cc,h} to their own directory to
match convention.

This is a prerequisite for migrating the folder to TypeScript.

Low-Coverage-Reason: OTHER Low test coverage in the file was
pre-existing. This CL updates the file name and follows a documented
process for updating to build_webui.

Bug: 40150605, 385341235
Change-Id: I6f6e34f83352881c9168c51afd684d3eb01d9b1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6107357
Reviewed-by: David Pennington <dpenning@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401515}
2025-01-02 11:03:31 -08:00