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 2009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 *focus = focus_webrect; | 2020 *focus = focus_webrect; |
2021 *anchor = anchor_webrect; | 2021 *anchor = anchor_webrect; |
2022 } | 2022 } |
2023 | 2023 |
2024 void RenderWidget::UpdateSelectionBounds() { | 2024 void RenderWidget::UpdateSelectionBounds() { |
2025 if (!webwidget_) | 2025 if (!webwidget_) |
2026 return; | 2026 return; |
2027 if (handling_ime_event_) | 2027 if (handling_ime_event_) |
2028 return; | 2028 return; |
2029 | 2029 |
| 2030 #if defined(USE_AURA) |
| 2031 // TODO(mohsen): For now, always send explicit selection IPC notifications for |
| 2032 // Aura beucause composited selection updates are not working for webview tags |
| 2033 // which regresses IME inside webview. Remove this when composited selection |
| 2034 // updates are fixed for webviews. See, http://crbug.com/510568. |
| 2035 bool send_ipc = true; |
| 2036 #else |
2030 // With composited selection updates, the selection bounds will be reported | 2037 // With composited selection updates, the selection bounds will be reported |
2031 // directly by the compositor, in which case explicit IPC selection | 2038 // directly by the compositor, in which case explicit IPC selection |
2032 // notifications should be suppressed. | 2039 // notifications should be suppressed. |
2033 if (!blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled()) { | 2040 bool send_ipc = |
| 2041 !blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled(); |
| 2042 #endif |
| 2043 if (send_ipc) { |
2034 ViewHostMsg_SelectionBounds_Params params; | 2044 ViewHostMsg_SelectionBounds_Params params; |
2035 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); | 2045 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); |
2036 if (selection_anchor_rect_ != params.anchor_rect || | 2046 if (selection_anchor_rect_ != params.anchor_rect || |
2037 selection_focus_rect_ != params.focus_rect) { | 2047 selection_focus_rect_ != params.focus_rect) { |
2038 selection_anchor_rect_ = params.anchor_rect; | 2048 selection_anchor_rect_ = params.anchor_rect; |
2039 selection_focus_rect_ = params.focus_rect; | 2049 selection_focus_rect_ = params.focus_rect; |
2040 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); | 2050 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); |
2041 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); | 2051 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); |
2042 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 2052 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
2043 } | 2053 } |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2478 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2469 video_hole_frames_.AddObserver(frame); | 2479 video_hole_frames_.AddObserver(frame); |
2470 } | 2480 } |
2471 | 2481 |
2472 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2482 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2473 video_hole_frames_.RemoveObserver(frame); | 2483 video_hole_frames_.RemoveObserver(frame); |
2474 } | 2484 } |
2475 #endif // defined(VIDEO_HOLE) | 2485 #endif // defined(VIDEO_HOLE) |
2476 | 2486 |
2477 } // namespace content | 2487 } // namespace content |
OLD | NEW |