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

Side by Side Diff: content/renderer/render_widget.cc

Issue 698253004: Reland: Implement Aura side of unified touch text selection for contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 years, 5 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 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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 *focus = focus_webrect; 2006 *focus = focus_webrect;
2007 *anchor = anchor_webrect; 2007 *anchor = anchor_webrect;
2008 } 2008 }
2009 2009
2010 void RenderWidget::UpdateSelectionBounds() { 2010 void RenderWidget::UpdateSelectionBounds() {
2011 if (!webwidget_) 2011 if (!webwidget_)
2012 return; 2012 return;
2013 if (handling_ime_event_) 2013 if (handling_ime_event_)
2014 return; 2014 return;
2015 2015
2016 #if defined(USE_AURA)
2017 // TODO(mohsen): For now, always send explicit selection IPC notifications for
2018 // Aura beucause composited selection updates are not working for webview tags
2019 // which regresses IME inside webview. Remove this when composited selection
2020 // updates are fixed for webviews.
2021 bool send_ipc = true;
jdduke (slow) 2015/07/08 15:22:42 This is pretty scary. Do we know why this isn't wo
mohsen 2015/07/08 21:26:18 IME uses cursor location to show a popup when user
2022 #else
2016 // With composited selection updates, the selection bounds will be reported 2023 // With composited selection updates, the selection bounds will be reported
2017 // directly by the compositor, in which case explicit IPC selection 2024 // directly by the compositor, in which case explicit IPC selection
2018 // notifications should be suppressed. 2025 // notifications should be suppressed.
2019 if (!blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled()) { 2026 bool send_ipc =
2027 !blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled();
2028 #endif
2029 if (send_ipc) {
2020 ViewHostMsg_SelectionBounds_Params params; 2030 ViewHostMsg_SelectionBounds_Params params;
2021 GetSelectionBounds(&params.anchor_rect, &params.focus_rect); 2031 GetSelectionBounds(&params.anchor_rect, &params.focus_rect);
2022 if (selection_anchor_rect_ != params.anchor_rect || 2032 if (selection_anchor_rect_ != params.anchor_rect ||
2023 selection_focus_rect_ != params.focus_rect) { 2033 selection_focus_rect_ != params.focus_rect) {
2024 selection_anchor_rect_ = params.anchor_rect; 2034 selection_anchor_rect_ = params.anchor_rect;
2025 selection_focus_rect_ = params.focus_rect; 2035 selection_focus_rect_ = params.focus_rect;
2026 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); 2036 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir);
2027 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); 2037 params.is_anchor_first = webwidget_->isSelectionAnchorFirst();
2028 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); 2038 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params));
2029 } 2039 }
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
2454 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2464 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2455 video_hole_frames_.AddObserver(frame); 2465 video_hole_frames_.AddObserver(frame);
2456 } 2466 }
2457 2467
2458 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2468 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2459 video_hole_frames_.RemoveObserver(frame); 2469 video_hole_frames_.RemoveObserver(frame);
2460 } 2470 }
2461 #endif // defined(VIDEO_HOLE) 2471 #endif // defined(VIDEO_HOLE)
2462 2472
2463 } // namespace content 2473 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698