Commit 825f81f0 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Move VisibleContentRect() from WebFrame to WebLocalFrame.

This operation doesn't make sense on remote frames.

Bug: 416660
Change-Id: I24ab6dfbfa1e582a920f7502076e88e24eccaa47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865610Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706663}
parent 9d1b8def
...@@ -428,7 +428,7 @@ class RenderViewImplTest : public RenderViewTest { ...@@ -428,7 +428,7 @@ class RenderViewImplTest : public RenderViewTest {
int GetScrollbarWidth() { int GetScrollbarWidth() {
blink::WebView* webview = view()->webview(); blink::WebView* webview = view()->webview();
return webview->MainFrameWidget()->Size().width - return webview->MainFrameWidget()->Size().width -
webview->MainFrame()->VisibleContentRect().width; webview->MainFrame()->ToWebLocalFrame()->VisibleContentRect().width;
} }
private: private:
......
...@@ -53,7 +53,6 @@ class WebView; ...@@ -53,7 +53,6 @@ class WebView;
enum class WebSandboxFlags; enum class WebSandboxFlags;
struct FramePolicy; struct FramePolicy;
struct WebFrameOwnerProperties; struct WebFrameOwnerProperties;
struct WebRect;
// Frames may be rendered in process ('local') or out of process ('remote'). // Frames may be rendered in process ('local') or out of process ('remote').
// A remote frame is always cross-site; a local frame may be either same-site or // A remote frame is always cross-site; a local frame may be either same-site or
...@@ -119,14 +118,6 @@ class BLINK_EXPORT WebFrame { ...@@ -119,14 +118,6 @@ class BLINK_EXPORT WebFrame {
// navigation. This matches the in-process frame behavior. // navigation. This matches the in-process frame behavior.
void SetFrameOwnerProperties(const WebFrameOwnerProperties&); void SetFrameOwnerProperties(const WebFrameOwnerProperties&);
// Geometry -----------------------------------------------------------
// NOTE: These routines do not force page layout so their results may
// not be accurate if the page layout is out-of-date.
// Returns the visible content rect (minus scrollbars, in absolute coordinate)
virtual WebRect VisibleContentRect() const = 0;
// Whether to collapse the frame's owner element in the embedder document, // Whether to collapse the frame's owner element in the embedder document,
// that is, to remove it from the layout as if it did not exist. Only works // that is, to remove it from the layout as if it did not exist. Only works
// for <iframe> owner elements. // for <iframe> owner elements.
......
...@@ -674,6 +674,9 @@ class WebLocalFrame : public WebFrame { ...@@ -674,6 +674,9 @@ class WebLocalFrame : public WebFrame {
// Returns true if the contents (minus scrollbars) has non-zero area. // Returns true if the contents (minus scrollbars) has non-zero area.
virtual bool HasVisibleContent() const = 0; virtual bool HasVisibleContent() const = 0;
// Returns the visible content rect (minus scrollbars, in absolute coordinate)
virtual WebRect VisibleContentRect() const = 0;
// Printing ------------------------------------------------------------ // Printing ------------------------------------------------------------
// Dispatch |beforeprint| event, and execute event handlers. They might detach // Dispatch |beforeprint| event, and execute event handlers. They might detach
......
...@@ -153,11 +153,6 @@ void WebRemoteFrameImpl::Close() { ...@@ -153,11 +153,6 @@ void WebRemoteFrameImpl::Close() {
self_keep_alive_.Clear(); self_keep_alive_.Clear();
} }
WebRect WebRemoteFrameImpl::VisibleContentRect() const {
NOTREACHED();
return WebRect();
}
WebView* WebRemoteFrameImpl::View() const { WebView* WebRemoteFrameImpl::View() const {
if (!GetFrame()) { if (!GetFrame()) {
return nullptr; return nullptr;
......
...@@ -44,7 +44,6 @@ class CORE_EXPORT WebRemoteFrameImpl final ...@@ -44,7 +44,6 @@ class CORE_EXPORT WebRemoteFrameImpl final
// WebFrame methods: // WebFrame methods:
void Close() override; void Close() override;
WebRect VisibleContentRect() const override;
WebView* View() const override; WebView* View() const override;
void StopLoading() override; void StopLoading() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment