0
Commit Graph

100 Commits

Author SHA1 Message Date
Hiroki Nakagawa
662e7cc163 WebView Prerender: Allow WebView prerender API to run without the setting
This CL exempts WebView prerender API from SpeculativeLoading WebView
setting.

The setting was introduced for Speculation Rules API on WebView. The API
can be triggered by both embedder apps and web apps hosted on WebView.
In the latter case, an embedder app may not expect prerendering is
triggered, and it may break assumption on navigation lifecycle
management. To avoid the situation, embedders should be able to
explicitly control prerendering with the setting.

On the other hand, WebView prerender API can be triggered only by
embedder apps. Calling the API means that an embedder app understands
implication on navigation lifecycle by prerendering, so WebView doesn't
need to gate the feature unlike Speculation Rules API.

Bug: 41490450
Change-Id: I3d7855a916918a2378acfb92722dcab3cd878ee8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6090650
Reviewed-by: Taiyo Mizuhashi <taiyo@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1396564}
2024-12-15 21:15:36 -08:00
Avi Drissman
5710b06b67 Remove default arguments on virtual functions in WebContents
Default arguments on virtual functions are banned by the style guide.
Remove them and update all callers to provide them.

Bug: none
Change-Id: I029839f7652dadaa486afee072fe8e3b623a8ee7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665092
Reviewed-by: Jayson Adams <shrike@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Commit-Queue: Jayson Adams <shrike@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1322419}
2024-07-02 21:23:29 +00:00
Nasko Oskov
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
Alison Gale
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
Alison Gale
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
Alison Gale
d94ce4fa45 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: Iebe070b9ed793ecdfc43c3a3570f1808b7ddd221
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5470014
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@{#1290677}
2024-04-22 15:20:39 +00:00
Scott Haseley
1219a4a84f find-in-page: Wait for rendering in browser tests
With BlinkSchedulerPrioritizeNavigationIPCs enabled,
FindRequestManagerTest.FindNewMatches sometimes flakes on tsan/msan
builds. It also flakes occasionally without that flags, but it happens
more often with the flag enabled. FindRequestManagerTest.Basic also
occasionally flakes with the flag enabled, but less frequently.

Looking at traces, in the FindNewMatches passing case, rendering
happens before the first find-in-page IPC. In the failing case, it
happens after. This affects whether or not SendActiveMatch is sent to
the browser, which depends on TextFinder::should_locate_active_rect_
(it's true if we rendered, false if not). The ordering change is more
likely to happen with the experiment enabled since navigation IPCs
might run before CC initialization.

Given the apprarent implicit dependency on rendering, this CL changes
the find-in-page browser tests to wait for a rAF after loading the
page, which fixes the issue locally on a tsan build.

Bug: 330147459
Change-Id: I72c113aef357bbaaf33ca6a9218a68dbfd8a063f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5379084
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274628}
2024-03-19 01:14:54 +00:00
Zachary Tan
ac4a483c99 [Gardener] Disable FindRequestManagerTest.FindNewMatches on Linux UBSan
Bug: 330194342
Change-Id: I1809515fa37dcca907c7634fc3ba38dbbc52bbe3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5378643
Commit-Queue: Di Zhang <dizhangg@chromium.org>
Commit-Queue: Zachary Tan <tanzachary@chromium.org>
Auto-Submit: Zachary Tan <tanzachary@chromium.org>
Owners-Override: Zachary Tan <tanzachary@chromium.org>
Reviewed-by: Di Zhang <dizhangg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1274397}
2024-03-18 20:14:43 +00:00
Takuto Ikuta
a47d7859c4 autofill: remove unnecessary include from browser_test_base.h
This is extracted from https://crrev.com/c/5280997 to reduce compile
time of some test files.

content/public/test/browser_test_base.h is the file removing
unnecessary header.

Bug: b/324519459
Change-Id: Ic6b8e4328f6be3161dd3f09711451c8578032ef4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5300036
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1262233}
2024-02-19 03:46:58 +00:00
Dave Tapuska
0189cf30e3 Remove AddFilter when legacy IPC is disabled in content
- Conditionally include browser_message_filter.h/cc in the build
- Remove unused imports of browser_message_filter.h
- Remove unused chrome::bad_message::ReceivedBadMessage
- Remove unused BrowserAssociatedInterface

Bug: 993189
Change-Id: Icf114631fbc495b660aafe1a148e716cc7a19f25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5177633
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1244658}
2024-01-09 15:06:14 +00:00
Jeremy Roman
c0c69be50d Remove the bulk of <portal> code.
See bug for a little more detail, but the next push in this area
will probably differ in some key ways that make the maintenance
of this code no longer the best path forward.

There are still some things left after this that can be cleaned
up afterward; this mainly hacks off the vast majority and then
fixes the things needed for the build to work.

AutofillKeyboardAccessoryIntegrationTest claims to be newly flaky,
but the test logic wasn't modified -- the test was simply made no
longer parameterized.

AX-Relnotes: n/a
Bug: 1498140
Validate-Test-Flakiness: skip
Change-Id: If0559e8db7bcbe4fdde0f4321945e962d152984c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5017280
Reviewed-by: Kevin McNee <mcnee@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1227518}
2023-11-21 19:14:52 +00:00
Ioana Pandele
234e4bf35e [Gardener] Disable flaky FindRequestManagerTestWithTestConfig.NavigateFrameDuringFind
Bug: 1311444
Change-Id: Id6239e7f71d8ff78e9a7b8f9432f72f824e3451d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4966804
Commit-Queue: Ivana Žužić <izuzic@google.com>
Auto-Submit: Ioana Pandele <ioanap@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Reviewed-by: Ivana Žužić <izuzic@google.com>
Owners-Override: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1213572}
2023-10-23 17:03:11 +00:00
punithnayak
e70ebc2214 Removing Dangling pointer from FindRequestManagerTest
Change-Id: I191158f6ac4ccf0c539766a0574c9976dacd6d11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4954420
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1212677}
2023-10-20 12:09:25 +00:00
Lei Zhang
637c755447 Delete unused notification includes
Remove notification includes for files that do no use //content
notification code.

Bug: 268984
Change-Id: I8a037b4d12c6b1cb28ae2fa09e560f427d94aba9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4923372
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1209140}
2023-10-12 22:54:15 +00:00
Rakina Zata Amni
364eb5dd32 Make various content_browsertests expect same-SiteInstance RenderFrameHost etc swap
With RenderDocument, cross-document navigations will use new
RenderFrameHosts (and RenderViewHosts, RenderWidgetHosts, etc for
main frame navigations). This CL updates some tests in
content_browsertests that didn't expect those changes.

Bug: 936696
Change-Id: Ia43799aaae9f50b7ff9c3221982b622d76698d14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4349554
Reviewed-by: James Maclean <wjmaclean@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Auto-Submit: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1120489}
2023-03-22 13:19:00 +00:00
Vishal Lingam
db0d42a28e Remove force override for frame visibility check in find_in_page
When an iframe is loaded after starting a find session,find is
being performed because of options.force even if it's not visible
Remove force override for frame visibilty check and add corresponding
test case

The Original Author has added the override citing HasVisibleContent()
can give inaccurate results but hasn't mentioned the cases anywhere.
The best course of action would be to assume correctness and let the bug
surface and then log a bug for HasVisibleContent().
https://codereview.chromium.org/2236403004/patch/60001/70009

Bug: 1422874
Change-Id: Ic2a4b00ec15859fb9fbde26c8c0b8f8946062beb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4328807
Reviewed-by: Mahesh Machavolu <mahesh.ma@samsung.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Mahesh Machavolu <mahesh.ma@samsung.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1119193}
2023-03-20 06:06:34 +00:00
Ming-Ying Chung
72636181c0 [bfcache] Clean up kBackForwardCache feature's usage in tests.
Due to historical reason, the feature flag for BackForwardCache, i.e.
`kBackForwardCache`, has grown into a complex feature that supports
multiple parameters. To enable the feature in a test and make it stable,
one is required to set up extra parameters, and also required to disable
another feature `kBackForwardCacheMemoryControls`. The whole setup is so
complicated that some tests made wrong usage of them.

