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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2554513002: Change |EnsureCaretInRect| to |EnsureCaretNotInRect|. (Closed)
Patch Set: address the comments 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1417 return true; 1417 return true;
1418 } 1418 }
1419 1419
1420 void RenderWidgetHostViewAura::ExtendSelectionAndDelete( 1420 void RenderWidgetHostViewAura::ExtendSelectionAndDelete(
1421 size_t before, size_t after) { 1421 size_t before, size_t after) {
1422 RenderFrameHostImpl* rfh = GetFocusedFrame(); 1422 RenderFrameHostImpl* rfh = GetFocusedFrame();
1423 if (rfh) 1423 if (rfh)
1424 rfh->ExtendSelectionAndDelete(before, after); 1424 rfh->ExtendSelectionAndDelete(before, after);
1425 } 1425 }
1426 1426
1427 void RenderWidgetHostViewAura::EnsureCaretInRect(const gfx::Rect& rect) { 1427 void RenderWidgetHostViewAura::EnsureCaretNotInRect(const gfx::Rect& rect) {
1428 gfx::Rect intersected_rect( 1428 gfx::Rect hiding_area_in_this_window(
1429 gfx::IntersectRects(rect, window_->GetBoundsInScreen())); 1429 gfx::IntersectRects(rect, window_->GetBoundsInScreen()));
1430 1430
1431 if (intersected_rect.IsEmpty()) 1431 if (hiding_area_in_this_window.IsEmpty())
1432 return; 1432 return;
1433 1433
1434 host_->ScrollFocusedEditableNodeIntoRect( 1434 host_->ScrollFocusedEditableNodeIntoRect(
1435 ConvertRectFromScreen(intersected_rect)); 1435 ConvertRectFromScreen(gfx::SubtractRects(window_->GetBoundsInScreen(),
1436 hiding_area_in_this_window)));
sadrul 2016/12/08 00:57:29 If you change |rect| from screen-space to local-sp
yhanada 2016/12/08 03:31:36 Done.
1436 } 1437 }
1437 1438
1438 bool RenderWidgetHostViewAura::IsTextEditCommandEnabled( 1439 bool RenderWidgetHostViewAura::IsTextEditCommandEnabled(
1439 ui::TextEditCommand command) const { 1440 ui::TextEditCommand command) const {
1440 return false; 1441 return false;
1441 } 1442 }
1442 1443
1443 void RenderWidgetHostViewAura::SetTextEditCommandForNextKeyEvent( 1444 void RenderWidgetHostViewAura::SetTextEditCommandForNextKeyEvent(
1444 ui::TextEditCommand command) {} 1445 ui::TextEditCommand command) {}
1445 1446
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
2388 2389
2389 void RenderWidgetHostViewAura::SetPopupChild( 2390 void RenderWidgetHostViewAura::SetPopupChild(
2390 RenderWidgetHostViewAura* popup_child_host_view) { 2391 RenderWidgetHostViewAura* popup_child_host_view) {
2391 popup_child_host_view_ = popup_child_host_view; 2392 popup_child_host_view_ = popup_child_host_view;
2392 event_handler_->SetPopupChild( 2393 event_handler_->SetPopupChild(
2393 popup_child_host_view, 2394 popup_child_host_view,
2394 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr); 2395 popup_child_host_view ? popup_child_host_view->event_handler() : nullptr);
2395 } 2396 }
2396 2397
2397 } // namespace content 2398 } // namespace content
OLDNEW
« 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