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 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 *anchor = anchor_webrect; | 1961 *anchor = anchor_webrect; |
1962 } | 1962 } |
1963 | 1963 |
1964 void RenderWidget::UpdateSelectionBounds() { | 1964 void RenderWidget::UpdateSelectionBounds() { |
1965 TRACE_EVENT0("renderer", "RenderWidget::UpdateSelectionBounds"); | 1965 TRACE_EVENT0("renderer", "RenderWidget::UpdateSelectionBounds"); |
1966 if (!webwidget_) | 1966 if (!webwidget_) |
1967 return; | 1967 return; |
1968 if (handling_ime_event_) | 1968 if (handling_ime_event_) |
1969 return; | 1969 return; |
1970 | 1970 |
| 1971 #if defined(USE_AURA) |
| 1972 // TODO(mohsen): For now, always send explicit selection IPC notifications for |
| 1973 // Aura beucause composited selection updates are not working for webview tags |
| 1974 // which regresses IME inside webview. Remove this when composited selection |
| 1975 // updates are fixed for webviews. See, http://crbug.com/510568. |
| 1976 bool send_ipc = true; |
| 1977 #else |
1971 // With composited selection updates, the selection bounds will be reported | 1978 // With composited selection updates, the selection bounds will be reported |
1972 // directly by the compositor, in which case explicit IPC selection | 1979 // directly by the compositor, in which case explicit IPC selection |
1973 // notifications should be suppressed. | 1980 // notifications should be suppressed. |
1974 if (!blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled()) { | 1981 bool send_ipc = |
| 1982 !blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled(); |
| 1983 #endif |
| 1984 if (send_ipc) { |
1975 ViewHostMsg_SelectionBounds_Params params; | 1985 ViewHostMsg_SelectionBounds_Params params; |
1976 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); | 1986 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); |
1977 if (selection_anchor_rect_ != params.anchor_rect || | 1987 if (selection_anchor_rect_ != params.anchor_rect || |
1978 selection_focus_rect_ != params.focus_rect) { | 1988 selection_focus_rect_ != params.focus_rect) { |
1979 selection_anchor_rect_ = params.anchor_rect; | 1989 selection_anchor_rect_ = params.anchor_rect; |
1980 selection_focus_rect_ = params.focus_rect; | 1990 selection_focus_rect_ = params.focus_rect; |
1981 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); | 1991 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); |
1982 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); | 1992 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); |
1983 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 1993 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
1984 } | 1994 } |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2412 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2422 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2413 video_hole_frames_.AddObserver(frame); | 2423 video_hole_frames_.AddObserver(frame); |
2414 } | 2424 } |
2415 | 2425 |
2416 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2426 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2417 video_hole_frames_.RemoveObserver(frame); | 2427 video_hole_frames_.RemoveObserver(frame); |
2418 } | 2428 } |
2419 #endif // defined(VIDEO_HOLE) | 2429 #endif // defined(VIDEO_HOLE) |
2420 | 2430 |
2421 } // namespace content | 2431 } // namespace content |
OLD | NEW |