Commit Graph

860 Commits

Author SHA1 Message Date
Marshall Greenblatt 28c7f04001 Delete cef_web_plugin.h and plugin-related APIs (see issue #3047)
This functionality stopped being relevant after the removal of Flash support
in January 2021. The last remaining PPAPI plugin (PDF viewer) will switch to
a non-plugin implementation (PdfUnseasoned) in M100.
2022-02-18 16:23:11 -05:00
Marshall Greenblatt 171d525aa4 alloy: Implement Find() using find_in_page::FindTabHelper (fixes issue #3098, see issue #3047)
The find behavior should now match Chrome.
2022-02-17 13:59:25 -05:00
Marshall Greenblatt 9276dba712 cefclient: Disable alert on space bar press (see issue #3184)
This will be reverted after issue #3184 is resolved.
2022-01-14 12:15:26 -05:00
Marshall Greenblatt dfc0131516 Update to Chromium version 98.0.4758.0 (#950365) 2021-12-18 15:57:34 -05:00
Marshall Greenblatt b76badd958 Remove DISALLOW_ macro from include/ (see issue #3234)
Also perform related C++ cleanup:
- Use =default instead of {} for default implementations of
  constructors/destructors.
- Replace typedef with using.
2021-12-07 15:02:28 -05:00
Marshall Greenblatt f4d5395c4b Skip GetNewBrowserInfo call for PDF renderer processes (see issue #3047)
With PdfUnseasoned the PDF file will be loaded in a dedicated renderer process.
We identify this process by adding the kPdfRenderer command-line flag (similar
to how kExtensionProcess is used to identify an extension renderer process). We
then avoid calling GetNewBrowserInfo for the PDF renderer process because we
know the request will otherwise time out.
2021-11-29 15:46:39 -05:00
Marshall Greenblatt 6eff48e9ff chrome: Add support for PdfViewerTest ceftests (see issue #3047)
We need to override ChromeMimeHandlerViewGuestDelegate to handle
OnGuestAttached/Detached callbacks in order to account for the guest renderer
process hosting the PDF extension.

Additional work will be required to account for the renderer process hosting the
PDF viewer when using `--enable-features=PdfUnseasoned` (see issue #2969).
2021-11-16 19:17:50 -05:00
Marshall Greenblatt 66648c2343 Update to Chromium version 97.0.4692.0 (#938553)
- Remove CefRequestContextHandler::OnBeforePluginLoad and
  CefRequestContext::PurgePluginListCache (fixes issue #3047). These methods
  stopped being relevant after the removal of Flash support in January 2021.
  The last remaining PPAPI plugin (PDF viewer) will switch to a non-plugin
  implementation in the near future (see https://crbug.com/702993#c58) and
  functionality related to plugin filtering has already been removed in
  https://crrev.com/343ae351c9.
2021-11-15 14:25:16 -05:00
Marshall Greenblatt fae1402a6e Mac: cefclient: Fix crash when quitting from the top menu (fixes issue #3201) 2021-10-22 18:36:25 -04:00
Marshall Greenblatt 4d1c5ebdd2 Fix CefCommandLine character case requirements (fixes issue #1872)
Switch names will now be converted to lowercase ASCII on all platforms.
Switch values will retain the original case and UTF8 encoding.
2021-09-27 16:36:57 +03:00
Marshall Greenblatt cbc5710801 Replace CefRequestCallback with CefCallback (fixes issue #1861)
CefRequestCallback::Continue(false) was the same as Cancel(), so we can just
use CefCallback instead.
2021-09-27 16:22:27 +03:00
Marshall Greenblatt 23be17f693 Use CefRect for CefWindowInfo bounds (fixes issue #1515) 2021-09-27 16:22:27 +03:00
Marshall Greenblatt 41b64e428c Rename SendFocusEvent to SetFocus (fixes issue #866)
Also removes CefBrowserHost::SendFocusEvent. Use the existing SetFocus method
instead.
2021-09-27 10:50:12 +03:00
Marshall Greenblatt dc1f934865 views: Support configuration of initial window show state
Known issues:
- Exiting full-screen mode currently crashes with the Chrome runtime
  (see issue #3182).
2021-09-23 14:41:47 +03:00
Marshall Greenblatt 0cee138670 views: cefclient: Add missing <algorithm> include for std::max 2021-09-22 12:08:59 +03:00
Marshall Greenblatt 1eba937874 views: cefclient: Fix VS2019 compile error 2021-09-22 12:08:59 +03:00
Marshall Greenblatt 5782fdca16 Update to Chromium version 95.0.4638.0 (#920003)
Known issues:
- Windows ARM64 builds are currently failing due to
  https://crbug.com/1242884#c31
2021-09-22 12:08:24 +03:00
Marshall Greenblatt 7a56371b84 Fix draggable region update with BackForwardCache enabled (see issue #2421)
When BackForwardCache is enabled and the user navigates the main frame
back/forward a new RFH may be created for an existing main frame GlobalId value
and CefFrameHostImpl (e.g. an object that was previously Detach()ed after main
frame navigation called SetMainFrame, but for which RenderFrameDeleted was not
subsequently called due to insertion in the BackForwardCache). In this case we
can re-attach the new RFH to the existing main frame CefFrameHostImpl in
RenderFrameHostStateChanged and resume processing of messages.

Swapping back/forward to an existing (already loaded) renderer does not trigger
new notifications for draggable regions (e.g. RenderFrameObserver::
DraggableRegionsChanged is not called by default). We therefore explicitly
request an update of draggable regions by sending the DidStopLoading message to
the renderer.

A new |reattached| parameter is added to CefFrameHandler::OnFrameAttached to
support identification of BackForwardCache usage by the client.

To test with unit tests:
Run `ceftests --gtest_filter=DraggableRegionsTest.DraggableRegionsCrossOrigin
              --enable-features=BackForwardCache`

To test manually:
1. Run `cefclient --enable-features=BackForwardCache --use-views
   --url=http://tests/draggable`, note that draggable regions work.
2. Load https://www.google.com via the address bar, note that draggable regions
   are removed.
3. Go back to http://tests/draggable, note that draggable regions work.
4. Go forward to https://www.google.com, note that draggable regions are
   removed.
2021-09-16 18:25:43 +03:00
Marshall Greenblatt 4a44e16a09 views: Add support for absolute positioned overlay views.
To test:
Run `cefclient.exe --use-views --hide-frame --hide-controls`
Add `--enable-chrome-runtime` for the same behavior using the Chrome location
bar instead of a text field.
2021-09-16 18:25:43 +03:00
Marshall Greenblatt 92f67ee847 Check in fused GTest files
The fuse_gtest_files.py script was removed from GTest in
https://github.com/google/googletest/commit/47f819c3ca.
Consequently we can no longer generate these files at runtime.
2021-08-24 17:43:02 -04:00
Marshall Greenblatt 25c1947f1d Update to Chromium version 94.0.4606.0 (#911515) 2021-08-24 17:43:02 -04:00
Marshall Greenblatt 240b869db5 widevine: Use component updater with the Alloy runtime (fixes issue #3149)
Widevine CDM binaries will be downloaded on supported platforms shortly after
application startup. Widevine support will then become available within a few
seconds after successful installation on Windows or after the next application
restart on other platforms. The CDM files will be downloaded to a "WidevineCdm"
directory inside the `CefSettings.user_data_path` directory.

Pass the `--disable-component-update` command-line flag to disable Widevine
download and installation. Pass the `--component-updater=fast-update` command-
line flag to force Widevine download immediately after application startup.

See the related issue for additional usage details.
2021-08-09 21:10:45 -04:00
Marshall Greenblatt ad71ec9fdf views: Fix multiple issues with hide-frame (fixes issue #3168) 2021-08-04 14:31:08 -04:00
Marshall Greenblatt 6f819707b0 chrome: Linux: Fix ceftest DraggableRegionsTest.DraggableRegions failure (see issue #2969) 2021-07-27 19:03:21 -04:00
Marshall Greenblatt 92ec2dcbdd Fix ceftest failures with BackForwardCache enabled (see issue #2421)
When BackForwardCache is enabled the old RFH tree may be cached instead of being
immediately deleted as a result of main frame navigation. If a RFH is cached
then delivery of the CefFrameHandler::OnFrameDetached callback will be delayed
until the the RFH is ejected from the cache (possibly not occurring until the
browser is destroyed). This change in OnFrameDetached timing was causing
FrameHandlerTest.OrderSubCrossOrigin* to fail, and the inclusion of cached
frames in CefBrowserInfo::GetAllFrames was causing
FrameTest.NestedIframesDiffOrigin to fail.

BackForwardCache is currently being tested via field trials (see
https://crbug.com/1171298) and can be explicitly disabled using the
`--disable-back-forward-cache` or `--disable-features=BackForwardCache`
command-line flags.
2021-07-27 19:03:21 -04:00
Marshall Greenblatt b4ea0496e7 Update to Chromium version 93.0.4577.0 (#902210) 2021-07-27 19:03:09 -04:00
campersau 1ffa5528b3 Windows: cefclient: Map Shift+Ctrl+Alt to Shift+AltGr for OSR (see issue #3026) 2021-07-19 15:55:43 +00:00
Marshall Greenblatt 103fe12b72 Linux: Fix SchemeHandlerTest.Custom*StandardNoResponse test failures 2021-06-24 20:55:29 -04:00
Marshall Greenblatt 7efac13ac1 gtest: Add plugin for TeamCity integration
Automatically report unit tests to the TeamCity server if run within TeamCity.
See tests/gtest/teamcity/README.cef for details.

To test: Set the TEAMCITY_PROJECT_NAME environment variable and run ceftests.
2021-06-24 17:00:21 -04:00
Marshall Greenblatt 9efd3dc8ee Fix compile errors with VS2019 v16.9.3 and GCC v7.5.0 (see issue #3140) 2021-06-23 13:00:34 -04:00
Marshall Greenblatt 529b91bc6e tests: Convert usage of base::Bind to Once or Repeating (see issue #3140) 2021-06-19 17:19:32 -04:00
Marshall Greenblatt cc2759d07e Add base::OnceClosure support in cef_closure_task.h (see issue #3140) 2021-06-18 14:19:11 -04:00
Marshall Greenblatt 3545e20b01 ceftests: Don't use base::Bind in object constructor (see issue #3140)
Fixes the following error:
[FATAL:cef_bind_internal.h(868)] Check failed: receiver->HasAtLeastOneRef().
base::Bind{Once,Repeating}() refuses to create the first reference to ref-counted
objects. That typically happens around PostTask() in their constructor, and such
objects can be destroyed before `new` returns if the task resolves fast enough.
2021-06-18 13:42:32 -04:00
Marshall Greenblatt 17fc2b3e3b Various fixes related to the C++11/14 update (see issue #3140)
- Convert scoped_ptr to std::unique_ptr from <memory>
- Convert arraysize to base::size from include/base/cef_cxx17_backports.h
- Convert NULL to nullptr
- Include include/base/cef_callback.h instead of include/base/cef_bind.h
- Implicit conversion of CefRefPtr<T> or scoped_refptr<T> to T* is gone;
  use .get() instead

See the issue for additional details.
2021-06-18 13:42:31 -04:00
Marshall Greenblatt 6d80ec69d7 Replace OVERRIDE with override (see issue #3140) 2021-06-17 16:16:53 -04:00
Marshall Greenblatt ba46b8c53e Fix CefBrowser::GetMainFrame assumptions in the renderer process (see issue #2421)
ClientAppRenderer::Delegate callbacks are executed for all tests. In this case
CorsTest.IframeAllowScriptsCustomNonStandardSchemeToServer was crashing on Linux
because CefBrowser::GetMainFrame() returns nullptr in the renderer process when
called from a cross-origin sub-frame.
2021-06-10 16:42:45 -04:00
Marshall Greenblatt 5a622c22b5 Mac: Fix flaky ResourceRequestHandlerTest failures
The AbortAfterCreated and AbortBeforeBrowse tests were flaking due to a race
between request handling and browser close. The tests would fail if the request
handling completed first.
2021-06-10 16:42:45 -04:00
Marshall Greenblatt ecbeca36e7 Mac: Fix compile error due to multiply defined type (see issue #2421) 2021-06-10 16:42:44 -04:00
Marshall Greenblatt 00dca9601e Update to Chromium version 92.0.4515.0 (#885287) 2021-06-10 16:42:44 -04:00
Marshall Greenblatt f3ddec372f chrome: Fix ResourceRequestHandlerTest failures (see issue #2969) 2021-05-31 18:58:27 -04:00
Marshall Greenblatt e411b513be Add CefFrameHandler callbacks for tracking CefFrame lifespan (see issue #2421)
See the new cef_frame_handler.h for complete usage documentation.

This change includes the following related enhancements:
- The newly added CefBrowser::IsValid method will return false (in the browser
  process) after CefLifeSpanHandler::OnBeforeClose is called.
- CefBrowser::GetMainFrame will return a valid object (in the browser process)
  until after CefLifeSpanHandler::OnBeforeClose is called.
- The main frame object will change during cross-origin navigation or
  re-navigation after renderer process termination. During that time,
  GetMainFrame will return the new/pending frame (in the browser process) and
  any messages that arrive for the new/pending frame will be correctly
  attributed in OnProcessMessageReceived.
- Commands to be executed in the renderer process that may fail during early
  frame initialization (ExecuteJavaScript, LoadRequest, etc.) will now be
  queued until after the JavaScript context for the frame has been created.
- Logging has been added for any commands that are dropped because they arrived
  after frame detachment.
2021-05-31 18:58:27 -04:00
Marshall Greenblatt 21ac0be8d7 Update process message unit test expectations (see issue #3126)
See related comments in commit f3c513ba.
2021-05-20 14:56:23 -04:00
Marshall Greenblatt ff8f4a7217 Remove the TID_FILE default value
Clients should instead make an informed decision about which blocking thread
to use. See cef_thread_id_t documentation for guidance.
2021-05-19 17:42:51 -04:00
Marshall Greenblatt ebee84755e Convert legacy IPC messages to Mojo (fixes issue #3123)
This change introduces a few minor CEF API behavior changes:

- A CefProcessMessage object cannot be reused after being passed to
  SendProcessMessage.
- The |extra_info| argument to CefRenderProcessHandler::OnBrowserCreated may
  now be NULL.

Where appropriate, we now utilize the default UTF string encoding format and
shared memory to reduce copies and conversions for the cross-process
transfer of arbitrary-length strings. For example, CefFrame::GetSource/GetText
now involves zero UTF conversions and zero copies in the browser process for
the CefString delivered to CefStringVisitor::Visit().
2021-05-18 21:59:48 -04:00
Marshall Greenblatt 4f0b7b4511 chrome: ceftests: Avoid timeouts of ResourceManagerTest.ManyRequests (see issue #2969) 2021-05-18 15:35:42 -04:00
Marshall Greenblatt 3ab91a45c9 chrome: Support configuration of accept language (see issue #2969)
This change adds support for CEF settings configuration of accept_language_list.
If specified, this value will take precedence over the "intl.accept_languages"
preference which is controlled by chrome://settings/languages.
2021-04-28 13:12:09 -04:00
Marshall Greenblatt 511e10d594 ceftests: Add missing newline at end of file 2021-04-23 21:00:43 -04:00
Marshall Greenblatt 3c8507c4a3 Linux: cefclient: Don't use std::make_unique which requires C++14 2021-04-23 20:42:14 -04:00
Marshall Greenblatt ae4f68f695 Update to Chromium version 91.0.4472.0 (#870763) 2021-04-23 11:38:51 -04:00
Marshall Greenblatt a4d71d8fe2 cefclient: Fix slow loading of the Views image cache (see issue #2969) 2021-04-14 22:29:30 -04:00