This CL is the 1st step to reduce its complexity, by hiding the setup behind team-owned utility functions. In the future, the team may decide to refactor the parameters, and this change help limiting the affected files.

The changes include:
- Rename test utility functions to make them easier to understand.
- Replace most references to `kBackForwardCache` or `kBackForwardCacheMemoryControls` in tests with the above functions

Bug: 1301867
Change-Id: I117196bf639c8e88adc0d813b5f225040516fd0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4280121
Reviewed-by: Ken Okada <kenoss@chromium.org>
Reviewed-by: Matthias Körber <koerber@google.com>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Commit-Queue: Ming-Ying Chung <mych@chromium.org>
Reviewed-by: Christoph Schwering <schwering@google.com>
Cr-Commit-Position: refs/heads/main@{#1110890}
2023-02-28 12:16:04 +00:00
Scott Violet
9986199c3c content: makes content browsertests subclass test ContentBrowserClient
Some times tests need to replace the ContentBrowserClient. This
is often done by subclassing ContentBrowserClient and replacing
ContentBrowserClient during test execution. This is problematic
as certain things (such as RegisterBrowserInterfaceBindersForFrame)
are provided by ShellContentBrowserClient, and if not present
result in bad behavior (killing the renderer), which leads to flake.

To fix this problem this patch does the following:
. Moves ContentBrowserTestShellContentBrowserClient to its own
  header and renames it to
  ContentBrowserTestContentBrowserClient.
. makes SetBrowserClientForTesting() CHECK in content_browsertests.
. changes all browsertests to use
  ContentBrowserTestContentBrowserClient.
. Changes ShellContentBrowserClient so that it sets the browser
  client when called the second time (effectively what
  SetBrowserClientForTesting() does).

Bug: 1406282

Change-Id: Ieaa7cfa09a53e9618b963d6cc4b931226d2c799e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4222392
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102490}
2023-02-08 01:20:12 +00:00
Ming-Ying Chung
073e6f6048 [bfcache] Clean up legacy TTL param and replace its usage with new flag
- Remove the logic that uses legacy TTL param from `content/browser/renderer_host/back_forward_cache_impl.cc`
- Move the dedicated TTL feature flag `kBackForwardCacheTimeToLiveControl` to `content/public/common/content_features.h` so that it can replace the usage of legacy param `kBackForwardCache:TimeToLiveInBackForwardCacheInSeconds`

Details:
1. In the previous launch crrv/c/3924019, BackForwardCache's default TTL
   has been updated to 600 seconds. The launch also uses a new dedicated
   feature flag `kBackForwardCacheTimeToLiveControl` to overwrite the
   default from server-side for the older clients.
2. However, in the gigantic flag `kBackForwardCache`, there is a param
   called `TimeToLiveInBackForwardCacheInSeconds` which can also
   overwrite the default flag. Due to historical reason, the server-side
   Finch config still set this flag to 180 seconds.
3. This CL replaces all the references to the legacy param
   `kBackForwardCache:TimeToLiveInBackForwardCacheInSeconds` to the new flag `kBackForwardCacheTimeToLiveControl`.

Bug: 1305878
Change-Id: Ia6f5f2c84b1a7f219c31ef681b9ca0a918674ea9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4177505
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Yoshisato Yanagisawa <yyanagisawa@chromium.org>
Commit-Queue: Ming-Ying Chung <mych@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1097212}
2023-01-26 02:47:40 +00:00
Johann
a0b3e9b26b preloading: pass reason up to IsPrerender2Supported
This will allow more accurate reporting in UMA/UKM data.

BUG=chromium:1382315

