summaryrefslogtreecommitdiffstats
path: root/content/public/renderer
diff options
context:
space:
mode:
authorhuangs <huangs@chromium.org>2015-12-15 08:59:24 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-15 17:00:57 +0000
commit2a3423509e09300ff6a860f4ce1c158f1cbc8a12 (patch)
tree176b4f0ad42e709116252c0919094832355510d6 /content/public/renderer
parent3300f1c35eb5b09fb329f580c2fbfa3f974ddf5e (diff)
downloadchromium_src-2a3423509e09300ff6a860f4ce1c158f1cbc8a12.zip
chromium_src-2a3423509e09300ff6a860f4ce1c158f1cbc8a12.tar.gz
chromium_src-2a3423509e09300ff6a860f4ce1c158f1cbc8a12.tar.bz2
[RenderView] Refactor: Add ElementBoundsInWindow().
Autofill has repeated code to get element's bounds in Viewport coordinates as blink::WebRect, then convert it to bounds in Window coordinates as gfx::RectF. Extracting this to a single function simplifies upcoming refactoring. Review URL: https://codereview.chromium.org/1514693012 Cr-Commit-Position: refs/heads/master@{#365268}
Diffstat (limited to 'content/public/renderer')
-rw-r--r--content/public/renderer/render_view.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/public/renderer/render_view.h b/content/public/renderer/render_view.h
index 1f0a235..16ce47f 100644
--- a/content/public/renderer/render_view.h
+++ b/content/public/renderer/render_view.h
@@ -13,6 +13,7 @@
#include "content/public/common/top_controls_state.h"
#include "ipc/ipc_sender.h"
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
+#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/native_widget_types.h"
namespace blink {
@@ -131,6 +132,12 @@ class CONTENT_EXPORT RenderView : public IPC::Sender {
// becomes DSF times larger than window coordinates.
virtual void convertViewportToWindow(blink::WebRect* rect) = 0;
+ // Returns the bounds of |element| in Window coordinates. The bounds have been
+ // adjusted to include any transformations, including page scale.
+ // This function will update the layout if required.
+ virtual gfx::RectF ElementBoundsInWindow(const blink::WebElement& element)
+ = 0;
+
protected:
~RenderView() override {}