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

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

Issue 2554513002: Change |EnsureCaretInRect| to |EnsureCaretNotInRect|. (Closed)
Patch Set: rebase 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..2a38a2525c0546493c701a81a0c97b2c8b7068a5 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,15 @@ 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 hiding_area_in_this_window(ConvertRectFromScreen(
+ gfx::IntersectRects(rect, window_->GetBoundsInScreen())));
sadrul 2016/12/08 03:34:45 I was thinking this would be: gfx::Rect rect_in_
yhanada 2016/12/08 03:47:49 Sorry, I misunderstood what you meant. Done.
- 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