Commit 792ddb3b authored by Dave Tapuska's avatar Dave Tapuska Committed by Chromium LUCI CQ

Remove WebRect from WebDraggableRegion and CapturePaintPreview.

A few more removals with respect to conversions from WebRect->gfx::Rect.

BUG=738465

Change-Id: I93c62c173fa3788a2354f2c3406d58bdc5469e3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2639230
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846328}
parent 738e1373
...@@ -232,9 +232,9 @@ void PageTimingMetricsSender::DidLoadResourceFromMemoryCache( ...@@ -232,9 +232,9 @@ void PageTimingMetricsSender::DidLoadResourceFromMemoryCache(
} }
void PageTimingMetricsSender::OnMainFrameIntersectionChanged( void PageTimingMetricsSender::OnMainFrameIntersectionChanged(
const blink::WebRect& main_frame_intersection) { const gfx::Rect& main_frame_intersection) {
metadata_->intersection_update = metadata_->intersection_update =
mojom::FrameIntersectionUpdate::New(gfx::Rect(main_frame_intersection)); mojom::FrameIntersectionUpdate::New(main_frame_intersection);
EnsureSendTimer(); EnsureSendTimer();
} }
......
...@@ -73,7 +73,7 @@ class PageTimingMetricsSender { ...@@ -73,7 +73,7 @@ class PageTimingMetricsSender {
int request_id, int request_id,
int64_t encoded_body_length, int64_t encoded_body_length,
const std::string& mime_type); const std::string& mime_type);
void OnMainFrameIntersectionChanged(const blink::WebRect& intersect_rect); void OnMainFrameIntersectionChanged(const gfx::Rect& intersect_rect);
void DidObserveInputDelay(base::TimeDelta input_delay); void DidObserveInputDelay(base::TimeDelta input_delay);
// Updates the timing information. Buffers |timing| to be sent over mojo // Updates the timing information. Buffers |timing| to be sent over mojo
......
...@@ -439,7 +439,7 @@ TEST_F(PageTimingMetricsSenderTest, SendFrameIntersectionUpdate) { ...@@ -439,7 +439,7 @@ TEST_F(PageTimingMetricsSenderTest, SendFrameIntersectionUpdate) {
PageTimingMetadataRecorder::MonotonicTiming()); PageTimingMetadataRecorder::MonotonicTiming());
validator_.ExpectPageLoadTiming(timing); validator_.ExpectPageLoadTiming(timing);
metrics_sender_->OnMainFrameIntersectionChanged(blink::WebRect(0, 0, 1, 1)); metrics_sender_->OnMainFrameIntersectionChanged(gfx::Rect(0, 0, 1, 1));
mojom::FrameIntersectionUpdate frame_intersection_update( mojom::FrameIntersectionUpdate frame_intersection_update(
gfx::Rect(0, 0, 1, 1)); gfx::Rect(0, 0, 1, 1));
validator_.UpdateExpectFrameIntersectionUpdate(frame_intersection_update); validator_.UpdateExpectFrameIntersectionUpdate(frame_intersection_update);
......
...@@ -43,11 +43,11 @@ class WebFrame; ...@@ -43,11 +43,11 @@ class WebFrame;
class WebLocalFrame; class WebLocalFrame;
class WebPlugin; class WebPlugin;
struct WebPluginParams; struct WebPluginParams;
struct WebRect;
} // namespace blink } // namespace blink
namespace gfx { namespace gfx {
class Range; class Range;
class Rect;
class RectF; class RectF;
} // namespace gfx } // namespace gfx
...@@ -295,7 +295,7 @@ class CONTENT_EXPORT RenderFrame : public IPC::Listener, ...@@ -295,7 +295,7 @@ class CONTENT_EXPORT RenderFrame : public IPC::Listener,
// Converts the |rect| to Window coordinates which are device scale // Converts the |rect| to Window coordinates which are device scale
// independent. // independent.
virtual void ConvertViewportToWindow(blink::WebRect* rect) = 0; virtual void ConvertViewportToWindow(gfx::Rect* rect) = 0;
// Returns the device scale factor of the display the render frame is in. // Returns the device scale factor of the display the render frame is in.
virtual float GetDeviceScaleFactor() = 0; virtual float GetDeviceScaleFactor() = 0;
......
...@@ -6341,7 +6341,7 @@ gfx::RectF RenderFrameImpl::ElementBoundsInWindow( ...@@ -6341,7 +6341,7 @@ gfx::RectF RenderFrameImpl::ElementBoundsInWindow(
element.BoundsInViewport())); element.BoundsInViewport()));
} }
void RenderFrameImpl::ConvertViewportToWindow(blink::WebRect* rect) { void RenderFrameImpl::ConvertViewportToWindow(gfx::Rect* rect) {
*rect = GetLocalRootWebFrameWidget()->BlinkSpaceToEnclosedDIPs(*rect); *rect = GetLocalRootWebFrameWidget()->BlinkSpaceToEnclosedDIPs(*rect);
} }
......
...@@ -396,7 +396,7 @@ class CONTENT_EXPORT RenderFrameImpl ...@@ -396,7 +396,7 @@ class CONTENT_EXPORT RenderFrameImpl
const RenderFrameMediaPlaybackOptions& opts) override; const RenderFrameMediaPlaybackOptions& opts) override;
void SetAllowsCrossBrowsingInstanceFrameLookup() override; void SetAllowsCrossBrowsingInstanceFrameLookup() override;
gfx::RectF ElementBoundsInWindow(const blink::WebElement& element) override; gfx::RectF ElementBoundsInWindow(const blink::WebElement& element) override;
void ConvertViewportToWindow(blink::WebRect* rect) override; void ConvertViewportToWindow(gfx::Rect* rect) override;
float GetDeviceScaleFactor() override; float GetDeviceScaleFactor() override;
// blink::mojom::AutoplayConfigurationClient implementation: // blink::mojom::AutoplayConfigurationClient implementation:
......
...@@ -509,7 +509,10 @@ class RenderViewImplTest : public RenderViewTest { ...@@ -509,7 +509,10 @@ class RenderViewImplTest : public RenderViewTest {
int GetScrollbarWidth() { int GetScrollbarWidth() {
blink::WebView* webview = view()->GetWebView(); blink::WebView* webview = view()->GetWebView();
return webview->MainFrameWidget()->Size().width() - return webview->MainFrameWidget()->Size().width() -
webview->MainFrame()->ToWebLocalFrame()->VisibleContentRect().width; webview->MainFrame()
->ToWebLocalFrame()
->VisibleContentRect()
.width();
} }
private: private:
......
...@@ -7,10 +7,13 @@ ...@@ -7,10 +7,13 @@
#include "third_party/blink/public/platform/web_common.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_private_ptr.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_vector.h" #include "third_party/blink/public/platform/web_vector.h"
namespace gfx {
class Rect;
} // namespace gfx
namespace blink { namespace blink {
class ContentHolder; class ContentHolder;
...@@ -23,7 +26,7 @@ class BLINK_EXPORT WebContentHolder { ...@@ -23,7 +26,7 @@ class BLINK_EXPORT WebContentHolder {
virtual ~WebContentHolder(); virtual ~WebContentHolder();
WebString GetValue() const; WebString GetValue() const;
WebRect GetBoundingBox() const; gfx::Rect GetBoundingBox() const;
uint64_t GetId() const; uint64_t GetId() const;
#if INSIDE_BLINK #if INSIDE_BLINK
......
...@@ -31,15 +31,13 @@ ...@@ -31,15 +31,13 @@
#ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_DRAGGABLE_REGION_H_ #ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_DRAGGABLE_REGION_H_
#define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_DRAGGABLE_REGION_H_ #define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_DRAGGABLE_REGION_H_
#include "third_party/blink/public/platform/web_common.h" #include "ui/gfx/geometry/rect.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_string.h"
namespace blink { namespace blink {
struct WebDraggableRegion { struct WebDraggableRegion {
bool draggable; bool draggable;
WebRect bounds; gfx::Rect bounds;
}; };
} // namespace blink } // namespace blink
......
...@@ -670,7 +670,7 @@ class WebLocalFrame : public WebFrame { ...@@ -670,7 +670,7 @@ class WebLocalFrame : public WebFrame {
// Returns the visible content rect (minus scrollbars), relative to the // Returns the visible content rect (minus scrollbars), relative to the
// document. // document.
virtual WebRect VisibleContentRect() const = 0; virtual gfx::Rect VisibleContentRect() const = 0;
// Printing ------------------------------------------------------------ // Printing ------------------------------------------------------------
...@@ -722,7 +722,7 @@ class WebLocalFrame : public WebFrame { ...@@ -722,7 +722,7 @@ class WebLocalFrame : public WebFrame {
// Captures a full frame paint preview of the WebFrame including subframes. If // Captures a full frame paint preview of the WebFrame including subframes. If
// |include_linked_destinations| is true, the capture will include annotations // |include_linked_destinations| is true, the capture will include annotations
// about linked destinations within the document. // about linked destinations within the document.
virtual bool CapturePaintPreview(const WebRect& bounds, virtual bool CapturePaintPreview(const gfx::Rect& bounds,
cc::PaintCanvas* canvas, cc::PaintCanvas* canvas,
bool include_linked_destinations) = 0; bool include_linked_destinations) = 0;
......
...@@ -27,8 +27,8 @@ WebString WebContentHolder::GetValue() const { ...@@ -27,8 +27,8 @@ WebString WebContentHolder::GetValue() const {
return private_->node()->nodeValue(); return private_->node()->nodeValue();
} }
WebRect WebContentHolder::GetBoundingBox() const { gfx::Rect WebContentHolder::GetBoundingBox() const {
return WebRect(private_->rect()); return private_->rect();
} }
uint64_t WebContentHolder::GetId() const { uint64_t WebContentHolder::GetId() const {
......
...@@ -819,10 +819,10 @@ bool WebLocalFrameImpl::HasVisibleContent() const { ...@@ -819,10 +819,10 @@ bool WebLocalFrameImpl::HasVisibleContent() const {
return false; return false;
} }
WebRect WebLocalFrameImpl::VisibleContentRect() const { gfx::Rect WebLocalFrameImpl::VisibleContentRect() const {
if (LocalFrameView* view = GetFrameView()) if (LocalFrameView* view = GetFrameView())
return view->LayoutViewport()->VisibleContentRect(); return view->LayoutViewport()->VisibleContentRect();
return WebRect(); return gfx::Rect();
} }
WebView* WebLocalFrameImpl::View() const { WebView* WebLocalFrameImpl::View() const {
...@@ -1739,10 +1739,10 @@ bool WebLocalFrameImpl::GetPrintPresetOptionsForPlugin( ...@@ -1739,10 +1739,10 @@ bool WebLocalFrameImpl::GetPrintPresetOptionsForPlugin(
return plugin_container->GetPrintPresetOptionsFromDocument(preset_options); return plugin_container->GetPrintPresetOptionsFromDocument(preset_options);
} }
bool WebLocalFrameImpl::CapturePaintPreview(const WebRect& bounds, bool WebLocalFrameImpl::CapturePaintPreview(const gfx::Rect& bounds,
cc::PaintCanvas* canvas, cc::PaintCanvas* canvas,
bool include_linked_destinations) { bool include_linked_destinations) {
FloatSize float_bounds(bounds.width, bounds.height); FloatSize float_bounds(bounds.width(), bounds.height());
bool success = false; bool success = false;
{ {
Document::PaintPreviewScope paint_preview(*GetFrame()->GetDocument()); Document::PaintPreviewScope paint_preview(*GetFrame()->GetDocument());
......
...@@ -277,7 +277,7 @@ class CORE_EXPORT WebLocalFrameImpl final ...@@ -277,7 +277,7 @@ class CORE_EXPORT WebLocalFrameImpl final
void SetScrollOffset(const WebSize&) override; void SetScrollOffset(const WebSize&) override;
WebSize DocumentSize() const override; WebSize DocumentSize() const override;
bool HasVisibleContent() const override; bool HasVisibleContent() const override;
WebRect VisibleContentRect() const override; gfx::Rect VisibleContentRect() const override;
void DispatchBeforePrintEvent( void DispatchBeforePrintEvent(
base::WeakPtr<WebPrintClient> print_client) override; base::WeakPtr<WebPrintClient> print_client) override;
WebPlugin* GetPluginToPrint(const WebNode& constrain_to_node) override; WebPlugin* GetPluginToPrint(const WebNode& constrain_to_node) override;
...@@ -289,7 +289,7 @@ class CORE_EXPORT WebLocalFrameImpl final ...@@ -289,7 +289,7 @@ class CORE_EXPORT WebLocalFrameImpl final
void DispatchAfterPrintEvent() override; void DispatchAfterPrintEvent() override;
bool GetPrintPresetOptionsForPlugin(const WebNode&, bool GetPrintPresetOptionsForPlugin(const WebNode&,
WebPrintPresetOptions*) override; WebPrintPresetOptions*) override;
bool CapturePaintPreview(const WebRect& bounds, bool CapturePaintPreview(const gfx::Rect& bounds,
cc::PaintCanvas* canvas, cc::PaintCanvas* canvas,
bool include_linked_destinations) override; bool include_linked_destinations) override;
bool ShouldSuppressKeyboardForFocusedElement() override; bool ShouldSuppressKeyboardForFocusedElement() override;
......
...@@ -185,7 +185,7 @@ TEST_P(VideoPaintPreviewTest, URLIsRecordedWhenPaintingPreview) { ...@@ -185,7 +185,7 @@ TEST_P(VideoPaintPreviewTest, URLIsRecordedWhenPaintingPreview) {
recorder.beginRecording(bounds().width(), bounds().height()); recorder.beginRecording(bounds().width(), bounds().height());
canvas->SetPaintPreviewTracker(&tracker); canvas->SetPaintPreviewTracker(&tracker);
GetLocalMainFrame().CapturePaintPreview(WebRect(bounds()), canvas, GetLocalMainFrame().CapturePaintPreview(bounds(), canvas,
/*include_linked_destinations=*/true); /*include_linked_destinations=*/true);
auto record = recorder.finishRecordingAsPicture(); auto record = recorder.finishRecordingAsPicture();
std::vector<std::pair<GURL, SkRect>> links; std::vector<std::pair<GURL, SkRect>> links;
......
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