0
Commit Graph

747 Commits

Author SHA1 Message Date
7b09c54dd5 ui: remove SelectFileDialog impl params
This change removes params from all the implementations of
SelectFileDialog::SelectFileImpl. The next and final CL in this chain
will remove the parameter from SelectFileDialog::SelectFile() at every
call site.

Bug: 340178601
Change-Id: I1f76776330113601a9d50d1f946f58223f5b2e35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5709097
Commit-Queue: Elly FJ <ellyjones@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1328917}
2024-07-17 16:23:21 +00:00
0b8b562243 ui: remove params variants of SelectFile listener functions
This change:
* Removes all remaining overrides of the params variants of
  SelectFileDialog::Listener functions (none of which used the params)
* Removes all calls to the variants of SelectFileDialog::Listener
  functions that accept a params pointer
* Removes some parameters and class members that were used to plumb the
  params field through

A subsequent change will remove the parameter from SelectFileImpl()
itself, but that would entail touching dozens more files than this CL.

Bug: 340178601
Change-Id: Idcba88a1efe1f4df44b5dca3a367024e4a093a60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5691321
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Elly FJ <ellyjones@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1327734}
2024-07-15 19:53:53 +00:00
9bc03e7ac6 Move blink/public/common/browser_interface_broker_proxy.h to platform/
This CL moves
`third_party/blink/public/common/browser_interface_broker_proxy.h`
to
`third_party/blink/public/platform/browser_interface_broker_proxy.h`

Motivation:

* This header is not included from any browser-process code and
  therefore doesn't need to be in `.../common/...`.
* This resolves layering ickiness introduced by the previous CL (see
  https://crrev.com/c/5647559) which moved implementation of this type
  deeper into Blink (e.g. using `CrossVariantMojoRemote` and similar
  utilities which are normally available to the `platform` code but not
  to the `common` code).

This CL has been generated semi-automatically - most of the files
changed by this CL have just been updated to use the new `#include` path
(as generated by `tools/git/mass-rename.sh`).  Manual changes are
concentrated in the following files:

* Moving
  `third_party/blink/public/common/browser_interface_broker_proxy.h`
  to
  `third_party/blink/public/platform/browser_interface_broker_proxy.h`
    - This also removed a `nogncheck` ickiness left by the previous CL
    - This had to switch from `BLINK_COMMON_EXPORT` to
      `BLINK_PLATFORM_EXPORT`
* Removing layering ickiness in `third_party/blink/public/common/DEPS`
* `DEPS` update and/or simplification in:
    - `chromecast/media/DEPS`
    - `components/page_image_annotation/content/renderer/DEPS`
    - `components/translate/content/renderer/DEPS`
    - `media/mojo/clients/DEPS`
* Changing a dependency in `media/fuchsia/video/BUILD.gn` and
  `chromecast/media/audio/BUILD.gn`
* Adjusting which target builds the moved files:
    - `third_party/blink/common/BUILD.gn`
    - `third_party/blink/public/BUILD.gn`
* Deleting `third_party/blink/common/browser_interface_broker_proxy.cc`
    - This also involves tweaking
      `third_party/blink/public/common/BUILD.gn`
    - Parts of that `.cc` file have been preserved in
      `.../platform/mojo/browser_interface_broker_proxy_impl.cc`
      (e.g. `EmptyBrowserInterfaceBrokerProxy` and default definitions
      of `BrowserInterfaceBrokerProxy`'s constructor and destructor)

Bug: 41482945
Change-Id: I6048c855279c438b7dbfc8467b859df70e2d2012
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5651622
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1327283}
2024-07-14 20:25:02 +00:00
39c819171a Portals: Remove remaining mentions in content/
Removes mentions of portals in code comments.

Bug: 40287334
Change-Id: Ia3d55f376bdbb532a3a59a8853f2fcc5a4023c1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5679217
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1326368}
2024-07-11 20:44:21 +00:00
ca0aec69cc [Android EMEA sheriff] Revert "[Permission] Remove SubscribeToPermissionStatusChange from PermissionManager"
This reverts commit c129a1b9ae.

Reason for revert: breaks `NFCHostTest.GetNFCTwice` content unittest on https://ci.chromium.org/ui/p/chrome/builders/ci/android-arm64-tests

Original change's description:
> [Permission] Remove SubscribeToPermissionStatusChange from PermissionManager
>
> This CL:
> * creates a separate file for Subscription enum
> * Removed duplicating `SubscribeToPermissionStatusChange` from PermissionManager
> * Move related unittests into new test file `chrome/browser/permissions/permission_subscription_unittest.cc`
>
> Bug: 40238954
> Change-Id: Ic1e106880a0ee2b12384d151e95de9ded783c72b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5498921
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Reviewed-by: Peter Beverloo <peter@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Commit-Queue: Yifan Luo <lyf@chromium.org>
> Reviewed-by: Sean Topping <seantopping@chromium.org>
> Reviewed-by: Elias Klim <elklm@chromium.org>
> Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1325782}

Bug: 40238954
Change-Id: Ib1e0d21baa33075f5d0f93b127692824bd707378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5690963
Owners-Override: Igor Kraskevich <kraskevich@google.com>
Auto-Submit: Igor Kraskevich <kraskevich@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Igor Kraskevich <kraskevich@google.com>
Cr-Commit-Position: refs/heads/main@{#1326078}
2024-07-11 12:40:06 +00:00
c129a1b9ae [Permission] Remove SubscribeToPermissionStatusChange from PermissionManager
This CL:
* creates a separate file for Subscription enum
* Removed duplicating `SubscribeToPermissionStatusChange` from PermissionManager
* Move related unittests into new test file `chrome/browser/permissions/permission_subscription_unittest.cc`

Bug: 40238954
Change-Id: Ic1e106880a0ee2b12384d151e95de9ded783c72b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5498921
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Yifan Luo <lyf@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Elias Klim <elklm@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325782}
2024-07-10 22:16:25 +00:00
802b9ead3a Extensions: WAR: manifest.json's use_dynamic_url requires a dynamic url
If `use_dynamic_url` is set to true in manifest.json, then the
associated web accessible resource(s) can only be loaded using the
dynamic url. Loading with the static url containing the extension id
won't work.

Doc:
https://docs.google.com/document/d/1nBSPaqbkr9O2X8F1EEZSh9_LT7IcYx-WnwkzmpxyN2I

Bug: chromium:40245983
Change-Id: I2a6782e327ceb4c02f76e081ef55f560b4f2771a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5636785
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Solomon Kinard <solomonkinard@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1325435}
2024-07-10 13:06:36 +00:00
cff763aa02 Refactor FakeBluetooth implementation to outside bluetooth/test
As a precursor to introducing FakeBluetooth CDP API support
(crrev.com/c/5559106), this CL refactors the core of FakeBluetooth
implementation to outside bluetooth/test and into a separate
bluetooth/emulation to allow wider usage.
* Move essential fake_bluetooth functionality into bluetooth/emulation/
* Rename bluetooth/../mojom/test to bluetooth/../mojom/emulation

Bug: 342191615
Change-Id: If5e2340e07dde07bc644e3e496ff584736067b0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5673025
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Alex N. Jose <alexnj@chromium.org>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1324602}
2024-07-09 00:57:40 +00:00
31c2bf1b6e Don't download pdf for forward/back navigations if pdf viewer is enabled
For forward/back navigations, chrome should load the native page, which
will issue a download request, instead of loading a URL that leads to a
pdf download directly.
This CL cancels the download if a forward/back navigation results in a
pdf download.

Low-Coverage-Reason: TRIVIAL_CHANGE
Bug: 349917621
Change-Id: I01555ff83f763311f98ff32719bea0221650c440
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665956
Reviewed-by: Shu Yang <shuyng@google.com>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321311}
2024-06-29 05:25:00 +00:00
21b9284871 content::RenderFrame::GetBrowserInterfaceBroker: return a const-ref.
This CL changes the signature of the `GetBrowserInterfaceBroker` method
from:

`blink::BrowserInterfaceBrokerProxy* GetBrowserInterfaceBroker()`

to:

`const blink::BrowserInterfaceBrokerProxy& GetBrowserInterfaceBroker()`.

Motivation:

* The old implementation never returns null - this is communicated
  in the new API by returning a reference instead of a pointer.
* Users of the old API never call `Bind` or `Reset` - this is
  communicated/enforced in the new API by returning a **`const`**
  reference (`Bind` and `Reset` methods of `BrowserInterfaceBrokerProxy`
  are non-`const`).

Bug: 41482945
AX-Relnotes: n/a.
Change-Id: Ifec4c1eb0ee556f9e10a6da2e0f90f4c39bd2647
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5651361
Owners-Override: Alexander Timin <altimin@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1319846}
2024-06-26 17:02:51 +00:00
036a35c934 Apply consistent naming conventions to "zoom" values
Previously, "page zoom" was overloaded to refer to (1) the browser zoom
user setting and (2) the actual multiplier used in rendering arithmetic.
The first value uses a log scale and doesn't include hardware device
pixel ratio; the second value is a straight multiplier and *does*
include device pixel ratio. Some parts of the code distinguished between
these two values by referring to "(page) zoom level" for the first
value and "(page) zoom factor" for the second.

A subsequent change will add a third variable to the mix: the CSS "zoom"
property, which for the first time will affect the rendering of an
<iframe>'s content document. Browser zoom and inherited CSS zoom will
combine to produce a single "zoom level" value using the log scale;
"zoom level" will be de-log-ified and multiplied by device pixel ratio
to give a "zoom factor" used for rendering. Importantly, "zoom level"
and "zoom factor" are no longer page-level concepts; the new behavior
of CSS zoom means that two frames in the same page may have different
zoom levels and different zoom factors.

This CL attempts to bring consistent naming conventions to all
zoom-related code. In particular, the use of "page" in zoom-related
names is mostly eliminated, in favor of "browser zoom level" to describe
the browser zoom user setting and "layout zoom factor" to describe the
value used for rendering. The new naming convention can be seen most
clearly in the changes to local_frame.h and page_zoom.(h|cc).

Bug: chromium:329482480
Change-Id: I41abb9fd949f63f291487af9039391a4acc21cbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5621488
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Filipa Senra <fsenra@google.com>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Emily Shack <emshack@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Khalid Peer <khalidpeer@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Denis Kuznetsov <antrim@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Kevin Graney <kmg@google.com>
Cr-Commit-Position: refs/heads/main@{#1314855}
2024-06-13 20:53:34 +00:00
a393f2b25a Suppress unsafe buffers warnings from the latest version of Clang
Bug: 341324165
Change-Id: I7410e5b8ddcc6e196fd848c55b8fd9bcf2238cd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5626015
Commit-Queue: Hans Wennborg <hans@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1314027}
2024-06-12 16:08:27 +00:00
ae08e26e2a Browser controls in viz 4: OffsetTag plumbing to renderer
https://chromium-review.googlesource.com/c/chromium/src/+/5535310
plumbed to browser side objects, this cl plumbs to the renderer.

Bug: 325471990, 345261548
Change-Id: I334c13ccdf54978694c8a286f46f06e6096d6d9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5605504
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Peilin Wang <peilinwang@google.com>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1313038}
2024-06-10 20:55:30 +00:00
ee48dfb4fa Prepare to remove //content/ from unsafe_bufers_paths.txt
Suppress unsafe buffer usage on a file-by-file basis.  Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.

Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.

//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.

Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
2024-06-08 05:13:06 +00:00
9bd62c7588 Store zoom level on WebFrameWidget rather than WebView
This was previously landed and reverted:

https://chromium-review.googlesource.com/c/chromium/src/+/5402103

This patch contains a fix for the crash that triggered the revert.
Patchset 1 is the previously-landed code, Patchset 2 contains the fix.

Bug: chromium:329482480
Change-Id: I81f7e89b35279a92ba08ea86db95e0d6766dae31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5571113
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1309989}
2024-06-04 16:13:43 +00:00
5c8e0b22fc Update namespace for files moved to //components/input
Bug: b/340182114
Change-Id: I49a91465449509cd6e247c6d94cae481329fd624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5563251
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Kartar Singh <kartarsingh@google.com>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1307924}
2024-05-30 10:32:14 +00:00
71e4415a59 Fold PrintFrameToBitmap() into TestRunner::PrintFrameToBitmap()
Change-Id: Id38d601af7c49151da99a4654bb5f1ff453b0425
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5569604
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1306440}
2024-05-27 15:32:44 +00:00
23593332d9 [PEPC] Get permission status should take into account device status
This CL create a new function to retrieve permission status, including
OS permission status, continue the previous CL
https://crrev.com/c/5483406.

