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

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

Issue 2554513002: Change |EnsureCaretInRect| to |EnsureCaretNotInRect|. (Closed)
Patch Set: add a test with multiple displays case Created 4 years 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 a762af3d07b90ffde7aa976afbd69d9776720f49..36d0a59e1fd4a21d459086b1b07491f8d1be3c8d 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1424,15 +1424,16 @@ void RenderWidgetHostViewAura::ExtendSelectionAndDelete(
rfh->ExtendSelectionAndDelete(before, after);
}
-void RenderWidgetHostViewAura::EnsureCaretInRect(const gfx::Rect& rect) {
- gfx::Rect intersected_rect(
+void RenderWidgetHostViewAura::EnsureCaretOutOfRect(const gfx::Rect& rect) {
+ gfx::Rect hiding_area_in_this_window(
gfx::IntersectRects(rect, window_->GetBoundsInScreen()));
- if (intersected_rect.IsEmpty())
+ if (hiding_area_in_this_window.IsEmpty())
return;
host_->ScrollFocusedEditableNodeIntoRect(
- ConvertRectFromScreen(intersected_rect));
+ ConvertRectFromScreen(gfx::SubtractRects(window_->GetBoundsInScreen(),
+ hiding_area_in_this_window)));
}
bool RenderWidgetHostViewAura::IsTextEditCommandEnabled(

Powered by Google App Engine
This is Rietveld 408576698