Convert AwViewMsg_SetBackgroundColor to a mojom message.
There are a series of messages that are sent to the LocalMainFrame
of the webview. This maps SetBackgroundColor onto one of those messages.
Other targeted messages will be converted in followup CLs.
BUG=993189
Change-Id: I221d0c9be378c731d0bb3a11e508bda8ba0dc849
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2518798
Commit-Queue: Dave Tapuska <[email protected]>
Reviewed-by: Bo <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#824926}
diff --git a/android_webview/renderer/aw_render_frame_ext.h b/android_webview/renderer/aw_render_frame_ext.h
index ffabfcc..bd2608c 100644
--- a/android_webview/renderer/aw_render_frame_ext.h
+++ b/android_webview/renderer/aw_render_frame_ext.h
@@ -5,8 +5,11 @@
#ifndef ANDROID_WEBVIEW_RENDERER_AW_RENDER_FRAME_EXT_H_
#define ANDROID_WEBVIEW_RENDERER_AW_RENDER_FRAME_EXT_H_
+#include "android_webview/common/mojom/frame.mojom.h"
#include "base/macros.h"
#include "content/public/renderer/render_frame_observer.h"
+#include "mojo/public/cpp/bindings/associated_receiver.h"
+#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/geometry/point_f.h"
@@ -24,7 +27,8 @@
// Render process side of AwRenderViewHostExt, this provides cross-process
// implementation of miscellaneous WebView functions that we need to poke
// WebKit directly to implement (and that aren't needed in the chrome app).
-class AwRenderFrameExt : public content::RenderFrameObserver {
+class AwRenderFrameExt : public content::RenderFrameObserver,
+ mojom::LocalMainFrame {
public:
explicit AwRenderFrameExt(content::RenderFrame* render_frame);
@@ -53,16 +57,22 @@
void OnSetInitialPageScale(double page_scale_factor);
- void OnSetBackgroundColor(SkColor c);
-
void OnSmoothScroll(int target_x, int target_y, base::TimeDelta duration);
+ // mojom::LocalMainFrame overrides:
+ void SetBackgroundColor(SkColor c) override;
+
+ void BindLocalMainFrame(
+ mojo::PendingAssociatedReceiver<mojom::LocalMainFrame> pending_receiver);
+
blink::WebView* GetWebView();
blink::WebFrameWidget* GetWebFrameWidget();
url::Origin last_origin_;
blink::AssociatedInterfaceRegistry registry_;
+ mojo::AssociatedReceiver<mojom::LocalMainFrame> local_main_frame_receiver_{
+ this};
DISALLOW_COPY_AND_ASSIGN(AwRenderFrameExt);
};