Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more vector use fixes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 6987fcc95dab4f69a9d5887fe12e657529ad8d78..2013daaf56ef6ece851ca4dc4531c6ce76837099 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -446,7 +446,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewAura::GetNativeViewAccessible() {
}
void RenderWidgetHostViewAura::MovePluginWindows(
- const gfx::Point& scroll_offset,
+ const gfx::Vector2d& scroll_offset,
const std::vector<webkit::npapi::WebPluginGeometry>& plugin_window_moves) {
#if defined(OS_WIN)
// We need to clip the rectangle to the tab's viewport, otherwise we will draw
@@ -464,14 +464,14 @@ void RenderWidgetHostViewAura::MovePluginWindows(
for (size_t i = 0; i < moves.size(); ++i) {
gfx::Rect clip = moves[i].clip_rect;
- clip.Offset(moves[i].window_rect.origin());
+ clip.Offset(moves[i].window_rect.OffsetFromOrigin());
Peter Kasting 2012/10/30 01:14:14 Nit: Combine these two Offset() calls (2 places)
clip.Offset(scroll_offset);
clip.Intersect(view_port);
clip.Offset(-moves[i].window_rect.x(), -moves[i].window_rect.y());
Peter Kasting 2012/10/30 01:14:14 Nit: -moves[i].window_rect.OffsetFromOrigin()
- clip.Offset(-scroll_offset.x(), -scroll_offset.y());
+ clip.Offset(-scroll_offset);
moves[i].clip_rect = clip;
- moves[i].window_rect.Offset(view_bounds.origin());
+ moves[i].window_rect.Offset(view_bounds.OffsetFromOrigin());
}
MovePluginWindowsHelper(parent, moves);

Powered by Google App Engine
This is Rietveld 408576698