Although we intend to eventually incorporate permission queries that
include OS permission status, this function is currently only used for PEPC.

Fixed: 335834559
Change-Id: I21c47dee4cb94e7935e33ff822fc4b04aa63c88a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5545382
Reviewed-by: Kamila Hasanbega <hkamila@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Luc Nguyen <lucnguyen@google.com>
Commit-Queue: Thomas Nguyen <tungnh@chromium.org>
Reviewed-by: Kamila Hasanbega <hkamila@google.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1306424}
2024-05-27 14:52:11 +00:00
3899bb31a7 Revert "Store zoom level on WebFrameWidget rather than WebView"
This reverts commit e37df26d9d.

Reason for revert: We are still seeing crash b/338147674

Original change's description:
> Store zoom level on WebFrameWidget rather than WebView
>
> This was previously landed and reverted:
>
> https://chromium-review.googlesource.com/c/chromium/src/+/5402103
>
> This patch contains a fix for the crash that triggered the revert.
> Patchset 1 is the previously-landed code, Patchset 2 contains the fix.
>
> Bug: chromium:329482480
> Change-Id: Ica570581a7bf91ed544ed9f4b56aeff29a0eda72
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5546445
> Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Commit-Queue: Stefan Zager <szager@chromium.org>
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1303991}

Bug: chromium:329482480, 338147674
Change-Id: Id2764c2cda4f5ae3b558524c9dffa4a002189a5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5572286
Owners-Override: Prudhvikumar Bommana <pbommana@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Prudhvikumar Bommana <pbommana@google.com>
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Prudhvikumar Bommana <pbommana@google.com>
Cr-Commit-Position: refs/heads/main@{#1306111}
2024-05-25 17:36:37 +00:00
877302bbb4 Enable unsafe buffers checks on content/browser/renderer_host
This CL adds content/browser/renderer_host as an explicitly enabled
directory to enable unsafe buffers checks.

Bug: 342213636
Change-Id: I248af042be677545f3d627d8eefd9044b7688a3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5544943
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1305514}
2024-05-24 05:12:21 +00:00
e37df26d9d Store zoom level on WebFrameWidget rather than WebView
This was previously landed and reverted:

https://chromium-review.googlesource.com/c/chromium/src/+/5402103

This patch contains a fix for the crash that triggered the revert.
Patchset 1 is the previously-landed code, Patchset 2 contains the fix.

Bug: chromium:329482480
Change-Id: Ica570581a7bf91ed544ed9f4b56aeff29a0eda72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5546445
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1303991}
2024-05-21 20:04:20 +00:00
37faa2783f Fix print-only object bitmap-image loading
An object element with image data that is not rendered on screen will
not initially load the image. This is because of step 2 of the spec
algorithm which states that "if the element is not being rendered,
then jump to the step below labeled fallback", skipping over step 3.5
to actually "Fetch request". [1]

If the object element is to be displayed in printing mode, the bitmap
image loading will be kicked off by the post layout call back
`HTMLPlugInElement::CustomStyleForLayoutObject`. This will be too late
for the first print rendering, however it will render on subsequent
print attempts if they are made.

The proposed fix for this issue is to follow the pattern in
`Document::WillPrintSoon`, which gets called before printing, to
ensure that bitmap images in all object elements in the doc are loaded
before printing by performing a print-mode layout that kicks off the
style or layout dependent loading.

`PrintRenderFrameHelper::PrintRequestedPages` is modified to also call
`WillPrintSoon` so that printing from the system print dialog works as
expected. This matches
`PrintRenderFrameHelper::RequestPrintPreview` which calls it for the
print preview path.

