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}
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}
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}
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}
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}
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}
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}
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}
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.
#1 and #2 mitigate any missed type coverage from #3, 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}
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}
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}
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}
- 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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}