Change-Id: I4dc11f63f04df602409d10626167914db25e9bef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4170130
Reviewed-by: Sreeja Kamishetty <sreejakshetty@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Johann Koenig <johannkoenig@google.com>
Cr-Commit-Position: refs/heads/main@{#1094749}
2023-01-19 23:23:35 +00:00
Antia Puentes
aa86ac8782 Rewrite GetPrimaryMainFrame comparison in terms of IsInPrimaryMainFrame (13/n)
This CL replaces the GetPrimaryMainFrame() comparison check in favor
of a more concise method IsInPrimaryMainFrame() in
find_request_manager_browsertest.cc.

Bug: 1268893
Change-Id: Ia30908add31e3fcccb2f203dcaab284cd08d4fd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4028639
Commit-Queue: Antia Puentes <apuentes@igalia.com>
Reviewed-by: Bo Liu <boliu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1071741}
2022-11-15 18:51:55 +00:00
Artur
3bb150aafe Reland "Fix PDF viewer jumping immediately after the user presses 'ctrl+f'"
This is a reland of commit 143885f9e5

https://crrev.com/1045406 reverted this CL as a speculative fix for the
flakiness in https://crbug.com/1362116. The test remains flaky after
the revert, so reland this CL.

Original change's description:
> Fix PDF viewer jumping immediately after the user presses 'ctrl+f'
>
> This behavior is disruptive and inconsistent with the search behavior
> of non-PDF sites. After this commit, pressing 'ctrl+f' will not start
> a search until the user presses additional keys (add characters /
> press enter).
>
> This bug is a side effect of fixing another bug "Chrome PDF Search is
> not executed in background" (crbug.com/764635). The fix reverts the
> changes done by the previous bug fix (pdfium_engine.cc) and provides an
> alternative solution (find_request_manager.cc) which requires to update
> some tests (pdf_find_request_manager_browsertest.cc,
> find_request_manager_browsertest.cc, findtext_unittest.cc).
>
> Lastly this is my first bug so I added my name to AUTHORS.
>
> Bug: 1290824
> Change-Id: I8e152087fb2ac019124e477b4d04d73d7b8f2f21
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3455153
> Commit-Queue: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Joey Arhar <jarhar@chromium.org>
> Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1043764}

Bug: 1290824
Change-Id: I1413c4db077a4cfd5c8e8dafe0a4ff31cd238ec3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3892090
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: K. Moon <kmoon@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1060267}
2022-10-18 02:36:05 +00:00
Andrew Grieve
a0c57c888a Disable flakey test: FindRequestManagerTest/ActivateNearestFindMatch
Bug: 1362116
Change-Id: I6874d3d6614a66aefef0e327e010ecb85286adb0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3913457
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Owners-Override: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1050881}
2022-09-24 00:31:09 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Tommy Nyquist
353a28e224 Revert "Fix PDF viewer jumping immediately after the user presses 'ctrl+f'"
This reverts commit 143885f9e5.

Reason for revert: Speculative revert for flaky test.
See https://crbug.com/1362116 for details.

Original change's description:
> Fix PDF viewer jumping immediately after the user presses 'ctrl+f'
>
> This behavior is disruptive and inconsistent with the search behavior
> of non-PDF sites. After this commit, pressing 'ctrl+f' will not start
> a search until the user presses additional keys (add characters /
> press enter).
>
> This bug is a side effect of fixing another bug "Chrome PDF Search is
> not executed in background" (crbug.com/764635). The fix reverts the
> changes done by the previous bug fix (pdfium_engine.cc) and provides an
> alternative solution (find_request_manager.cc) which requires to update
> some tests (pdf_find_request_manager_browsertest.cc,
> find_request_manager_browsertest.cc, findtext_unittest.cc).
>
> Lastly this is my first bug so I added my name to AUTHORS.
>
> Bug: 1290824
> Change-Id: I8e152087fb2ac019124e477b4d04d73d7b8f2f21
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3455153
> Commit-Queue: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Lei Zhang <thestig@chromium.org>
> Reviewed-by: Joey Arhar <jarhar@chromium.org>
> Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1043764}