`WebFrameTestProxy::StartTest` was modified to call WillPrintSoon` so
that wpt tests for print only will load the images before dumping the
print rendering pixels and match the system print dialog and print
preview paths.

[1]https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element

Bug: 41477900
Change-Id: I937d1dfff548235ef4967a625f2e0e5132b95b93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5535938
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Traian Captan <tcaptan@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1303490}
2024-05-20 22:33:56 +00:00
8472105d01 Use NOTREACHED_IN_MIGRATION() in content/
This was generated by replacing "  NOTREACHED()" with
"  NOTREACHED_IN_MIGRATION()" and running git cl format.

This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.

Bug: 40580068
Change-Id: I3b48b89911ac5e9ffcb211622992f917f8f9e8d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5539619
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1301096}
2024-05-15 04:36:02 +00:00
8ae6518439 Support some print parameters in TestRunner, and add tests.
Add setPrintingMargin(), setShouldCenterAndShrinkToFitPaper() and
setPrintingScaleFactor() to TestRunner, so that web tests may use these.

Previously, scaling and page-fitting was implemented in
PrintRenderFrameHelper, but this has now been moved to Blink [1], which
means that the functionality is now testable via web tests!

Rather than adding even more parameters to
content::PrintFrameToBitmap(), set up blink::WebPrintParams in
TestRunner and pass it. Removed a bunch of unnecessary includes from
pixel_dump.cc while I was at it.

[1] https://crrev.com/c/5526464

Change-Id: I51a1762e1857757006eb0a037ce3ae7148ec36ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5527128
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1300540}
2024-05-14 10:57:27 +00:00
9d70da4c58 [PEPC] Make PEPC permission subscription take into account device status
The PEPC element needs to get the overall permission status including
the device status in order to correctly decide which text to present
to the user. This CL ensures that the PEPC observer will receive the
permission status including the device status, while not changing the
functionality for other observers. This is done by adding a new
parameter to the `AddObserver` call: `should_include_device_status`.

This parameter is trickled all the way down to the `PermissionManager`
where it is used when calculating the permission status for that
subscription only, whenever that is done.

*Reviewers*: This CL makes mechanical changes to many files, but the
only logical changes are:
* chrome_permissions_client.cc - implement OS device status interaction
for Mac
* components/permissions/permission_context_base.h - define new
`AlwaysIncludeDeviceStatus` function which allows the
`GeolocationPermissionContextAndroid` to keep its current functionality
* `components/permissions/permission_manager.cc` - use the new
`should_include_device_status` parameter to decide whether to include
the device status when getting the permission status.
* html_permission_element.cc - make the AddObserver call with
`should_include_device_status` = true

Fixed: 335834559
Change-Id: Ia8cf68010c9b596520a6b4c5fc61ad24577452f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5483406
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: David Song <wintermelons@google.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Thomas Nguyen <tungnh@chromium.org>
Reviewed-by: Antonio Sartori <antoniosartori@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Mason Freed <masonf@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Eugene Zemtsov <eugene@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1299563}
2024-05-10 22:24:39 +00:00
42390c5321 ContentSettings: Remove string provider name
Replace string provider name with ProviderType enum and remove
conversion methods.

Bug: 40538766
Change-Id: I7415f71c30b8d9c5cd0df6b7e3e89b976ac0c7d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5510302
Reviewed-by: Adam Rice <ricea@chromium.org>
Reviewed-by: Theodore Olsauskas-Warren <sauski@google.com>
Reviewed-by: Johann Hofmann <johannhof@chromium.org>
Reviewed-by: Kevin Graney <kmg@google.com>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Auto-Submit: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Sergio Collazos <sczs@chromium.org>
Reviewed-by: Jonathan Njeunje <njeunje@chromium.org>
Commit-Queue: Sean Topping <seantopping@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1299408}
2024-05-10 18:51:57 +00:00
334e8a8ba1 [A11y] Deprecate unused menuListValueChanged event
There are many redundant events fired when the value of a menulist
(a <select size=1>) changes.
- Active descendant changed event
- Selection changed
- Selection children changed
- Generated selected state changed
- Generated value changed event

The menuListValue changed is unnecessary.

Bug: none
Change-Id: I2eacb29c60c0599c589bb6b52b46f1e27364dd6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5491600
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: David Tseng <dtseng@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1298765}
2024-05-09 18:46:06 +00:00
381c2de172 Replace several content public header includes with forward declarations
Including AXNode from web_contents.h, PermissionsPolicy from
render_frame_host.h, and WebContents from digital_identity_provider.h
are all fairly expensive according to
https://commondatastorage.googleapis.com/chromium-browser-clang/include-analysis.html#view=edges

We replace these with forward declarations and then fix some IWYU
issues.

Bug: 40318405
Change-Id: Id1edaf48482690eb33a76eb17f6216b67fc54a57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5499016
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Auto-Submit: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295499}
2024-05-02 15:39:09 +00:00
2b19eda203 [//content] Expand TransferableResource::MakeSoftware() to variants
Expands callsites to explicitly invoke MakeSoftwareSharedImage() or
MakeSoftwareSharedBitmap() based on what they are passing.

Bug: 337538024
Change-Id: Icd64988c1abf6dd376f3ea16e53b35fd939215c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5498366
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295344}
2024-05-02 09:55:15 +00:00
14f4272a84 Revert "Moving zoom from WebViewImpl to WebFrameWidgetImpl"
This reverts commit 3d6aca656f.

Reason for revert: Top crashon canary 

Original change's description:
> Moving zoom from WebViewImpl to WebFrameWidgetImpl
>
> As we allow CSS zoom to affect iframes, zoom can no longer be a property
> of a web view, as a web view can contain several frames, each with a
> different zoom. This change removes the zoom_level_ variable and
> the functions associated with it from WebViewImpl,and moves it to the
> frame level.
>
> Bug: 329482480
>
> Change-Id: I1136e3a40f0c07587b584055ac4348fc9c9b2b2d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5402103
> Reviewed-by: Stefan Zager <szager@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Auto-Submit: Yotam Hacohen <yotha@chromium.org>
> Commit-Queue: Yotam Hacohen <yotha@chromium.org>
> Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1293975}

Bug: 329482480
Change-Id: I06e0d5c59c0ba8e9c6fc2eba63d6f879a5fdd3d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506825
Commit-Queue: Srinivas Sista <srinivassista@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Auto-Submit: Srinivas Sista <srinivassista@chromium.org>
Owners-Override: Srinivas Sista <srinivassista@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295189}
2024-05-01 23:59:21 +00:00
3d6aca656f Moving zoom from WebViewImpl to WebFrameWidgetImpl
As we allow CSS zoom to affect iframes, zoom can no longer be a property
of a web view, as a web view can contain several frames, each with a
different zoom. This change removes the zoom_level_ variable and
the functions associated with it from WebViewImpl,and moves it to the
frame level.

Bug: 329482480

Change-Id: I1136e3a40f0c07587b584055ac4348fc9c9b2b2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5402103
Reviewed-by: Stefan Zager <szager@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Auto-Submit: Yotam Hacohen <yotha@chromium.org>
Commit-Queue: Yotam Hacohen <yotha@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293975}
2024-04-29 21:28:23 +00:00
770f3fce37 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ibc66b8c440e4bcdef414e77fef4d9874d2ea9951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5493800
Auto-Submit: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1293330}
2024-04-27 00:39:58 +00:00
c5cfd7f14c [FedCM] Add continue_on values to FedCmRequestIdTokenStatus for metrics
This also prepares the code to record a continue_on-specific
popup status metric.

should_embargo was always false for continue_on because for popups
the dismiss reason is always kOther, so this is not a behavior
change.

Bug: 324104289
Change-Id: Ib32fb215d76560b77d02860ccd9d5253d0725a24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5479547
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1292494}
2024-04-25 16:21:12 +00:00
1b714a9e4f WebSQL: Restrict WebSQL service creation to Android only
This change restricts WebSQL service creation to Android
only. WebSQL is fully removed from all platforms in M119
except for Android WebView(crbug.com/333756088). Next step
will be to delete WebSQL data for removed platforms.

Intent thread: https://groups.google.com/a/chromium.org/g/blink-dev/c/fWYb6evVA-w/m/wGI863zaAAAJ

Bug: 40910849
Change-Id: I9a52cfe900f041d57b301faa6584077c19be6137
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5459367
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1291927}
2024-04-24 16:41:04 +00:00
923a33e9d5 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ib028de8bb63c99e5a81d90e24e422cf88061ad05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469583
Owners-Override: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290952}
2024-04-22 23:34:28 +00:00
81f4f2c793 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Iee14d10d544e9f0ec046117cc4ec8a55c427adc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5469947
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290838}
2024-04-22 19:33:31 +00:00
59c007a7ad Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ifd155bbeff882ea939f74cf8b8f847f42847940b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5468156
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290297}
2024-04-20 03:05:40 +00:00
61db50b711 Convert base::StringPiece to std::string_view in //content
The changes of this CL are made using the following script.
Script: https://issues.chromium.org/issues/40506050#comment344

Bug: 40506050
Change-Id: Ic19c285872eadf7f45c7b010d8b6ec5e29cd5ccd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463138
Commit-Queue: Helmut Januschka <helmut@januschka.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290216}
2024-04-19 22:25:08 +00:00
47d1537de7 Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ieeb461e2d489e86fd50b87a2a0721a2be34520c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5467317
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Darryl James <dljames@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Reviewed-by: Darryl James <dljames@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290198}
2024-04-19 21:31:46 +00:00
a1224a1cbb device posture: Add content_shell code path for posture overrides
This allows the Device Posture test_driver calls to work with
content_shell. The patch is similar to https://crrev.com/c/4770865 but
simpler due to the shape of the API.

Bug: 330376761
Change-Id: Ib52b470ef949422f90077eee25df55fbe382a7ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5464528
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/main@{#1289939}
2024-04-19 15:03:52 +00:00
566938c91d [A11y] Use constness to improve ignored/included methods on AXObject
Also, rename, reorganize methods to make the code nicer.

Bug: none
Change-Id: I719a62665eaf41c5eb1cd6f80779a2ecd651af4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5462386
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1289660}
2024-04-18 23:16:57 +00:00
2392b787b9 Add support for container of nullable primitives to js-lite
This change updates the js-lite binding to support arrays of nullables.
The change checks a bitfield in the serialized format when decoding and
encodes the same bitfield when serializing. This is only used for arrays
of nullable primitives.

The wire format is as follows:

| header | | bitfield | | padding | | values |

The bitfield dictates whether or not a value in the array is null or not.
Note that null values are still serialized (the value that is used is up
to the implementation).

Working:
C++
Js

Not working:
Java
Ts

Change-Id: I657e8ab381181dcce1829ed7c7f7e3420d84935f
Bug: 657632
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5280977
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Commit-Queue: Fred Shih <ffred@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288235}
2024-04-16 19:23:00 +00:00
ed8a553c8e [A11y] Simplifying ToString() usage for debugging purposes
The most common usage (by far) is for debugging/logging/checks, and
by not requiring arguments, it makes that type of code much easier to
write (we can just use << ax_object now).

Default to the verbose option. And the use cached values
option can be computed to be true unless the document is frozen.

Fixed: none
Change-Id: I4dc96226b271692027d02b3658bacfe7639fc210
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5454097
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1288134}
2024-04-16 17:11:44 +00:00
c8d6b16f02 format windows headers using new config.
Test new config:
https://chromium-review.googlesource.com/c/chromium/src/+/5197064

by applying clang-format on every problematic windows headers.

This CL is cloned from https://crrev.com/c/5366045.

Script:
-------

```
function replace {
    echo "Replacing $1 by $2"
    git grep -l "$1" \
        | cut -f1 -d: \
        | grep \
              -e "\.h" \
              -e "\.cc" \
        | grep -v "third_party/[^b]" \
        | sort \
        | uniq \
        | xargs sed -i "s/$1/$2/gi"
}

