diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/blink/public/web | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/public/web')
34 files changed, 471 insertions, 356 deletions
diff --git a/chromium/third_party/blink/public/web/DEPS b/chromium/third_party/blink/public/web/DEPS index f7bd2da76b9..1876ad2f492 100644 --- a/chromium/third_party/blink/public/web/DEPS +++ b/chromium/third_party/blink/public/web/DEPS @@ -1,5 +1,4 @@ include_rules = [ - "+base/callback.h", "+base/containers/span.h", "+base/files/file_path.h", "+base/i18n/rtl.h", @@ -24,6 +23,7 @@ include_rules = [ "+cc/trees/layer_tree_host_client.h", "+cc/trees/viewport_layers.h", "+components/viz/common/surfaces/frame_sink_id.h", + "+media/base", "+mojo/public", "+net/cookies/site_for_cookies.h", "+printing/mojom/print.mojom-shared.h", @@ -38,7 +38,9 @@ include_rules = [ "+services/network/public/mojom/ip_address_space.mojom-shared.h", "+services/network/public/mojom/referrer_policy.mojom-shared.h", "+services/network/public/mojom/url_loader.mojom-shared.h", + "+services/network/public/mojom/url_loader_factory.mojom-shared.h", "+services/service_manager/public", + "+ui/base/ime/ime_text_span.h", "+ui/events/types", "+ui/gfx/geometry", # Enforce to use mojom-shared.h in blink/public so that it can compile @@ -48,6 +50,7 @@ include_rules = [ "+ui/accessibility/ax_enums.mojom-shared.h", "+ui/accessibility/ax_event.h", "+ui/base/ime/mojom/ime_types.mojom-shared.h", + "+ui/base/ime/mojom/virtual_keyboard_types.mojom-shared.h", # Allowed only inside INSIDE_BLINK "+third_party/blink/renderer/core", diff --git a/chromium/third_party/blink/public/web/blink.h b/chromium/third_party/blink/public/web/blink.h index f2572a4d3f8..00de4f8d68f 100644 --- a/chromium/third_party/blink/public/web/blink.h +++ b/chromium/third_party/blink/public/web/blink.h @@ -104,6 +104,15 @@ BLINK_EXPORT void ForceNextWebGLContextCreationToFailForTest(); // context's ability to deal with that failure gracefully can be tested. BLINK_EXPORT void ForceNextDrawingBufferCreationToFailForTest(); +// Set whether this renderer process is "cross-origin isolated". This +// corresponds to agent cluster's "cross-origin isolated" concept. +// TODO(yhirano): Have the spec URL. +// This property is process global because we ensure that a renderer process +// host only cross-origin isolated agents or only non-cross-origin isolated +// agents, not both. +// This is called at most once. This is called earlier than any frame commit. +BLINK_EXPORT void SetIsCrossOriginIsolated(bool value); + } // namespace blink #endif diff --git a/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h b/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h index 48b0a365ae0..90967a518f4 100644 --- a/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h +++ b/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_source.h @@ -64,9 +64,16 @@ class BLINK_MODULES_EXPORT MediaStreamVideoSource ~MediaStreamVideoSource() override; // Returns the MediaStreamVideoSource object owned by |source|. + // + // TODO(https://crbug.com/714136): Replace uses of this method in favor of + // the variant below. static MediaStreamVideoSource* GetVideoSource( const WebMediaStreamSource& source); +#if INSIDE_BLINK + static MediaStreamVideoSource* GetVideoSource(MediaStreamSource* source); +#endif + // Puts |track| in the registered tracks list. void AddTrack(MediaStreamVideoTrack* track, const VideoTrackAdapterSettings& track_adapter_settings, diff --git a/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_track.h b/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_track.h index ccf2179b2c1..c859d75f7b0 100644 --- a/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_track.h +++ b/chromium/third_party/blink/public/web/modules/mediastream/media_stream_video_track.h @@ -45,11 +45,6 @@ class BLINK_MODULES_EXPORT MediaStreamVideoTrack MediaStreamVideoSource::ConstraintsOnceCallback callback, bool enabled); static blink::WebMediaStreamTrack CreateVideoTrack( - const blink::WebString& id, - MediaStreamVideoSource* source, - MediaStreamVideoSource::ConstraintsOnceCallback callback, - bool enabled); - static blink::WebMediaStreamTrack CreateVideoTrack( MediaStreamVideoSource* source, const VideoTrackAdapterSettings& adapter_settings, const base::Optional<bool>& noise_reduction, diff --git a/chromium/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h b/chromium/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h index 68b07295f9b..c2c9efba4d7 100644 --- a/chromium/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h +++ b/chromium/third_party/blink/public/web/modules/mediastream/webmediaplayer_ms.h @@ -114,6 +114,7 @@ class BLINK_MODULES_EXPORT WebMediaPlayerMS void SetRate(double rate) override; void SetVolume(double volume) override; void SetLatencyHint(double seconds) override; + void SetPreservesPitch(bool preserves_pitch) override; void OnRequestPictureInPicture() override; void OnPictureInPictureAvailabilityChanged(bool available) override; void SetSinkId(const WebString& sink_id, @@ -277,7 +278,7 @@ class BLINK_MODULES_EXPORT WebMediaPlayerMS void SetGpuMemoryBufferVideoForTesting( media::GpuMemoryBufferVideoFramePool* gpu_memory_buffer_pool); - // Callback used to fulfill video.requestAnimationFrame() requests. + // Callback used to fulfill video.requestVideoFrameCallback() requests. void OnNewFramePresentedCallback(); // Callback used to detect and propagate a render error. diff --git a/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_client.h b/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_client.h index cedb7e23cc0..48e3e7ecec6 100644 --- a/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_client.h +++ b/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_client.h @@ -35,9 +35,9 @@ #include "base/memory/scoped_refptr.h" #include "base/time/time.h" -#include "mojo/public/cpp/system/message_pipe.h" #include "services/network/public/mojom/url_loader.mojom-shared.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom-shared.h" +#include "third_party/blink/public/mojom/devtools/devtools_agent.mojom-shared.h" #include "third_party/blink/public/mojom/service_worker/service_worker_event_status.mojom-shared.h" #include "third_party/blink/public/mojom/web_feature/web_feature.mojom-shared.h" #include "third_party/blink/public/platform/cross_variant_mojo_util.h" @@ -79,8 +79,10 @@ class WebServiceWorkerContextClient { // ServiceWorker has prepared everything for script loading and is now ready // for DevTools inspection. Called on the initiator thread. virtual void WorkerReadyForInspectionOnInitiatorThread( - mojo::ScopedMessagePipeHandle devtools_agent_ptr_info, - mojo::ScopedMessagePipeHandle devtools_agent_host_request) {} + CrossVariantMojoRemote<mojom::DevToolsAgentInterfaceBase> + devtools_agent_remote, + CrossVariantMojoReceiver<mojom::DevToolsAgentHostInterfaceBase> + devtools_agent_host_receiver) {} // The worker started but it could not execute because fetching the classic // script failed on the worker thread. diff --git a/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h b/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h index 225b4165d2b..c9ef9dfc95e 100644 --- a/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h +++ b/chromium/third_party/blink/public/web/modules/service_worker/web_service_worker_context_proxy.h @@ -33,7 +33,9 @@ #include "base/time/time.h" #include "mojo/public/cpp/system/data_pipe.h" -#include "mojo/public/cpp/system/message_pipe.h" +#include "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom-shared.h" +#include "third_party/blink/public/mojom/service_worker/service_worker.mojom-shared.h" +#include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include <memory> @@ -49,11 +51,10 @@ class WebServiceWorkerContextProxy { virtual ~WebServiceWorkerContextProxy() = default; virtual void BindServiceWorker( - // A handle for mojo::PendingReceiver<mojom::ServiceWorker>. - mojo::ScopedMessagePipeHandle receiver_pipe) = 0; + CrossVariantMojoReceiver<mojom::ServiceWorkerInterfaceBase> receiver) = 0; virtual void BindControllerServiceWorker( - // A handle for mojo::PendingReceiver<mojom::ControllerServiceWorker>. - mojo::ScopedMessagePipeHandle receiver_pipe) = 0; + CrossVariantMojoReceiver<mojom::ControllerServiceWorkerInterfaceBase> + receiver) = 0; virtual void OnNavigationPreloadResponse( int fetch_event_id, diff --git a/chromium/third_party/blink/public/web/web_ax_object.h b/chromium/third_party/blink/public/web/web_ax_object.h index 653bc7a751c..b9bf20f29b2 100644 --- a/chromium/third_party/blink/public/web/web_ax_object.h +++ b/chromium/third_party/blink/public/web/web_ax_object.h @@ -146,6 +146,9 @@ class WebAXObject { BLINK_EXPORT bool IsLineBreakingObject() const; BLINK_EXPORT bool IsLinked() const; BLINK_EXPORT bool IsModal() const; + // Returns true if this object is an input element of a text field type, such + // as type="text" or type="tel", or a textarea. + BLINK_EXPORT bool IsNativeTextControl() const; BLINK_EXPORT bool IsOffScreen() const; BLINK_EXPORT bool IsSelectedOptionActive() const; BLINK_EXPORT bool IsVisited() const; diff --git a/chromium/third_party/blink/public/web/web_dom_message_event.h b/chromium/third_party/blink/public/web/web_dom_message_event.h index 7088f17d96a..b43c6db061c 100644 --- a/chromium/third_party/blink/public/web/web_dom_message_event.h +++ b/chromium/third_party/blink/public/web/web_dom_message_event.h @@ -58,11 +58,6 @@ class WebDOMMessageEvent : public WebDOMEvent { const WebFrame* source_frame = nullptr, const WebDocument& target_document = WebDocument(), WebVector<MessagePortChannel> ports = WebVector<MessagePortChannel>()); - BLINK_EXPORT WebDOMMessageEvent( - TransferableMessage, - const WebString& origin = WebString(), - const WebFrame* source_frame = nullptr, - const WebDocument& target_document = WebDocument()); WebDOMMessageEvent() = default; BLINK_EXPORT WebString Origin() const; @@ -71,11 +66,6 @@ class WebDOMMessageEvent : public WebDOMEvent { return locked_agent_cluster_id_; } - // The |encoded_message| in the returned message is only valid as long as this - // WebDOMMessageEvent is still valid, unless EnsureDataIsOwned is called on - // the returned message. - BLINK_EXPORT TransferableMessage AsMessage(); - #if INSIDE_BLINK explicit WebDOMMessageEvent( MessageEvent* e, diff --git a/chromium/third_party/blink/public/web/web_embedded_worker.h b/chromium/third_party/blink/public/web/web_embedded_worker.h index 06ba08c9475..2e9162a6cd1 100644 --- a/chromium/third_party/blink/public/web/web_embedded_worker.h +++ b/chromium/third_party/blink/public/web/web_embedded_worker.h @@ -33,7 +33,11 @@ #include <memory> -#include "mojo/public/cpp/system/message_pipe.h" +#include "third_party/blink/public/mojom/browser_interface_broker.mojom-shared.h" +#include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom-shared.h" +#include "third_party/blink/public/mojom/service_worker/service_worker_installed_scripts_manager.mojom-shared.h" +#include "third_party/blink/public/mojom/worker/worker_content_settings_proxy.mojom-shared.h" +#include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include "third_party/blink/public/platform/web_common.h" #include "third_party/blink/public/platform/web_vector.h" @@ -43,23 +47,25 @@ class WebServiceWorkerContextClient; class WebURL; struct WebEmbeddedWorkerStartData; -// As we're on the border line between non-Blink and Blink variants, we need -// to use mojo::ScopedMessagePipeHandle to pass Mojo types. struct BLINK_EXPORT WebServiceWorkerInstalledScriptsManagerParams { WebServiceWorkerInstalledScriptsManagerParams() = delete; WebServiceWorkerInstalledScriptsManagerParams( WebVector<WebURL> installed_scripts_urls, - mojo::ScopedMessagePipeHandle manager_receiver, - mojo::ScopedMessagePipeHandle manager_host_remote); + CrossVariantMojoReceiver< + mojom::ServiceWorkerInstalledScriptsManagerInterfaceBase> + manager_receiver, + CrossVariantMojoRemote< + mojom::ServiceWorkerInstalledScriptsManagerHostInterfaceBase> + manager_host_remote); ~WebServiceWorkerInstalledScriptsManagerParams() = default; WebVector<WebURL> installed_scripts_urls; - // A handle for - // mojo::PendingReceiver<mojom::blink::ServiceWorkerInstalledScriptsManager>. - mojo::ScopedMessagePipeHandle manager_receiver; - // A handle for - // mojo::PendingRemote<mojom::blink::ServiceWorkerInstalledScriptsManagerHost>. - mojo::ScopedMessagePipeHandle manager_host_remote; + CrossVariantMojoReceiver< + mojom::ServiceWorkerInstalledScriptsManagerInterfaceBase> + manager_receiver; + CrossVariantMojoRemote< + mojom::ServiceWorkerInstalledScriptsManagerHostInterfaceBase> + manager_host_remote; }; // An interface to start and terminate an embedded worker. @@ -78,9 +84,11 @@ class BLINK_EXPORT WebEmbeddedWorker { virtual void StartWorkerContext( std::unique_ptr<WebEmbeddedWorkerStartData>, std::unique_ptr<WebServiceWorkerInstalledScriptsManagerParams>, - mojo::ScopedMessagePipeHandle content_settings_handle, - mojo::ScopedMessagePipeHandle cache_storage, - mojo::ScopedMessagePipeHandle browser_interface_broker, + CrossVariantMojoRemote<mojom::WorkerContentSettingsProxyInterfaceBase> + content_settings, + CrossVariantMojoRemote<mojom::CacheStorageInterfaceBase> cache_storage, + CrossVariantMojoRemote<mojom::BrowserInterfaceBrokerInterfaceBase> + browser_interface_broker, scoped_refptr<base::SingleThreadTaskRunner> initiator_thread_task_runner) = 0; virtual void TerminateWorkerContext() = 0; diff --git a/chromium/third_party/blink/public/web/web_external_widget_client.h b/chromium/third_party/blink/public/web/web_external_widget_client.h index 8e5c214bac6..4d63d0fbb59 100644 --- a/chromium/third_party/blink/public/web/web_external_widget_client.h +++ b/chromium/third_party/blink/public/web/web_external_widget_client.h @@ -5,12 +5,15 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_EXTERNAL_WIDGET_CLIENT_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_EXTERNAL_WIDGET_CLIENT_H_ +#include <vector> + #include "cc/trees/layer_tree_host.h" #include "third_party/blink/public/platform/web_input_event_result.h" #include "ui/gfx/geometry/size.h" namespace blink { class WebCoalescedInputEvent; +class WebGestureEvent; // The interface from blink to Widgets with implementations outside of blink. class WebExternalWidgetClient { @@ -49,6 +52,49 @@ class WebExternalWidgetClient { // Notification that the BeginMainFrame completed, was committed into the // compositor (thread) and submitted to the display compositor. virtual void DidCommitAndDrawCompositorFrame() = 0; + + // Called before gesture events are processed and allows the + // client to handle the event itself. Return true if event was handled + // and further processing should stop. + virtual bool WillHandleGestureEvent(const WebGestureEvent& event) { + return false; + } + + virtual bool SupportsBufferedTouchEvents() { return false; } + + // Returns whether we handled a GestureScrollEvent. + virtual void DidHandleGestureScrollEvent( + const WebGestureEvent& gesture_event, + const gfx::Vector2dF& unused_delta, + const cc::OverscrollBehavior& overscroll_behavior, + bool event_processed) {} + + // Connect the Widget Input Handler to the channels provided. + virtual void GetWidgetInputHandler( + CrossVariantMojoReceiver<mojom::WidgetInputHandlerInterfaceBase> + widget_input_receiver, + CrossVariantMojoRemote<mojom::WidgetInputHandlerHostInterfaceBase> + widget_input_host_remote) {} + + // Since the widget input IPC channel is still on the content side send this + // message back to the embedder to then send it on that channel. All bounds + // are in window coordinates. + virtual void SendCompositionRangeChanged( + const gfx::Range& range, + const std::vector<gfx::Rect>& character_bounds) {} + + // The IME guard prevents sending IPC messages while messages are being + // processed. Returns true if there is a current guard. + // |request_to_show_virtual_keyboard| is whether the message that would have + // been sent would have requested the keyboard. This method will eventually be + // removed when all input handling is moved into blink. + virtual bool HasCurrentImeGuard(bool request_to_show_virtual_keyboard) { + return false; + } + + // The state of the focus has changed for the WebWidget. |enabled| + // is the new state. + virtual void FocusChanged(bool enabled) {} }; } // namespace blink diff --git a/chromium/third_party/blink/public/web/web_frame.h b/chromium/third_party/blink/public/web/web_frame.h index 0750d402b12..1fd3970fcbd 100644 --- a/chromium/third_party/blink/public/web/web_frame.h +++ b/chromium/third_party/blink/public/web/web_frame.h @@ -73,6 +73,8 @@ class BLINK_EXPORT WebFrame { // Returns the number of live WebFrame objects, used for leak checking. static int InstanceCount(); + static WebFrame* FromFrameToken(const base::UnguessableToken&); + virtual bool IsWebLocalFrame() const = 0; virtual WebLocalFrame* ToWebLocalFrame() = 0; virtual bool IsWebRemoteFrame() const = 0; diff --git a/chromium/third_party/blink/public/web/web_frame_widget.h b/chromium/third_party/blink/public/web/web_frame_widget.h index 6cc634179f6..af3d39a107e 100644 --- a/chromium/third_party/blink/public/web/web_frame_widget.h +++ b/chromium/third_party/blink/public/web/web_frame_widget.h @@ -31,11 +31,14 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_FRAME_WIDGET_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_FRAME_WIDGET_H_ +#include <stdint.h> + +#include "base/callback_forward.h" +#include "third_party/blink/public/common/page/web_drag_operation.h" #include "third_party/blink/public/mojom/page/widget.mojom-shared.h" #include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include "third_party/blink/public/platform/viewport_intersection_state.h" #include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_drag_operation.h" #include "third_party/blink/public/platform/web_touch_action.h" #include "third_party/blink/public/web/web_swap_result.h" #include "third_party/blink/public/web/web_widget.h" @@ -97,11 +100,12 @@ class WebFrameWidget : public WebWidget { const gfx::PointF& screen_point, WebDragOperationsMask operations_allowed, int modifiers) = 0; - virtual WebDragOperation DragTargetDragOver( + virtual void DragTargetDragOver( const gfx::PointF& point_in_viewport, const gfx::PointF& screen_point, WebDragOperationsMask operations_allowed, - int modifiers) = 0; + uint32_t modifiers, + base::OnceCallback<void(blink::WebDragOperation)> callback) = 0; virtual void DragTargetDragLeave(const gfx::PointF& point_in_viewport, const gfx::PointF& screen_point) = 0; virtual void DragTargetDrop(const WebDragData&, @@ -154,6 +158,28 @@ class WebFrameWidget : public WebWidget { WebReportTimeCallback swap_callback, WebReportTimeCallback presentation_callback) = 0; + // Instructs devtools to pause loading of the frame as soon as it's shown + // until explicit command from the devtools client. + virtual void WaitForDebuggerWhenShown() = 0; + + // Scales the text in the frame by a factor of text_zoom_factor. + virtual void SetTextZoomFactor(float text_zoom_factor) = 0; + // Returns the current text zoom factor, where 1.0 is the normal size, > 1.0 + // is scaled up and < 1.0 is scaled down. + virtual float TextZoomFactor() = 0; + + // Overlay this frame with a solid color. Only valid for the main frame's + // widget. + virtual void SetMainFrameOverlayColor(SkColor) = 0; + + // Add an edit command to be processed as the default action if the next + // keyboard event is unhandled. + virtual void AddEditCommandForNextKeyEvent(const WebString& name, + const WebString& value) = 0; + + // Clear any active edit commands that are pending. + virtual void ClearEditCommands() = 0; + private: // This private constructor and the class/friend declaration ensures that // WebFrameWidgetBase is the only concrete subclass that implements diff --git a/chromium/third_party/blink/public/web/web_ime_text_span.h b/chromium/third_party/blink/public/web/web_ime_text_span.h deleted file mode 100644 index bf1db07dad3..00000000000 --- a/chromium/third_party/blink/public/web/web_ime_text_span.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_IME_TEXT_SPAN_H_ -#define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_IME_TEXT_SPAN_H_ - -#include <string> -#include <vector> - -#include "third_party/skia/include/core/SkColor.h" -#include "ui/base/ime/mojom/ime_types.mojom-shared.h" - -namespace blink { - -// Class WebImeTextSpan is intended to be used with WebWidget's -// setComposition() method. -struct WebImeTextSpan { - enum class Type { - // Creates a composition marker. - kComposition, - // Creates a suggestion marker that isn't cleared after the user picks a - // replacement. - kSuggestion, - // Creates a suggestion marker that is cleared after the user picks a - // replacement, and will be ignored if added to an element with spell - // checking disabled. - kMisspellingSuggestion, - }; - - WebImeTextSpan() - : type(Type::kComposition), - start_offset(0), - end_offset(0), - thickness(ui::mojom::ImeTextSpanThickness::kThin), - underline_style(ui::mojom::ImeTextSpanUnderlineStyle::kSolid), - background_color(0), - suggestion_highlight_color(0), - suggestions(std::vector<std::string>()) {} - - WebImeTextSpan( - Type ty, - unsigned s, - unsigned e, - ui::mojom::ImeTextSpanThickness th, - ui::mojom::ImeTextSpanUnderlineStyle us, - SkColor bc, - SkColor shc = 0, - const std::vector<std::string>& su = std::vector<std::string>()) - : type(ty), - start_offset(s), - end_offset(e), - thickness(th), - underline_style(us), - background_color(bc), - suggestion_highlight_color(shc), - suggestions(su) {} - - bool operator<(const WebImeTextSpan& other) const { - return start_offset != other.start_offset - ? start_offset < other.start_offset - : end_offset < other.end_offset; - } - - // Need to update IPC_STRUCT_TRAITS_BEGIN(blink::WebImeTextSpan) - // if members change. - Type type; - unsigned start_offset; - unsigned end_offset; - SkColor underline_color = SK_ColorTRANSPARENT; - ui::mojom::ImeTextSpanThickness thickness; - ui::mojom::ImeTextSpanUnderlineStyle underline_style; - SkColor text_color = SK_ColorTRANSPARENT; - SkColor background_color; - SkColor suggestion_highlight_color; - bool remove_on_finish_composing; - std::vector<std::string> suggestions; -}; - -} // namespace blink - -#endif diff --git a/chromium/third_party/blink/public/web/web_input_method_controller.h b/chromium/third_party/blink/public/web/web_input_method_controller.h index f06ec0bfe7b..6686cfdc229 100644 --- a/chromium/third_party/blink/public/web/web_input_method_controller.h +++ b/chromium/third_party/blink/public/web/web_input_method_controller.h @@ -6,8 +6,8 @@ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_INPUT_METHOD_CONTROLLER_H_ #include "third_party/blink/public/platform/web_text_input_info.h" -#include "third_party/blink/public/web/web_ime_text_span.h" #include "third_party/blink/public/web/web_widget.h" +#include "ui/base/ime/ime_text_span.h" namespace blink { @@ -33,7 +33,7 @@ class WebInputMethodController { // current text which should be replaced by |text|. Returns true if the // composition text was set successfully. virtual bool SetComposition(const WebString& text, - const WebVector<WebImeTextSpan>& ime_text_spans, + const WebVector<ui::ImeTextSpan>& ime_text_spans, const WebRange& replacement_range, int selection_start, int selection_end) = 0; @@ -43,7 +43,7 @@ class WebInputMethodController { // |replacementRange| (when not null) is the range in current text which // should be replaced by |text|. virtual bool CommitText(const WebString& text, - const WebVector<WebImeTextSpan>& ime_text_spans, + const WebVector<ui::ImeTextSpan>& ime_text_spans, const WebRange& replacement_range, int relative_caret_position) = 0; @@ -89,9 +89,16 @@ class WebInputMethodController { // Returns true if the inputPanelPolicy flag is set as manual in // |EditContext|, which indicates that the software input panel(Virtual // Keyboard) shouldn't come up on focus of the EditControl. - virtual bool IsInputPanelPolicyManual() const = 0; + virtual bool IsVirtualKeyboardPolicyManual() const = 0; // Returns true if there is an active |EditContext|. virtual bool IsEditContextActive() const = 0; + + // Returns whether show()/hide() API is called from virtualkeyboard or not. + virtual ui::mojom::VirtualKeyboardVisibilityRequest + GetLastVirtualKeyboardVisibilityRequest() const = 0; + // Sets the VirtualKeyboard visibility request(show/hide/none). + virtual void SetVirtualKeyboardVisibilityRequest( + ui::mojom::VirtualKeyboardVisibilityRequest vk_visibility_request) = 0; }; } // namespace blink diff --git a/chromium/third_party/blink/public/web/web_local_frame.h b/chromium/third_party/blink/public/web/web_local_frame.h index 19a7338c005..2b6ac1ab437 100644 --- a/chromium/third_party/blink/public/web/web_local_frame.h +++ b/chromium/third_party/blink/public/web/web_local_frame.h @@ -19,6 +19,7 @@ #include "third_party/blink/public/common/frame/user_activation_update_source.h" #include "third_party/blink/public/common/messaging/transferable_message.h" #include "third_party/blink/public/mojom/ad_tagging/ad_frame.mojom-shared.h" +#include "third_party/blink/public/mojom/blob/blob_url_store.mojom-shared.h" #include "third_party/blink/public/mojom/commit_result/commit_result.mojom-shared.h" #include "third_party/blink/public/mojom/devtools/devtools_agent.mojom-shared.h" #include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-shared.h" @@ -37,7 +38,6 @@ #include "third_party/blink/public/web/web_document_loader.h" #include "third_party/blink/public/web/web_frame.h" #include "third_party/blink/public/web/web_frame_load_type.h" -#include "third_party/blink/public/web/web_ime_text_span.h" #include "third_party/blink/public/web/web_navigation_params.h" #include "v8/include/v8.h" @@ -45,6 +45,10 @@ namespace gfx { class Point; } // namespace gfx +namespace ui { +struct ImeTextSpan; +} // namespace ui + namespace blink { class FrameScheduler; @@ -58,6 +62,7 @@ class WebLocalFrameClient; class WebFrameWidget; class WebInputMethodController; class WebPerformance; +class WebPlugin; class WebRange; class WebSecurityOrigin; class WebScriptExecutionCallback; @@ -200,9 +205,9 @@ class WebLocalFrame : public WebFrame { virtual void SetEmbeddingToken( const base::UnguessableToken& embedding_token) = 0; - // Returns the embedding token for this frame or nullopt if it isn't embedded. - // This is the token that the remote parent of this frame uses to uniquely - // identify it. + // Returns the embedding token for this frame or nullopt if the frame hasn't + // committed a navigation. This token changes when a new document is committed + // in this WebLocalFrame. virtual const base::Optional<base::UnguessableToken>& GetEmbeddingToken() = 0; // Navigation Ping -------------------------------------------------------- @@ -239,7 +244,8 @@ class WebLocalFrame : public WebFrame { virtual void DownloadURL( const WebURLRequest& request, network::mojom::RedirectMode cross_origin_redirect_behavior, - mojo::ScopedMessagePipeHandle blob_url_token) = 0; + CrossVariantMojoRemote<mojom::BlobURLTokenInterfaceBase> + blob_url_token) = 0; // Navigation State ------------------------------------------------------- @@ -264,6 +270,7 @@ class WebLocalFrame : public WebFrame { const WebURL& mixed_content_url, mojom::RequestContextType, bool was_allowed, + const WebURL& url_before_redirects, bool had_redirect, const WebSourceLocation&) = 0; @@ -312,9 +319,18 @@ class WebLocalFrame : public WebFrame { // Sets up an isolated world by associating a |world_id| with |info|. // worldID must be > 0 (as 0 represents the main world). // worldID must be < kEmbedderWorldIdLimit, high number used internally. + // TODO(karandeepb): This modifies the global isolated world info and hence + // should ideally be moved out of WebLocalFrame. virtual void SetIsolatedWorldInfo(int32_t world_id, const WebIsolatedWorldInfo& info) = 0; + // Returns the stable ID that was set with SetIsolatedWorldInfo. + virtual WebString GetIsolatedWorldStableId(v8::Local<v8::Context>) const = 0; + + // Returns the human readable name that was set with SetIsolatedWorldInfo. + virtual WebString GetIsolatedWorldHumanReadableName( + v8::Local<v8::Context>) const = 0; + // Executes script in the context of the current page and returns the value // that the script evaluated to. // DEPRECATED: Use WebLocalFrame::requestExecuteScriptAndReturnValue. @@ -336,6 +352,10 @@ class WebLocalFrame : public WebFrame { // be calling this API. virtual v8::Local<v8::Context> MainWorldScriptContext() const = 0; + // Returns the world ID associated with |script_context|. + virtual int32_t GetScriptContextWorldId( + v8::Local<v8::Context> script_context) const = 0; + // Executes script in the context of the current page and returns the value // that the script evaluated to with callback. Script execution can be // suspend. @@ -425,7 +445,8 @@ class WebLocalFrame : public WebFrame { // (i.e its anchor is its start). virtual bool IsSelectionAnchorFirst() const = 0; // Changes the text direction of the selected input node. - virtual void SetTextDirection(base::i18n::TextDirection) = 0; + virtual void SetTextDirectionForTesting( + base::i18n::TextDirection direction) = 0; // Selection ----------------------------------------------------------- @@ -475,7 +496,7 @@ class WebLocalFrame : public WebFrame { virtual bool SetCompositionFromExistingText( int composition_start, int composition_end, - const WebVector<WebImeTextSpan>& ime_text_spans) = 0; + const WebVector<ui::ImeTextSpan>& ime_text_spans) = 0; virtual void ExtendSelectionAndDelete(int before, int after) = 0; // Moves the selection extent point. This function does not allow the @@ -549,7 +570,7 @@ class WebLocalFrame : public WebFrame { const WebString& search_text, bool match_case, bool forward, - bool find_next, + bool new_session, bool force, bool wrap_within_frame) = 0; @@ -650,13 +671,16 @@ class WebLocalFrame : public WebFrame { // This function should be called before pairs of PrintBegin() and PrintEnd(). virtual void DispatchBeforePrintEvent() = 0; + // Get the plugin to print, if any. The |constrain_to_node| parameter is the + // same as the one for PrintBegin() below. + virtual WebPlugin* GetPluginToPrint(const WebNode& constrain_to_node) = 0; + // Reformats the WebFrame for printing. WebPrintParams specifies the printable // content size, paper size, printable area size, printer DPI and print - // scaling option. If constrainToNode node is specified, then only the given + // scaling option. If |constrain_to_node| is specified, then only the given // node is printed (for now only plugins are supported), instead of the entire // frame. - // Returns the number of pages that can be printed at the given - // page size. + // Returns the number of pages that can be printed at the given page size. virtual int PrintBegin(const WebPrintParams&, const WebNode& constrain_to_node = WebNode()) = 0; @@ -685,14 +709,12 @@ class WebLocalFrame : public WebFrame { // Paint Preview ------------------------------------------------------------ - // Captures a full frame paint preview of the WebFrame including subframes. + // Captures a full frame paint preview of the WebFrame including subframes. If + // |include_linked_destinations| is true, the capture will include annotations + // about linked destinations within the document. virtual bool CapturePaintPreview(const WebRect& bounds, - cc::PaintCanvas* canvas) = 0; - - // FrameOverlay ---------------------------------------------------------- - - // Overlay this frame with a solid color. Only valid for the main frame. - virtual void SetMainFrameOverlayColor(SkColor) = 0; + cc::PaintCanvas* canvas, + bool include_linked_destinations) = 0; // Focus -------------------------------------------------------------- @@ -730,17 +752,21 @@ class WebLocalFrame : public WebFrame { UserActivationUpdateSource update_source = UserActivationUpdateSource::kRenderer) = 0; - // DevTools ----------------------------------------------------------------- - - // Instructs devtools to pause loading of the frame as soon as it's shown - // until explicit command from the devtools client. - virtual void WaitForDebuggerWhenShown() = 0; - // Testing ------------------------------------------------------------------ + // Get the total spool size (the bounding box of all the pages placed after + // oneanother vertically), when printing for testing. Even if we still only + // support a uniform page size, some pages may be rotated using + // page-orientation. + virtual WebSize SpoolSizeInPixelsForTesting( + const WebSize& page_size_in_pixels, + int page_count) = 0; + // Prints the frame into the canvas, with page boundaries drawn as one pixel // wide blue lines. This method exists to support web tests. - virtual void PrintPagesForTesting(cc::PaintCanvas*, const WebSize&) = 0; + virtual void PrintPagesForTesting(cc::PaintCanvas*, + const WebSize& page_size_in_pixels, + const WebSize& spool_size_in_pixels) = 0; // Returns the bounds rect for current selection. If selection is performed // on transformed text, the rect will still bound the selection but will @@ -752,8 +778,6 @@ class WebLocalFrame : public WebFrame { // local root). virtual gfx::Point GetPositionInViewportForTesting() const = 0; - virtual void SetLifecycleState(mojom::FrameLifecycleState state) = 0; - virtual void WasHidden() = 0; virtual void WasShown() = 0; diff --git a/chromium/third_party/blink/public/web/web_local_frame_client.h b/chromium/third_party/blink/public/web/web_local_frame_client.h index 772f7242ff4..f0a05ead42b 100644 --- a/chromium/third_party/blink/public/web/web_local_frame_client.h +++ b/chromium/third_party/blink/public/web/web_local_frame_client.h @@ -37,6 +37,7 @@ #include "base/i18n/rtl.h" #include "base/optional.h" #include "base/unguessable_token.h" +#include "media/base/speech_recognition_client.h" #include "services/network/public/mojom/web_sandbox_flags.mojom-shared.h" #include "third_party/blink/public/common/feature_policy/feature_policy.h" #include "third_party/blink/public/common/loader/loading_behavior_flag.h" @@ -155,6 +156,13 @@ class BLINK_EXPORT WebLocalFrameClient { return nullptr; } + // May return null. + virtual std::unique_ptr<media::SpeechRecognitionClient> + CreateSpeechRecognitionClient( + media::SpeechRecognitionClient::OnReadyCallback callback) { + return nullptr; + } + // Returns a new WebWorkerFetchContext for a dedicated worker (in the // non-PlzDedicatedWorker case) or worklet. virtual scoped_refptr<WebWorkerFetchContext> CreateWorkerFetchContext() { @@ -229,10 +237,6 @@ class BLINK_EXPORT WebLocalFrameClient { // from outside of the browsing instance. virtual WebFrame* FindFrame(const WebString& name) { return nullptr; } - // This frame has set its opener to another frame, or disowned the opener - // if opener is null. See http://html.spec.whatwg.org/#dom-opener. - virtual void DidChangeOpener(WebFrame*) {} - // Specifies the reason for the detachment. enum class DetachType { kRemove, kSwap }; @@ -245,11 +249,6 @@ class BLINK_EXPORT WebLocalFrameClient { // This frame's name has changed. virtual void DidChangeName(const WebString& name) {} - // The sandbox flags or container policy have changed for a child frame of - // this frame. - virtual void DidChangeFramePolicy(WebFrame* child_frame, const FramePolicy&) { - } - // Called when a Feature-Policy or Document-Policy or Content-Security-Policy // HTTP header (for sandbox flags) is encountered while loading the frame's // document. @@ -430,15 +429,6 @@ class BLINK_EXPORT WebLocalFrameClient { virtual void DidChangeSelection(bool is_selection_empty) {} virtual void DidChangeContents() {} - // This method is called in response to handleInputEvent() when the - // default action for the current keyboard event is not suppressed by the - // page, to give the embedder a chance to handle the keyboard event - // specially. - // - // Returns true if the keyboard event was handled by the embedder, - // indicating that the default action should be suppressed. - virtual bool HandleCurrentKeyboardEvent() { return false; } - // UI ------------------------------------------------------------------ // Shows a context menu with commands relevant to a specific element on @@ -490,6 +480,14 @@ class BLINK_EXPORT WebLocalFrameClient { // An Input Event observed. virtual void DidObserveInputDelay(base::TimeDelta input_delay) {} + // The first scroll delay, which measures the time between the user's first + // scrolling and the resultant display update, has been observed. + // The first scroll timestamp is when the first scroll event was created which + // is the hardware timestamp provided by the host OS. + virtual void DidObserveFirstScrollDelay( + base::TimeDelta first_scroll_delay, + base::TimeTicks first_scroll_timestamp) {} + // A cpu task or tasks completed. Triggered when at least 100ms of wall time // was spent in tasks on the frame. virtual void DidChangeCpuTiming(base::TimeDelta time) {} @@ -676,6 +674,14 @@ class BLINK_EXPORT WebLocalFrameClient { virtual bool GetCaretBoundsFromFocusedPlugin(gfx::Rect& rect) { return false; } + + // Called by WebFrameWidgetBase, it submits throughput data to the browser + // process. The browser process aggregates the data and eventually reports to + // the UKM. + virtual void SubmitThroughputData(ukm::SourceId source_id, + int aggregated_percent, + int impl_percent, + base::Optional<int> main_percent) {} }; } // namespace blink diff --git a/chromium/third_party/blink/public/web/web_navigation_control.h b/chromium/third_party/blink/public/web/web_navigation_control.h index 0591ac71993..5f15979d36c 100644 --- a/chromium/third_party/blink/public/web/web_navigation_control.h +++ b/chromium/third_party/blink/public/web/web_navigation_control.h @@ -82,23 +82,12 @@ class WebNavigationControl : public WebLocalFrame { // This runs some JavaScript event listeners, which may cancel the navigation // or detach the frame. In this case the method returns false and client // should not proceed with the navigation. - virtual bool WillStartNavigation( - const WebNavigationInfo&, - bool is_history_navigation_in_new_child_frame) = 0; + virtual bool WillStartNavigation(const WebNavigationInfo&) = 0; // Informs the frame that the navigation it asked the client to do was // dropped. virtual void DidDropNavigation() = 0; - // Marks the frame as loading, without performing any loading. Used for - // initial history navigations in child frames, which may actually happen - // in another process. - virtual void MarkAsLoading() = 0; - - // TODO(ahemery): Remove all IsClientNavigationInitialHistoryLoad functions - // when IsPerNavigationMojoInterface is enabled. - virtual bool IsClientNavigationInitialHistoryLoad() = 0; - protected: explicit WebNavigationControl(mojom::TreeScopeType scope, const base::UnguessableToken& frame_token) diff --git a/chromium/third_party/blink/public/web/web_navigation_params.h b/chromium/third_party/blink/public/web/web_navigation_params.h index 3f21cf93092..62d8c3d12fe 100644 --- a/chromium/third_party/blink/public/web/web_navigation_params.h +++ b/chromium/third_party/blink/public/web/web_navigation_params.h @@ -11,11 +11,12 @@ #include "base/optional.h" #include "base/time/time.h" #include "base/unguessable_token.h" -#include "mojo/public/cpp/system/message_pipe.h" #include "services/network/public/mojom/ip_address_space.mojom-shared.h" #include "services/network/public/mojom/referrer_policy.mojom-shared.h" +#include "services/network/public/mojom/url_loader_factory.mojom-shared.h" #include "third_party/blink/public/common/frame/frame_policy.h" #include "third_party/blink/public/common/navigation/triggering_event_info.h" +#include "third_party/blink/public/mojom/blob/blob_url_store.mojom-shared.h" #include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-shared.h" #include "third_party/blink/public/mojom/frame/navigation_initiator.mojom-shared.h" #include "third_party/blink/public/platform/cross_variant_mojo_util.h" @@ -128,7 +129,7 @@ struct BLINK_EXPORT WebNavigationInfo { network::mojom::CSPDisposition::CHECK; // When navigating to a blob url, this token specifies the blob. - mojo::ScopedMessagePipeHandle blob_url_token; + CrossVariantMojoRemote<mojom::BlobURLTokenInterfaceBase> blob_url_token; // When navigation initiated from the user input, this tracks // the input start time. @@ -352,14 +353,16 @@ struct BLINK_EXPORT WebNavigationParams { const WebString& header_integrity, const WebURL& inner_url, const WebURLResponse& inner_response, - mojo::ScopedMessagePipeHandle loader_factory_handle); + CrossVariantMojoRemote<network::mojom::URLLoaderFactoryInterfaceBase> + loader_factory); ~PrefetchedSignedExchange(); WebURL outer_url; WebString header_integrity; WebURL inner_url; WebURLResponse inner_response; - mojo::ScopedMessagePipeHandle loader_factory_handle; + CrossVariantMojoRemote<network::mojom::URLLoaderFactoryInterfaceBase> + loader_factory; }; WebVector<std::unique_ptr<PrefetchedSignedExchange>> prefetched_signed_exchanges; @@ -387,6 +390,9 @@ struct BLINK_EXPORT WebNavigationParams { // A list of origin trial names to enable for the document being loaded. WebVector<WebString> force_enabled_origin_trials; + + // Whether origin isolation is restricting certain cross-origin web APIs. + bool origin_isolation_restricted = false; }; } // namespace blink diff --git a/chromium/third_party/blink/public/web/web_performance.h b/chromium/third_party/blink/public/web/web_performance.h index ab7c1b2fb32..2da8d142046 100644 --- a/chromium/third_party/blink/public/web/web_performance.h +++ b/chromium/third_party/blink/public/web/web_performance.h @@ -34,6 +34,7 @@ #include "base/time/time.h" #include "third_party/blink/public/platform/web_common.h" #include "third_party/blink/public/platform/web_private_ptr.h" +#include "third_party/blink/public/platform/web_vector.h" #include "third_party/blink/public/web/web_navigation_type.h" #if INSIDE_BLINK @@ -46,6 +47,15 @@ class WindowPerformance; class WebPerformance { public: + struct BackForwardCacheRestoreTiming { + double navigation_start = 0; + double first_paint = 0; + base::Optional<base::TimeDelta> first_input_delay; + }; + + using BackForwardCacheRestoreTimings = + WebVector<BackForwardCacheRestoreTiming>; + ~WebPerformance() { Reset(); } WebPerformance() = default; @@ -68,6 +78,7 @@ class WebPerformance { BLINK_EXPORT double InputForNavigationStart() const; BLINK_EXPORT double NavigationStart() const; BLINK_EXPORT base::TimeTicks NavigationStartAsMonotonicTime() const; + BLINK_EXPORT BackForwardCacheRestoreTimings BackForwardCacheRestore() const; BLINK_EXPORT double UnloadEventEnd() const; BLINK_EXPORT double RedirectStart() const; BLINK_EXPORT double RedirectEnd() const; @@ -97,11 +108,19 @@ class WebPerformance { BLINK_EXPORT uint64_t LargestImagePaintSize() const; BLINK_EXPORT double LargestTextPaint() const; BLINK_EXPORT uint64_t LargestTextPaintSize() const; + BLINK_EXPORT double ExperimentalLargestImagePaint() const; + BLINK_EXPORT uint64_t ExperimentalLargestImagePaintSize() const; + BLINK_EXPORT double ExperimentalLargestTextPaint() const; + BLINK_EXPORT uint64_t ExperimentalLargestTextPaintSize() const; + BLINK_EXPORT double FirstEligibleToPaint() const; BLINK_EXPORT double FirstInputOrScrollNotifiedTimestamp() const; BLINK_EXPORT base::Optional<base::TimeDelta> FirstInputDelay() const; BLINK_EXPORT base::Optional<base::TimeDelta> FirstInputTimestamp() const; BLINK_EXPORT base::Optional<base::TimeDelta> LongestInputDelay() const; BLINK_EXPORT base::Optional<base::TimeDelta> LongestInputTimestamp() const; + BLINK_EXPORT base::Optional<base::TimeDelta> FirstInputProcessingTime() const; + BLINK_EXPORT base::Optional<base::TimeDelta> FirstScrollDelay() const; + BLINK_EXPORT base::Optional<base::TimeDelta> FirstScrollTimestamp() const; BLINK_EXPORT double ParseStart() const; BLINK_EXPORT double ParseStop() const; BLINK_EXPORT double ParseBlockedOnScriptLoadDuration() const; @@ -109,6 +128,7 @@ class WebPerformance { BLINK_EXPORT double ParseBlockedOnScriptExecutionDuration() const; BLINK_EXPORT double ParseBlockedOnScriptExecutionFromDocumentWriteDuration() const; + BLINK_EXPORT base::Optional<base::TimeTicks> LastPortalActivatedPaint() const; #if INSIDE_BLINK BLINK_EXPORT WebPerformance(WindowPerformance*); diff --git a/chromium/third_party/blink/public/web/web_plugin.h b/chromium/third_party/blink/public/web/web_plugin.h index dc1ac534d4c..5fc43caba29 100644 --- a/chromium/third_party/blink/public/web/web_plugin.h +++ b/chromium/third_party/blink/public/web/web_plugin.h @@ -33,8 +33,8 @@ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PLUGIN_H_ #include "cc/paint/paint_canvas.h" +#include "third_party/blink/public/common/page/web_drag_operation.h" #include "third_party/blink/public/mojom/input/focus_type.mojom-shared.h" -#include "third_party/blink/public/platform/web_drag_operation.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/web/web_drag_status.h" @@ -47,6 +47,7 @@ class PointF; namespace ui { class Cursor; +struct ImeTextSpan; } namespace blink { @@ -55,7 +56,6 @@ class WebCoalescedInputEvent; class WebDragData; class WebPluginContainer; class WebURLResponse; -struct WebImeTextSpan; struct WebPrintParams; struct WebPrintPresetOptions; struct WebRect; @@ -103,7 +103,6 @@ class WebPlugin { } virtual bool SupportsKeyboardFocus() const { return false; } - virtual bool SupportsEditCommands() const { return false; } // Returns true if this plugin supports input method, which implements // setComposition(), commitText() and finishComposingText() below. virtual bool SupportsInputMethod() const { return false; } @@ -180,7 +179,7 @@ class WebPlugin { // composition is set successfully. If |replacementRange| is not null, the // text inside |replacementRange| will be replaced by |text| virtual bool SetComposition(const WebString& text, - const WebVector<WebImeTextSpan>& ime_text_spans, + const WebVector<ui::ImeTextSpan>& ime_text_spans, const WebRange& replacement_range, int selection_start, int selection_end) { @@ -191,7 +190,7 @@ class WebPlugin { // moves the caret according to relativeCaretPosition. If |replacementRange| // is not null, the text inside |replacementRange| will be replaced by |text|. virtual bool CommitText(const WebString& text, - const WebVector<WebImeTextSpan>& ime_text_spans, + const WebVector<ui::ImeTextSpan>& ime_text_spans, const WebRange& replacement_range, int relative_caret_position) { return false; diff --git a/chromium/third_party/blink/public/web/web_print_page_description.h b/chromium/third_party/blink/public/web/web_print_page_description.h index e7447bd9966..5b8b0c50a41 100644 --- a/chromium/third_party/blink/public/web/web_print_page_description.h +++ b/chromium/third_party/blink/public/web/web_print_page_description.h @@ -5,6 +5,7 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PRINT_PAGE_DESCRIPTION_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PRINT_PAGE_DESCRIPTION_H_ +#include "third_party/blink/public/common/css/page_orientation.h" #include "third_party/blink/public/platform/web_double_size.h" namespace blink { @@ -16,6 +17,7 @@ struct WebPrintPageDescription { int margin_right = 0; int margin_bottom = 0; int margin_left = 0; + PageOrientation orientation = PageOrientation::kUpright; }; } // namespace blink diff --git a/chromium/third_party/blink/public/web/web_print_params.h b/chromium/third_party/blink/public/web/web_print_params.h index 1809e2574e3..5ecbff4d4b4 100644 --- a/chromium/third_party/blink/public/web/web_print_params.h +++ b/chromium/third_party/blink/public/web/web_print_params.h @@ -31,9 +31,9 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PRINT_PARAMS_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PRINT_PARAMS_H_ +#include "printing/mojom/print.mojom-shared.h" #include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/platform/web_size.h" -#include "third_party/blink/public/web/web_print_scaling_option.h" namespace blink { @@ -59,8 +59,8 @@ struct WebPrintParams { // Specifies whether to reduce/enlarge/retain the print contents to fit the // printable area. (This is used only by plugin printing). - WebPrintScalingOption print_scaling_option = - kWebPrintScalingOptionFitToPrintableArea; + printing::mojom::PrintScalingOption print_scaling_option = + printing::mojom::PrintScalingOption::kFitToPrintableArea; // Specifies whether printing layout needs to be applied. bool use_printing_layout = true; @@ -77,7 +77,7 @@ struct WebPrintParams { : print_content_area(WebRect(0, 0, paper_size.width, paper_size.height)), printable_area(print_content_area), paper_size(paper_size), - print_scaling_option(kWebPrintScalingOptionSourceSize), + print_scaling_option(printing::mojom::PrintScalingOption::kSourceSize), use_printing_layout(use_printing_layout) {} }; diff --git a/chromium/third_party/blink/public/web/web_print_scaling_option.h b/chromium/third_party/blink/public/web/web_print_scaling_option.h deleted file mode 100644 index 044bde7bb86..00000000000 --- a/chromium/third_party/blink/public/web/web_print_scaling_option.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PRINT_SCALING_OPTION_H_ -#define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PRINT_SCALING_OPTION_H_ - -namespace blink { - -enum WebPrintScalingOption { - kWebPrintScalingOptionNone, // Prints the upper left of a page without - // scaling. Crop the page contents that don't fit - // on the paper. - kWebPrintScalingOptionFitToPrintableArea, // Reduces or enlarges each page to - // fit the printable area of the - // selected printer paper size. - kWebPrintScalingOptionSourceSize, // Print output page size is same as the - // actual source page size. Do not - // scale/center/fit to printable area. - kWebPrintScalingOptionFitToPaper, // Reduces or enlarges each page to fit the - // selected printer paper size. - kWebPrintScalingOptionLast = kWebPrintScalingOptionFitToPaper -}; - -} // namespace blink - -#endif diff --git a/chromium/third_party/blink/public/web/web_remote_frame.h b/chromium/third_party/blink/public/web/web_remote_frame.h index 6854f0d9254..818a048b585 100644 --- a/chromium/third_party/blink/public/web/web_remote_frame.h +++ b/chromium/third_party/blink/public/web/web_remote_frame.h @@ -146,11 +146,6 @@ class WebRemoteFrame : public WebFrame { // "local" frame tree (ancestors-only vs all-nodes). virtual void UpdateUserActivationState(mojom::UserActivationUpdateType) = 0; - // Transfers user activation state from |source_frame| to this frame, which - // must be in the same frame tree as |source_frame|. - virtual void TransferUserActivationFrom( - blink::WebRemoteFrame* source_frame) = 0; - virtual void SetHadStickyUserActivationBeforeNavigation(bool value) = 0; virtual WebRect GetCompositingRect() = 0; diff --git a/chromium/third_party/blink/public/web/web_remote_frame_client.h b/chromium/third_party/blink/public/web/web_remote_frame_client.h index c3ae4ec21a0..99f3495ec6f 100644 --- a/chromium/third_party/blink/public/web/web_remote_frame_client.h +++ b/chromium/third_party/blink/public/web/web_remote_frame_client.h @@ -7,8 +7,11 @@ #include "base/optional.h" #include "cc/paint/paint_canvas.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" +#include "third_party/blink/public/mojom/blob/blob_url_store.mojom-shared.h" #include "third_party/blink/public/mojom/frame/lifecycle.mojom-shared.h" #include "third_party/blink/public/mojom/input/focus_type.mojom-shared.h" +#include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include "third_party/blink/public/platform/viewport_intersection_state.h" #include "third_party/blink/public/platform/web_impression.h" #include "third_party/blink/public/platform/web_security_origin.h" @@ -29,22 +32,17 @@ class WebRemoteFrameClient { // and release any resources associated with it. virtual void FrameDetached(DetachType) {} - // Notifies the embedder that a postMessage was issued to a remote frame. - virtual void ForwardPostMessage(WebLocalFrame* source_frame, - WebRemoteFrame* target_frame, - WebSecurityOrigin target_origin, - WebDOMMessageEvent) {} - // A remote frame was asked to start a navigation. - virtual void Navigate(const WebURLRequest& request, - blink::WebLocalFrame* initiator_frame, - bool should_replace_current_entry, - bool is_opener_navigation, - bool initiator_frame_has_download_sandbox_flag, - bool blocking_downloads_in_sandbox_enabled, - bool initiator_frame_is_ad, - mojo::ScopedMessagePipeHandle blob_url_token, - const base::Optional<WebImpression>& impression) {} + virtual void Navigate( + const WebURLRequest& request, + blink::WebLocalFrame* initiator_frame, + bool should_replace_current_entry, + bool is_opener_navigation, + bool initiator_frame_has_download_sandbox_flag, + bool blocking_downloads_in_sandbox_enabled, + bool initiator_frame_is_ad, + CrossVariantMojoRemote<mojom::BlobURLTokenInterfaceBase> blob_url_token, + const base::Optional<WebImpression>& impression) {} virtual void FrameRectsChanged(const WebRect& local_frame_rect, const WebRect& screen_space_rect) {} @@ -52,13 +50,9 @@ class WebRemoteFrameClient { virtual void UpdateRemoteViewportIntersection( const ViewportIntersectionState& intersection_state) {} - // This frame updated its opener to another frame. - virtual void DidChangeOpener(WebFrame* opener) {} - - // Continue sequential focus navigation in this frame. This is called when - // the |source| frame is searching for the next focusable element (e.g., in - // response to <tab>) and encounters a remote frame. - virtual void AdvanceFocus(mojom::FocusType type, WebLocalFrame* source) {} + // Returns an AssociatedInterfaceProvider the frame can use to request + // associated interfaces from the browser. + virtual AssociatedInterfaceProvider* GetRemoteAssociatedInterfaces() = 0; // Returns token to be used as a frame id in the devtools protocol. // It is derived from the content's devtools_frame_token, is diff --git a/chromium/third_party/blink/public/web/web_savable_resources_test_support.h b/chromium/third_party/blink/public/web/web_savable_resources_test_support.h new file mode 100644 index 00000000000..8281f5c4359 --- /dev/null +++ b/chromium/third_party/blink/public/web/web_savable_resources_test_support.h @@ -0,0 +1,21 @@ +// Copyright (c) 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SAVABLE_RESOURCES_TEST_SUPPORT_H_ +#define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SAVABLE_RESOURCES_TEST_SUPPORT_H_ + +#include "base/macros.h" +#include "third_party/blink/public/platform/web_common.h" + +namespace blink { + +class WebString; +class WebElement; + +BLINK_EXPORT WebString +GetSubResourceLinkFromElementForTesting(const WebElement& element); + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SAVABLE_RESOURCES_TEST_SUPPORT_H_ diff --git a/chromium/third_party/blink/public/web/web_settings.h b/chromium/third_party/blink/public/web/web_settings.h index 51ec819969e..b3a40076827 100644 --- a/chromium/third_party/blink/public/web/web_settings.h +++ b/chromium/third_party/blink/public/web/web_settings.h @@ -219,7 +219,6 @@ class WebSettings { UScriptCode = USCRIPT_COMMON) = 0; virtual void SetShouldPrintBackgrounds(bool) = 0; virtual void SetShouldClearDocumentBackground(bool) = 0; - virtual void SetShouldRespectImageOrientation(bool) = 0; virtual void SetShowContextMenuOnMouseUp(bool) = 0; virtual void SetShrinksViewportContentToFit(bool) = 0; virtual void SetSmartInsertDeleteEnabled(bool) = 0; @@ -297,6 +296,7 @@ class WebSettings { virtual void SetForceDarkModeEnabled(bool) = 0; virtual void SetPreferredColorScheme(PreferredColorScheme) = 0; virtual void SetNavigationControls(NavigationControls) = 0; + virtual void SetAriaModalPrunesAXTree(bool) = 0; protected: ~WebSettings() = default; diff --git a/chromium/third_party/blink/public/web/web_shared_worker.h b/chromium/third_party/blink/public/web/web_shared_worker.h index c2dd48dca42..a9f68c0f90f 100644 --- a/chromium/third_party/blink/public/web/web_shared_worker.h +++ b/chromium/third_party/blink/public/web/web_shared_worker.h @@ -34,12 +34,14 @@ #include <memory> #include "base/unguessable_token.h" -#include "mojo/public/cpp/system/message_pipe.h" #include "services/network/public/mojom/content_security_policy.mojom-shared.h" #include "services/network/public/mojom/fetch_api.mojom-shared.h" #include "services/network/public/mojom/ip_address_space.mojom-shared.h" #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" +#include "third_party/blink/public/mojom/browser_interface_broker.mojom-shared.h" #include "third_party/blink/public/mojom/script/script_type.mojom-shared.h" +#include "third_party/blink/public/mojom/worker/worker_content_settings_proxy.mojom-shared.h" +#include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include "third_party/blink/public/platform/task_type.h" #include "third_party/blink/public/platform/web_common.h" #include "third_party/blink/public/platform/web_security_origin.h" @@ -75,8 +77,10 @@ class BLINK_EXPORT WebSharedWorker { const WebFetchClientSettingsObject& outside_fetch_client_settings_object, const base::UnguessableToken& appcache_host_id, const base::UnguessableToken& devtools_worker_token, - mojo::ScopedMessagePipeHandle content_settings_handle, - mojo::ScopedMessagePipeHandle browser_interface_broker, + CrossVariantMojoRemote<mojom::WorkerContentSettingsProxyInterfaceBase> + content_settings, + CrossVariantMojoRemote<mojom::BrowserInterfaceBrokerInterfaceBase> + browser_interface_broker, bool pause_worker_context_on_start) = 0; // Sends a connect event to the SharedWorker context. diff --git a/chromium/third_party/blink/public/web/web_shared_worker_client.h b/chromium/third_party/blink/public/web/web_shared_worker_client.h index 1c520965cdf..81f8fabd133 100644 --- a/chromium/third_party/blink/public/web/web_shared_worker_client.h +++ b/chromium/third_party/blink/public/web/web_shared_worker_client.h @@ -31,8 +31,9 @@ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SHARED_WORKER_CLIENT_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SHARED_WORKER_CLIENT_H_ -#include "mojo/public/cpp/system/message_pipe.h" +#include "third_party/blink/public/mojom/devtools/devtools_agent.mojom-shared.h" #include "third_party/blink/public/mojom/web_feature/web_feature.mojom-shared.h" +#include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include "third_party/blink/public/platform/web_content_settings_client.h" #include "third_party/blink/public/platform/web_worker_fetch_context.h" @@ -50,8 +51,10 @@ class WebSharedWorkerClient { virtual void WorkerContextClosed() = 0; virtual void WorkerContextDestroyed() = 0; virtual void WorkerReadyForInspection( - mojo::ScopedMessagePipeHandle devtools_agent_ptr_info, - mojo::ScopedMessagePipeHandle devtools_agent_host_request) {} + CrossVariantMojoRemote<mojom::DevToolsAgentInterfaceBase> + devtools_agent_remote, + CrossVariantMojoReceiver<mojom::DevToolsAgentHostInterfaceBase> + devtools_agent_host_receiver) {} virtual void WorkerScriptLoadFailed(const std::string& error_message) = 0; virtual void WorkerScriptEvaluated(bool success) = 0; diff --git a/chromium/third_party/blink/public/web/web_view.h b/chromium/third_party/blink/public/web/web_view.h index 18ecf7968a4..baa1cec0752 100644 --- a/chromium/third_party/blink/public/web/web_view.h +++ b/chromium/third_party/blink/public/web/web_view.h @@ -32,11 +32,11 @@ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_VIEW_H_ #include "base/time/time.h" +#include "third_party/blink/public/common/page/web_drag_operation.h" #include "third_party/blink/public/mojom/input/focus_type.mojom-shared.h" #include "third_party/blink/public/mojom/page/page.mojom-shared.h" #include "third_party/blink/public/mojom/page/page_visibility_state.mojom-shared.h" #include "third_party/blink/public/platform/cross_variant_mojo_util.h" -#include "third_party/blink/public/platform/web_drag_operation.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/size.h" @@ -120,6 +120,16 @@ class WebView { // detached. virtual void DidAttachLocalMainFrame() = 0; + // Called while the main LocalFrame is being detached. The MainFrameImpl() is + // still valid until after this method is called. + virtual void DidDetachLocalMainFrame() = 0; + + // Called to inform WebViewImpl that a remote main frame has been attached. + virtual void DidAttachRemoteMainFrame() = 0; + + // Called to inform WebViewImpl that a remote main frame has been detached. + virtual void DidDetachRemoteMainFrame() = 0; + // Initializes the various client interfaces. virtual void SetPrerendererClient(WebPrerendererClient*) = 0; @@ -195,14 +205,6 @@ class WebView { // change. virtual double SetZoomLevel(double) = 0; - // Returns the current text zoom factor, where 1.0 is the normal size, > 1.0 - // is scaled up and < 1.0 is scaled down. - virtual float TextZoomFactor() = 0; - - // Scales the text in the page by a factor of textZoomFactor. - // Note: this has no effect on plugins. - virtual float SetTextZoomFactor(float) = 0; - // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0 // is scaled up, < 1.0 is scaled down. virtual float PageScaleFactor() const = 0; @@ -268,6 +270,9 @@ class WebView { // Indicates that view's preferred size changes will be sent to the browser. virtual void EnablePreferredSizeChangedMode() = 0; + // Asks the browser process to activate this web view. + virtual void Focus() = 0; + // Sets the ratio as computed by computePageScaleConstraints. // TODO(oshima): Remove this once the device scale factor implementation is // fully migrated to use zooming mechanism. @@ -412,13 +417,6 @@ class WebView { // Freezes or unfreezes the page and all the local frames. virtual void SetPageFrozen(bool frozen) = 0; - // Dispatches a pagehide event, freezes a page and hooks page eviction. - virtual void PutPageIntoBackForwardCache() = 0; - - // Unhooks eviction, resumes a page and dispatches a pageshow event. - virtual void RestorePageFromBackForwardCache( - base::TimeTicks navigation_start) = 0; - // Autoplay configuration ----------------------------------------------- // Sets the autoplay flags for this webview's page. diff --git a/chromium/third_party/blink/public/web/web_view_client.h b/chromium/third_party/blink/public/web/web_view_client.h index e33c483ab33..c799a401d45 100644 --- a/chromium/third_party/blink/public/web/web_view_client.h +++ b/chromium/third_party/blink/public/web/web_view_client.h @@ -146,7 +146,7 @@ class WebViewClient { virtual void DidAutoResize(const WebSize& new_size) {} // Called when the View acquires focus. - virtual void DidFocus(WebLocalFrame* calling_frame) {} + virtual void DidFocus() {} // Session history ----------------------------------------------------- diff --git a/chromium/third_party/blink/public/web/web_widget.h b/chromium/third_party/blink/public/web/web_widget.h index 4c719cd0405..aad9e1d1c71 100644 --- a/chromium/third_party/blink/public/web/web_widget.h +++ b/chromium/third_party/blink/public/web/web_widget.h @@ -39,14 +39,16 @@ #include "cc/trees/layer_tree_host_client.h" #include "third_party/blink/public/common/input/web_menu_source_type.h" #include "third_party/blink/public/common/metrics/document_update_reason.h" +#include "third_party/blink/public/mojom/input/input_event_result.mojom-shared.h" #include "third_party/blink/public/mojom/manifest/display_mode.mojom-shared.h" +#include "third_party/blink/public/platform/input/input_handler_proxy.h" #include "third_party/blink/public/platform/web_common.h" #include "third_party/blink/public/platform/web_input_event_result.h" #include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/platform/web_size.h" #include "third_party/blink/public/platform/web_text_input_info.h" +#include "third_party/blink/public/platform/web_vector.h" #include "third_party/blink/public/web/web_hit_test_result.h" -#include "third_party/blink/public/web/web_ime_text_span.h" #include "third_party/blink/public/web/web_lifecycle_update.h" #include "third_party/blink/public/web/web_range.h" #include "third_party/blink/public/web/web_swap_result.h" @@ -60,6 +62,7 @@ class LayerTreeSettings; namespace ui { class Cursor; +class LatencyInfo; } namespace blink { @@ -148,10 +151,16 @@ class WebWidget { // Called to inform the WebWidget that it has gained or lost keyboard focus. virtual void SetFocus(bool) {} + // Returns the state of focus for the WebWidget. + virtual bool HasFocus() { return false; } + // Sets the display mode, which comes from the top-level browsing context and // is applied to all widgets. virtual void SetDisplayMode(mojom::DisplayMode) {} + // Sets the root widget's window segments. + virtual void SetWindowSegments(WebVector<WebRect> window_segments) {} + // Returns the anchor and focus bounds of the current selection. // If the selection range is empty, it returns the caret bounds. virtual bool SelectionBounds(WebRect& anchor, WebRect& focus) const { @@ -186,6 +195,56 @@ class WebWidget { virtual void SetCursor(const ui::Cursor& cursor) = 0; + // Get the current tooltip text. + virtual WebString GetLastToolTipTextForTesting() const { return WebString(); } + + // Whether or not the widget is in the process of handling input events. + virtual bool HandlingInputEvent() = 0; + + // Set state that the widget is in the process of handling input events. + virtual void SetHandlingInputEvent(bool handling) = 0; + + using HandledEventCallback = base::OnceCallback<void( + mojom::InputEventResultState ack_state, + const ui::LatencyInfo& latency_info, + std::unique_ptr<InputHandlerProxy::DidOverscrollParams>, + base::Optional<cc::TouchAction>)>; + + // Process the input event, invoking the callback when complete. This + // method will call the callback synchronously. + virtual void ProcessInputEventSynchronously(const WebCoalescedInputEvent&, + HandledEventCallback) = 0; + + virtual void DidOverscrollForTesting( + const gfx::Vector2dF& overscroll_delta, + const gfx::Vector2dF& accumulated_overscroll, + const gfx::PointF& position_in_viewport, + const gfx::Vector2dF& velocity_in_viewport) {} + + // Requests the text input state be updated. If anything has changed the + // updated state will be sent to the browser. + virtual void UpdateTextInputState() = 0; + + // Requests the text input state be updated. An updated state will always be + // sent to the browser. + virtual void ForceTextInputStateUpdate() = 0; + + // Checks if the composition range or composition character bounds have been + // changed. If they are changed, the new value will be sent to the browser + // process. This method does nothing when the browser process is not able to + // handle composition range and composition character bounds. + virtual void UpdateCompositionInfo() = 0; + + // Requests the selection bounds be updated. + virtual void UpdateSelectionBounds() = 0; + + // Request the virtual keyboard be shown. + virtual void ShowVirtualKeyboard() = 0; + + // Request composition updates be sent to the browser. + virtual void RequestCompositionUpdates(bool immediate_request, + bool monitor_updates) = 0; + protected: ~WebWidget() = default; }; diff --git a/chromium/third_party/blink/public/web/web_widget_client.h b/chromium/third_party/blink/public/web/web_widget_client.h index 7af0397662f..b7b4802e63c 100644 --- a/chromium/third_party/blink/public/web/web_widget_client.h +++ b/chromium/third_party/blink/public/web/web_widget_client.h @@ -32,6 +32,7 @@ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_WIDGET_CLIENT_H_ #include <memory> +#include <vector> #include "base/callback.h" #include "base/i18n/rtl.h" @@ -39,12 +40,16 @@ #include "cc/trees/layer_tree_host.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "services/network/public/mojom/referrer_policy.mojom-shared.h" +#include "third_party/blink/public/common/input/web_coalesced_input_event.h" #include "third_party/blink/public/common/input/web_gesture_event.h" +#include "third_party/blink/public/common/page/web_drag_operation.h" +#include "third_party/blink/public/mojom/input/input_handler.mojom-shared.h" #include "third_party/blink/public/mojom/input/pointer_lock_result.mojom-forward.h" +#include "third_party/blink/public/platform/cross_variant_mojo_util.h" #include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/public/platform/web_drag_operation.h" #include "third_party/blink/public/platform/web_rect.h" #include "third_party/blink/public/platform/web_screen_info.h" +#include "third_party/blink/public/platform/web_text_input_type.h" #include "third_party/blink/public/platform/web_touch_action.h" #include "third_party/blink/public/web/web_meaningful_layout.h" #include "third_party/blink/public/web/web_navigation_policy.h" @@ -52,7 +57,6 @@ class SkBitmap; namespace cc { -struct ElementId; class PaintImage; } @@ -67,9 +71,9 @@ class Cursor; namespace blink { class WebDragData; +class WebMouseEvent; class WebGestureEvent; struct WebFloatRect; -class WebString; class WebWidget; class WebLocalFrame; @@ -82,6 +86,12 @@ class WebWidgetClient { // a synchronous composite. virtual void ScheduleAnimation() {} + // Called to request a BeginMainFrame from the compositor, meant to be used + // for web tests only, where commits must be explicitly scheduled. Contrary to + // ScheduleAnimation() this will be a no-op on multi-threaded environments and + // will unconditionally ensure that the compositor is actually run. + virtual void ScheduleAnimationForWebTests() {} + // Called immediately following the first compositor-driven (frame-generating) // layout that happened after an interesting document lifecyle change (see // WebMeaningfulLayout for details.) @@ -107,10 +117,6 @@ class WebWidgetClient { // content view area, i.e. doesn't include any window decorations. virtual WebRect ViewRect() { return WebRect(); } - // Called when a tooltip should be shown at the current cursor position. - virtual void SetToolTipText(const WebString&, - base::i18n::TextDirection hint) {} - // Requests to lock the mouse cursor for the |requester_frame| in the // widget. If true is returned, the success result will be asynchronously // returned via a single call to WebWidget::didAcquirePointerLock() or @@ -138,28 +144,13 @@ class WebWidgetClient { // Returns true iff the pointer is locked to this widget. virtual bool IsPointerLocked() { return false; } - // Called when a gesture event is handled. - virtual void DidHandleGestureEvent(const WebGestureEvent& event, - bool event_cancelled) {} - // Called when overscrolled on main thread. All parameters are in // viewport-space. virtual void DidOverscroll(const gfx::Vector2dF& overscroll_delta, const gfx::Vector2dF& accumulated_overscroll, const gfx::PointF& position_in_viewport, - const gfx::Vector2dF& velocity_in_viewport) {} - - // Requests that a gesture of |injected_type| be reissued at a later point in - // time. |injected_type| is required to be one of - // GestureScroll{Begin,Update,End}. The dispatched gesture will scroll the - // ScrollableArea identified by |scrollable_area_element_id| by the given - // delta + granularity. - virtual void InjectGestureScrollEvent( - WebGestureDevice device, - const gfx::Vector2dF& delta, - ui::ScrollGranularity granularity, - cc::ElementId scrollable_area_element_id, - WebInputEvent::Type injected_type) {} + const gfx::Vector2dF& velocity_in_viewport, + cc::OverscrollBehavior overscroll_behavior) {} // Called to update if pointerrawupdate events should be sent. virtual void SetHasPointerRawUpdateEventHandlers(bool) {} @@ -179,9 +170,6 @@ class WebWidgetClient { // the embedder of the touch actions that are permitted for this touch. virtual void SetTouchAction(WebTouchAction touch_action) {} - // Request the browser to show virtual keyboard for current input type. - virtual void ShowVirtualKeyboardOnElementFocus() {} - // Converts the |rect| from Blink's Viewport coordinates to the // coordinates in the native window used to display the content, in // DIP. They're identical in tradional world, but will differ when @@ -279,6 +267,74 @@ class WebWidgetClient { // Returns a scale of the device emulator from the widget. virtual float GetEmulatorScale() const { return 1.0f; } + + // Returns whether we handled a GestureScrollEvent. + virtual void DidHandleGestureScrollEvent( + const WebGestureEvent& gesture_event, + const gfx::Vector2dF& unused_delta, + const cc::OverscrollBehavior& overscroll_behavior, + bool event_processed) {} + + // Called before gesture events are processed and allows the + // client to handle the event itself. Return true if event was handled + // and further processing should stop. + virtual bool WillHandleGestureEvent(const WebGestureEvent& event) { + return false; + } + + // Called before mouse events are processed and allows the + // client to handle the event itself. Return true if event was handled + // and further processing should stop. + virtual bool WillHandleMouseEvent(const WebMouseEvent& event) { + return false; + } + + // Queue a sythentic event in the MainThreadEventQueue. This is called + // for when handling scrollbars. + virtual void QueueSyntheticEvent( + std::unique_ptr<blink::WebCoalescedInputEvent>) {} + + // Connect the Widget Input Handler to the channels provided. + virtual void GetWidgetInputHandler( + CrossVariantMojoReceiver<mojom::WidgetInputHandlerInterfaceBase> + widget_input_receiver, + CrossVariantMojoRemote<mojom::WidgetInputHandlerHostInterfaceBase> + widget_input_host_remote) {} + + // Since the widget input IPC channel is still on the content side send this + // message back to the embedder to then send it on that channel. All bounds + // are in window coordinates. + virtual void SendCompositionRangeChanged( + const gfx::Range& range, + const std::vector<gfx::Rect>& character_bounds) {} + + // The IME guard prevents sending IPC messages while messages are being + // processed. Returns true if there is a current guard. + // |request_to_show_virtual_keyboard| is whether the message that would have + // been sent would have requested the keyboard. This method will eventually be + // removed when all input handling is moved into blink. + virtual bool HasCurrentImeGuard(bool request_to_show_virtual_keyboard) { + return false; + } + + // Determines whether composition can happen inline. + virtual bool CanComposeInline() { return false; } + + // Determines if IME events should be sent to Pepper instead of processed to + // the currently focused frame. + virtual bool ShouldDispatchImeEventsToPepper() { return false; } + + // Returns the current pepper text input type. + virtual WebTextInputType GetPepperTextInputType() { + return WebTextInputType::kWebTextInputTypeNone; + } + + // Returns the current pepper caret bounds in window coordinates. + virtual gfx::Rect GetPepperCaretBounds() { return gfx::Rect(); } + + // The state of the focus has changed for the WebWidget. |enabled| + // is the new state. + virtual void FocusChanged(bool enabled) {} }; } // namespace blink |