Bug: 1290824, 1362116
Change-Id: I43366129df4a9e44b5413852a029c3a121f8590e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3888066
Owners-Override: Tommy Nyquist <nyquist@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1045406}
2022-09-09 23:16:08 +00:00
Artur
143885f9e5 Fix PDF viewer jumping immediately after the user presses 'ctrl+f'
This behavior is disruptive and inconsistent with the search behavior
of non-PDF sites. After this commit, pressing 'ctrl+f' will not start
a search until the user presses additional keys (add characters /
press enter).

This bug is a side effect of fixing another bug "Chrome PDF Search is
not executed in background" (crbug.com/764635). The fix reverts the
changes done by the previous bug fix (pdfium_engine.cc) and provides an
alternative solution (find_request_manager.cc) which requires to update
some tests (pdf_find_request_manager_browsertest.cc,
find_request_manager_browsertest.cc, findtext_unittest.cc).

Lastly this is my first bug so I added my name to AUTHORS.

Bug: 1290824
Change-Id: I8e152087fb2ac019124e477b4d04d73d7b8f2f21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3455153
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1043764}
2022-09-07 01:49:54 +00:00
Peter Kasting
d534d736f4 Fix -Wshadow for Android.
Bug: 1344231
Change-Id: Ief1a88b43b102a5e37e5f290cd2934e77bc3c91a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3867279
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1042201}
2022-09-01 18:14:37 +00:00
Jiewei Qian
a12d6f171b sheriff: disable flaky FindRequestManagerTestWithTestConfig.NavigateFrameDuringFind test
The test also flakes in Win7 bot:
https://ci.chromium.org/ui/p/chromium/builders/ci/Win7%20Tests%20(1)/131207/overview

Bug: 1311444
Change-Id: I4880df78b63898e911cdeadd2143215a5626476c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3792987
Commit-Queue: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Auto-Submit: Jiewei Qian <qjw@chromium.org>
Owners-Override: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1029643}
2022-07-29 05:45:54 +00:00
Dave Tapuska
327c06c9c7 Rename GetMainFrame to GetPrimaryMainFrame
Progressively rename some usages of GetMainFrame to GetPrimaryMainFrame.

This is an automated change via git grep & sed.

BUG=1250404

Change-Id: I5e8fda4f11104cf9fcde8a690a33dc6ab7c34f3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3696741
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013636}
2022-06-13 20:31:51 +00:00
Arthur Sonzogni
4c9cdacbe6 DanglingPtr: Mark all of them as untriaged [1/N]
This patch must be a no-op with all the common build flags.

Add the "DanglingUntriaged" raw_ptr annotation. It indicates a
raw_ptr becomes dangling, and it should be triaged/fixed.

This annotates the one firing during content_browsertests.
Multiple follow-up will complete the list, up until being able to
enable dangling pointer detection on a bot.

Stats:
- 175 DanglingUntriaged in code
- 69 DanglingUntriaged in tests

Bug=1291138