git checkout origin/main
git branch -D change-5197064 || true

git new-branch change-5197064
replace "#include <\(initguid|mmdeviceapi\|windows\|winsock2\|ws2tcpip\|shobjidl\|atlbase\|ole2\|unknwn\|objbase\|tchar\).h>" ""
replace "#include \"base\\/win\\/atl.h\"" ""
replace "#include <uiautomation.*>" ""
git add -u
git commit -m "remove problematic windows headers"
git revert HEAD --no-commit
git add -u
git commit -m "add problematic windows headers"
git cl format --upstream=HEAD~
git add -u
git commit -m "format"

git cl issue 5367127
git cl upload -df --bypass-hook
```

Also removed some unnecessary comments.

Bug: 329138753
Change-Id: I161c28ea2d27c569825e0c789a4c143530937f58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5367127
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1287420}
2024-04-15 16:59:19 +00:00
8d4451517d Convert base::StringPiece to std::string_view in //content except for
content/browser

The changes of this CL are made using the following script.
```
target_directory="content"
replace_string_in_files() {
  old_string="$1"
  new_string="$2"

  find "$target_directory" -type d \( -path "$target_directory/browser" -prune \) -o \( -name "*.cc" -o -name "*.h" \) -exec sed -i '' "s/$old_string/$new_string/g" {} +
}

