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

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

Issue 2554513002: Change |EnsureCaretInRect| to |EnsureCaretNotInRect|. (Closed)
Patch Set: 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | ui/base/ime/dummy_text_input_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..508ae90e472c19683073aa2263ec6d6b8b3ce764 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(
- gfx::IntersectRects(rect, window_->GetBoundsInScreen()));
+void RenderWidgetHostViewAura::EnsureCaretNotInRect(const gfx::Rect& rect) {
+ gfx::Rect rect_in_local_space = ConvertRectFromScreen(rect);
+ gfx::Rect hiding_area_in_this_window =
+ gfx::IntersectRects(rect_in_local_space, window_->bounds());
- if (intersected_rect.IsEmpty())
+ if (hiding_area_in_this_window.IsEmpty())
return;
host_->ScrollFocusedEditableNodeIntoRect(
- ConvertRectFromScreen(intersected_rect));
+ gfx::SubtractRects(window_->bounds(), hiding_area_in_this_window));
}
bool RenderWidgetHostViewAura::IsTextEditCommandEnabled(
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.h ('k') | ui/base/ime/dummy_text_input_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698