blob: 6551c733ef246a7c4c32b0be6f778c81d06f9fec [file] [log] [blame]
[email protected]b1656552014-06-09 19:59:381// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef ANDROID_WEBVIEW_RENDERER_AW_RENDER_FRAME_EXT_H_
6#define ANDROID_WEBVIEW_RENDERER_AW_RENDER_FRAME_EXT_H_
7
avide7d5c22015-12-20 05:48:448#include "base/macros.h"
[email protected]b1656552014-06-09 19:59:389#include "content/public/renderer/render_frame_observer.h"
hush28fab08662016-01-14 18:42:5110#include "ui/gfx/geometry/point_f.h"
11#include "ui/gfx/geometry/size.h"
12#include "ui/gfx/geometry/size_f.h"
avi0363eb922016-03-10 23:53:4613#include "url/origin.h"
hush28fab08662016-01-14 18:42:5114
15namespace blink {
16enum WebMeaningfulLayout;
lfgcaab5142016-02-26 19:06:5217class WebFrameWidget;
hush28fab08662016-01-14 18:42:5118class WebView;
19}
[email protected]b1656552014-06-09 19:59:3820
21namespace android_webview {
22
23// Render process side of AwRenderViewHostExt, this provides cross-process
24// implementation of miscellaneous WebView functions that we need to poke
25// WebKit directly to implement (and that aren't needed in the chrome app).
26class AwRenderFrameExt : public content::RenderFrameObserver {
27 public:
28 AwRenderFrameExt(content::RenderFrame* render_frame);
29
30 private:
dcheng9f9f9342015-02-04 01:50:1731 ~AwRenderFrameExt() override;
[email protected]b1656552014-06-09 19:59:3832
hush28fab08662016-01-14 18:42:5133 // RenderFrameObserver:
mlamouri9ef14c22015-02-27 13:30:5434 void DidCommitProvisionalLoad(bool is_new_navigation,
35 bool is_same_page_navigation) override;
hush28fab08662016-01-14 18:42:5136
37 bool OnMessageReceived(const IPC::Message& message) override;
38 void FocusedNodeChanged(const blink::WebNode& node) override;
xjz694b50a92016-06-07 21:49:3739 void OnDestruct() override;
hush28fab08662016-01-14 18:42:5140
hushd0baa9b2016-05-11 19:30:0441 void OnDocumentHasImagesRequest(uint32_t id);
hush28fab08662016-01-14 18:42:5142 void OnDoHitTest(const gfx::PointF& touch_center,
43 const gfx::SizeF& touch_area);
44
45 void OnSetTextZoomFactor(float zoom_factor);
46
47 void OnResetScrollAndScaleState();
48
49 void OnSetInitialPageScale(double page_scale_factor);
50
51 void OnSetBackgroundColor(SkColor c);
52
jamb81a4cf2016-02-09 05:20:3653 void OnSmoothScroll(int target_x, int target_y, int duration_ms);
hush28fab08662016-01-14 18:42:5154
55 blink::WebView* GetWebView();
lfgcaab5142016-02-26 19:06:5256 blink::WebFrameWidget* GetWebFrameWidget();
hush28fab08662016-01-14 18:42:5157
avi0363eb922016-03-10 23:53:4658 url::Origin last_origin_;
59
[email protected]b1656552014-06-09 19:59:3860 DISALLOW_COPY_AND_ASSIGN(AwRenderFrameExt);
61};
62
63}
64
65#endif // ANDROID_WEBVIEW_RENDERER_AW_RENDER_FRAME_EXT_H_
66
67