Change-Id: I00771bd46403f90297aa5b972fdd1ddc23b18e07
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687960
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013525}
2022-06-13 17:22:56 +00:00
Hui Yingst
a235c6e50a [Sheriff] Disable flaky test FindRequestManagerTestWithTestConfig.NavigateFrameDuringFind on macOS and Linux.
Bug: 1311444
Change-Id: I30d8ec7394a436feeffd4d3533f4275e6485c5a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3558061
Reviewed-by: Olivia Yingst <huiyingst@google.com>
Owners-Override: Olivia Yingst <huiyingst@google.com>
Commit-Queue: Olivia Yingst <huiyingst@google.com>
Cr-Commit-Position: refs/heads/main@{#986791}
2022-03-30 00:41:14 +00:00
Miyoung Shin
0319175c99 [Fenced Frames] Reinforce FindRequestManagerTest.NavigateFrameDuringFind
This is a follow-up CL of crrev.com/c/3135523 and reinforces the TC
to run combinations with {same,cross}-origin and {iframe, fenced frame}.

Bug: 1245613
Change-Id: I47afe464292bb8038c8c06a14ea1914f88cbf679
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3291080
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Cr-Commit-Position: refs/heads/main@{#986397}
2022-03-29 09:20:51 +00:00
Joey Arhar
0574fb753b Clear delayed queries when stopping find-in-page
This fixes a regression caused by http://crrev.com/956680 where clearing
the find-in-page text box causes a find-in-page to occur with the last
text which was in the box. For example, typing "a" into the text field
and then pressing backspace quickly before the find-in-page request
occurs will make the page get searched for "a" and highlight results
after the find-in-page text field is empty.

This happens because FindRequestManager::Find is not called when the
search is cleared, but FindRequestManager::StopFinding is called
instead, and StopFinding wasn't accounting for the pre-existing delayed
find-in-page query.

This patch fixes it by clearing the delayed find-in-page query when
StopFinding is called.

Fixed: 1286068
Change-Id: I1b9b9e8f58d9a48b24f0ec49e42c1ce8f9b8938c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3544186
Commit-Queue: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986254}
2022-03-29 00:45:16 +00:00
Hiroki Nakagawa
4ae11b8827 Prerender: Don't run Speculation Rules prerendering if users disable preload setting
When the setting of "Preload pages for faster browsing and searching" is
disabled (see chrome://settings/cookies), Speculation Rules prerendering
should not be triggered.

The same restriction has already been implemented for Omnibox
prerendering on direct URL input (https://crbug.com/1269204).

Bug: 1278478
Change-Id: Ib6dd4c445482a6dc81ab8f431598755af93b7818
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3423346
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Mike Wasserman <msw@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Huanpo Lin <robertlin@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/main@{#966568}
2022-02-03 03:24:11 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Vladimir Levin
8e5ac5c899 FindInPage: Account for ZoomForDSF when reporting selection rects.
This code updates the selection rects to be always in DIPs which
fixes the referenced bug. As a consequence, Android test also
needs an update, but I believe this is a correct change.

R=chrishtr@chromium.org
Bug: 1234683, 1285135

Change-Id: I7f5f02f7a5ad179b04b9ee921d7fc0f74f231f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3373564
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#959336}
2022-01-14 19:40:15 +00:00
Tim Sergeant
5980addfae Sheriff: Disable flaky FindRequestManagerTest.ActivateNearestFindMatch
This test (which only runs on Android) has recently become flaky.

Bug: 1285135
Change-Id: Ib8161f6c40968dfdebd880304e1cb150390263e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3371545
Owners-Override: Tim Sergeant <tsergeant@chromium.org>
Auto-Submit: Tim Sergeant <tsergeant@chromium.org>
Reviewed-by: Jeevan Shikaram <jshikaram@chromium.org>
Commit-Queue: Jeevan Shikaram <jshikaram@chromium.org>
Cr-Commit-Position: refs/heads/main@{#956958}
2022-01-10 05:09:47 +00:00
Keishi Hattori
0e45c020c4 Rewrite most Foo* field_ pointer fields to raw_ptr<Foo> field_.
DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA)/sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial.

This commit was generated automatically, by running the following script: tools/clang/rewrite_raw_ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e

For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_ptr documentation in //base/memory/raw_ptr.md.

FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this.

[1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sharing
[2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ

Binary-Size: Increase of around 500kb was approved for MiraclePtr
Include-Ci-Only-Tests: true
No-Tree-Checks: true
No-Presubmit: true
Bug: 1272324, 1073933
Change-Id: I05c86a83bbb4b3f4b017f361dd7f4e7437697f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3305132
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945735}
2021-11-27 09:25:52 +00:00
Gyuyoung Kim
a855ff5d4c Reland "MPArch: Fenced frame does not clear the find request queue in FindRequestManager::RemoveFrame"
This is a reland of 2b80df4d74

The original CL called a private method in the test via friend class.
But, it could cause undefined symbol build error due to the visibility.
To fix it, we need to use CONTENT_EXPORT keyword for the private method
in order to export the symbol of the method to the test class.

Original change's description:
> MPArch: Fenced frame does not clear the find request queue in FindRequestManager::RemoveFrame
>
> FindRequestManager::RemoveFrame method has cleared its own find request
> queue when a given render frame host is a mainframe. This CL makes
> the method only clear the queue on a pimary main frame. Besides
> this CL adds a test case to verify it.
>
> Bug: 1264776
> Change-Id: Iddaaa1eec0d0d332efc54b1a06c9b5e8d936fff2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3255123
> Reviewed-by: Dominic Farolino <dom@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#942951}

Bug: 1264776
Change-Id: I2725610adcd679b45de3a885680124cd214852c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288660
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943437}
2021-11-19 07:24:35 +00:00
Nidhi Jaju
aec028192b Revert "MPArch: Fenced frame does not clear the find request queue in FindRequestManager::RemoveFrame"
This reverts commit 2b80df4d74.

Reason for revert: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac%20Builder%20(dbg)/204054/overview

Original change's description:
> MPArch: Fenced frame does not clear the find request queue in FindRequestManager::RemoveFrame
>
> FindRequestManager::RemoveFrame method has cleared its own find request
> queue when a given render frame host is a mainframe. This CL makes
> the method only clear the queue on a pimary main frame. Besides
> this CL adds a test case to verify it.
>
> Bug: 1264776
> Change-Id: Iddaaa1eec0d0d332efc54b1a06c9b5e8d936fff2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3255123
> Reviewed-by: Dominic Farolino <dom@chromium.org>
> Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
> Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
> Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
> Cr-Commit-Position: refs/heads/main@{#942951}

Bug: 1264776
Change-Id: I301d912a43aebb5b2eef33b68ff2a3ef1aba7785
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3288419
Auto-Submit: Nidhi Jaju <nidhijaju@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Nidhi Jaju <nidhijaju@chromium.org>
Owners-Override: Nidhi Jaju <nidhijaju@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942956}
2021-11-18 04:37:48 +00:00
Gyuyoung Kim
2b80df4d74 MPArch: Fenced frame does not clear the find request queue in FindRequestManager::RemoveFrame
FindRequestManager::RemoveFrame method has cleared its own find request
queue when a given render frame host is a mainframe. This CL makes
the method only clear the queue on a pimary main frame. Besides
this CL adds a test case to verify it.

Bug: 1264776
Change-Id: Iddaaa1eec0d0d332efc54b1a06c9b5e8d936fff2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3255123
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/main@{#942951}
2021-11-18 04:10:40 +00:00
Carlos Caballero
1a261f8d18 Rename WebContentsImpl::GetFrameTree to GetPrimaryFrameTree
Note that the old method is already returning the PrimaryFrameTree so
this patch is just about making that explicit.

Keeping the old method around for a while will also prevent this massive
patch from being reverted if an optional try-bot later fails.

Bug: 1251094
Change-Id: Iea020e175212c92bccf15dc0af1c3ca7e084bbbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3259727
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/main@{#938281}
2021-11-04 15:54:03 +00:00
Carlos Caballero
15caeeb12d Rename WebContentsImpl::GetFrameTree to GetPrimaryFrameTree
Note that the old method is already returning the PrimaryFrameTree so
this patch is just about making that explicit.

Trivial change that renames all test files leaving the production code
for a later patch. That code will need a closer look to make sure that
call sites are really expecting the primary frame tree (note they are
already getting the primary frame tree, so this is just an extra check
for peace of mind).

Keeping the old method around for a while will also prevent this massive
patch from being reverted if an optional try-bot later fails.

Bug: 1251094
Change-Id: Ibc86aedf203013e41e61ede94e6af929f80ee477
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3231330
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sreeja Kamishetty <sreejakshetty@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/main@{#935359}
2021-10-27 09:57:55 +00:00
Miyoung Shin
bf4c40c8ca [mparch] Manage FindRequestManager with RFHs' lifecycle state
This CL observes RenderFrameHostStateChanged instead of
RenderFrameHostChanged and adds the IsActive check so that
we would only run find-in-page on active pages, and also this
adds some checks and tests to ensure that this is true.

Bug: 1245613
Change-Id: I84b5d9dd057a343dea2e8377ac345533ce892e88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3135523
Commit-Queue: Miyoung Shin <myid.shin@igalia.com>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#933813}
2021-10-21 11:00:23 +00:00
Lei Zhang
7c46fde7fc [unseasoned-pdf] Disable find-in-page for PDF UI via the browser.
For the PDF Viewer, find-in-page should only return results from the
PDF content, and not from the PDF Viewer's UI. In the PPAPI-based PDF
Viewer, the renderer process that hosts the UI has a
blink::WebPluginContainer, and deferring find-in-page operations to that
WebPluginContainer really defers to the PDF plugin. In the PPAPI-free
PDF Viewer, that same process just hosts the PDF renderer and has no
plugin to defer to. The PDF renderer has a blink::WebPluginContainer
instead. With no plugin to defer to, the renderer running the PDF UI
performs find-in-page on its own contents.

To fix this, avoid creating a content::FindInPageClient for the RFH with
the PDF UI. For content::FindRequestManager to make this decision
without direct knowledge of the PDF Viewer, add a generic
ContentBrowserClient::IsFindInPageDisabledForOrigin() interface and
override it in //chrome.

Along the way, add some getters to FindRequestManagerTest to retrieve
commonly used nodes in the FrameTree, and use those in both new test
cases and to simplify existing test cases.

Bug: 1199999
Change-Id: I85dddd90bd4a6a57ba84e3ba8f7c09bdd99bd17e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3229023
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#932616}
2021-10-18 19:09:22 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
2021-09-21 02:28:43 +00:00
Avi Drissman
c91bd8ea79 Migrate to ExecJs/EvalJs in content/
Bug: 1157718
Change-Id: Ibb5bdb3f994630cc2b84f4e60adaf307fe646cb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2826401
Auto-Submit: Avi Drissman <avi@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#874039}
2021-04-19 23:58:44 +00:00
WangHui
9677e35ef0 find-in-page: Update the match rects with the size of mainframe.
Match rects in subframe should be recomputed when the size of parent
frame is changed since Find-in-page coordinates are represented as
normalized fractions of the main frame document

Bug:1147796

Change-Id: Iee446b54060b9977f0ed6db8b49c6bf63d1938c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2531797
Commit-Queue: HuiWang <wanghui210@huawei.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844346}
2021-01-16 02:52:20 +00:00
Lukasz Anforowicz
69c25dfd83 s/NavigateFrameToURL/NavigateToURLFromRenderer/ in content_browsertests.
This CL replaces most calls to NavigateFrameToURL(...) with
EXPECT_TRUE(NavigateToURLFromRenderer(...)).  Note that not all such
calls have been replaced (e.g. this CL skips the ones where the
naive/mechanical replacement would have caused test failures).

For motivation (i.e. why NavigateFrameToURL is slightly undesirable)
please see the linked bug.

Bug: 1148049
Change-Id: I5b341c3e7cc2e0774d905705b2ca891dc0be862f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532855
Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826989}
2020-11-12 21:50:20 +00:00
WangHui
66701aefd8 FindInPage: Don't show tickmark for empty ActiveMatchRect.
The ActiveMatch may be null when make a FindRequest with options that kWrapAround is
false, while the active_rect in |FindRequestManager| will not update when it is
empty then we will show a incorrect tickmark(active_rect of last FindRequest)
on Android. so We should reset the active_rect in |FindRequestManager| when there
is a new FindRequest.

Bug: 1141374

Change-Id: Ieac210a2b72f4f92649e68e1b2e2969fd707dbf2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491726
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Commit-Queue: Filip Gorski <fgorski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825424}
2020-11-09 20:01:29 +00:00