delete_include() {
    find "$target_directory" -type d \( -path "$target_directory/browser" -prune \) -o \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
        grep -v '#include "base/strings/string_piece.h"' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
    done
}

add_include() {
    find "$target_directory" -type d \( -path "$target_directory/browser" -prune \) -o \( -name "*.h" -o -name "*.cc" \) -print0 | while IFS= read -r -d '' file; do
        local include_added=false
        local tempfile=$(mktemp)

        if grep -qE 'std::(string|u16string)_view' "$file"; then
            while IFS= read -r line; do
                echo "$line" >> "$tempfile"
                if [[ $line =~ ^\s*#include ]]; then
                    if ! $include_added; then
                        echo "#include <string_view>" >> "$tempfile"
                        include_added=true
                    fi
                fi
            done < "$file"

            mv "$tempfile" "$file"

            if $include_added; then
                echo "Added #include <string_view> after the first include line in $file"
            else
                echo "No include line found in $file"
            fi
        else
            echo "std::string_view not found in $file"
        fi
    done
}

replace_string_in_files "base::StringPiece16" "std::u16string_view"
replace_string_in_files "base::StringPiece" "std::string_view"
delete_include
add_include

```
Replaced base::StringPiece16 with std::u16string_view
Replaced base::StringPiece with std::string_view
Removed header "base/strings/string_piece.h"
Added header "<string_view>" where applicable

Bug: 40506050
Change-Id: Ia6d2fd65a16e1a3db59532c085652fbb45dc6abc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5401324
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1285651}
2024-04-11 07:38:50 +00:00
0aab22773d [A11y] Remove AXListBox* classes
Bug: none
Change-Id: Ia34c3fd54b5d3b04fc47298078315d2eeacd70a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5404551
Reviewed-by: Mark Schillaci <mschillaci@google.com>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Mark Schillaci <mschillaci@google.com>
Cr-Commit-Position: refs/heads/main@{#1280324}
2024-03-29 20:40:23 +00:00
fabf54ef2e Use base::HeapArray in content/web_test/common/web_test_string_util.cc
Fixed: 326458515
Change-Id: Id3e6d3a4e3b90ec78946907a4e56304406a2a0a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5399197
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1278677}
2024-03-26 23:18:47 +00:00
79a90bd7ef Use in_forced_colors web setting in Blink
This CL uses the `in_forced_colors` web setting introduced in
CL:5324688 within Blink. The web setting was introduced to remove the
reliance on the global NativeTheme web instance for the state of forced
colors in Blink.

More specifically, this change:
1.) replaces all calls to the WebThemeEngine::GetForcedColors with the
web setting
2.) copies the setting in components that require it such as svg_image
and web_page_popup
3.) updates the kForcedHighContrast switch to override the web setting
for the content shell and web tests

Bug: 1231644, 41489514
Change-Id: I04ee8c3d9e55f271728f27ed915da6f2255f87bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5368321
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Sam Davis Omekara <samomekarajr@microsoft.com>
Reviewed-by: Alison Maher <almaher@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#1277687}
2024-03-25 16:08:19 +00:00
ddedf8e944 Allow running inspector protocol tests using protocol logs
This CL implements a flag called `--inspector-protocol-log` that accepts
a path to a Chrome DevTools Protocol message log. If specified, the test
runner would replay the log mocking the actual browser. The purpose of
this flag is to allow reproducing test flakiness locally and it is not
meant to be used on the bots for now.

Bug: 327140253
Change-Id: I871442d568878b3a1a0d71a18eb2eb721b457e76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331573
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274969}
2024-03-19 16:16:58 +00:00
b6d476aca1 [FedCM] Ensure that we reset FedCM state between tests
The web_test runner already resets a lot of state between tests; add FedCM
to the list.

This fixes fecdm-login-status-unknown.html when not run on its own.

Bug: 329477540
Change-Id: I13d99ec5f95ecab1b5abd97adf2852cc151bd6f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5372545
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1273406}
2024-03-15 15:05:42 +00:00