OLD | NEW |
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 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 *anchor = anchor_webrect; | 1999 *anchor = anchor_webrect; |
2000 } | 2000 } |
2001 | 2001 |
2002 void RenderWidget::UpdateSelectionBounds() { | 2002 void RenderWidget::UpdateSelectionBounds() { |
2003 TRACE_EVENT0("renderer", "RenderWidget::UpdateSelectionBounds"); | 2003 TRACE_EVENT0("renderer", "RenderWidget::UpdateSelectionBounds"); |
2004 if (!webwidget_) | 2004 if (!webwidget_) |
2005 return; | 2005 return; |
2006 if (handling_ime_event_) | 2006 if (handling_ime_event_) |
2007 return; | 2007 return; |
2008 | 2008 |
2009 #if defined(USE_AURA) | |
2010 // TODO(mohsen): For now, always send explicit selection IPC notifications for | |
2011 // Aura beucause composited selection updates are not working for webview tags | |
2012 // which regresses IME inside webview. Remove this when composited selection | |
2013 // updates are fixed for webviews. See, http://crbug.com/510568. | |
2014 bool send_ipc = true; | |
2015 #else | |
2016 // With composited selection updates, the selection bounds will be reported | 2009 // With composited selection updates, the selection bounds will be reported |
2017 // directly by the compositor, in which case explicit IPC selection | 2010 // directly by the compositor, in which case explicit IPC selection |
2018 // notifications should be suppressed. | 2011 // notifications should be suppressed. |
2019 bool send_ipc = | 2012 if (!blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled()) { |
2020 !blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled(); | |
2021 #endif | |
2022 if (send_ipc) { | |
2023 ViewHostMsg_SelectionBounds_Params params; | 2013 ViewHostMsg_SelectionBounds_Params params; |
2024 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); | 2014 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); |
2025 if (selection_anchor_rect_ != params.anchor_rect || | 2015 if (selection_anchor_rect_ != params.anchor_rect || |
2026 selection_focus_rect_ != params.focus_rect) { | 2016 selection_focus_rect_ != params.focus_rect) { |
2027 selection_anchor_rect_ = params.anchor_rect; | 2017 selection_anchor_rect_ = params.anchor_rect; |
2028 selection_focus_rect_ = params.focus_rect; | 2018 selection_focus_rect_ = params.focus_rect; |
2029 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); | 2019 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); |
2030 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); | 2020 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); |
2031 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 2021 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
2032 } | 2022 } |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2445 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2456 video_hole_frames_.AddObserver(frame); | 2446 video_hole_frames_.AddObserver(frame); |
2457 } | 2447 } |
2458 | 2448 |
2459 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2449 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2460 video_hole_frames_.RemoveObserver(frame); | 2450 video_hole_frames_.RemoveObserver(frame); |
2461 } | 2451 } |
2462 #endif // defined(VIDEO_HOLE) | 2452 #endif // defined(VIDEO_HOLE) |
2463 | 2453 |
2464 } // namespace content | 2454 } // namespace content |
OLD | NEW |