Chromium Code Reviews| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1811 *focus = focus_webrect; | 1811 *focus = focus_webrect; |
| 1812 *anchor = anchor_webrect; | 1812 *anchor = anchor_webrect; |
| 1813 } | 1813 } |
| 1814 | 1814 |
| 1815 void RenderWidget::UpdateSelectionBounds() { | 1815 void RenderWidget::UpdateSelectionBounds() { |
| 1816 if (!webwidget_) | 1816 if (!webwidget_) |
| 1817 return; | 1817 return; |
| 1818 if (handling_ime_event_) | 1818 if (handling_ime_event_) |
| 1819 return; | 1819 return; |
| 1820 | 1820 |
| 1821 // With composited selection updates, the selection bounds will be reported | |
| 1822 // directly by the compositor, in which case explicit IPC selection | |
| 1823 // notifications should be suppressed. | |
| 1824 // TODO(jdduke): Remove this when all platforms use composited updates for | |
| 1825 // selection bounds, crbug.com/399721. | |
| 1826 #if !defined(OS_ANDROID) | |
|
jochen (gone - plz use gerrit)
2014/09/19 13:25:11
why not add WebRuntimeFeatures::isCompositedSelect
jdduke (slow)
2014/09/19 15:46:07
What, and make the code both less brittle and easi
| |
| 1821 ViewHostMsg_SelectionBounds_Params params; | 1827 ViewHostMsg_SelectionBounds_Params params; |
| 1822 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); | 1828 GetSelectionBounds(¶ms.anchor_rect, ¶ms.focus_rect); |
| 1823 if (selection_anchor_rect_ != params.anchor_rect || | 1829 if (selection_anchor_rect_ != params.anchor_rect || |
| 1824 selection_focus_rect_ != params.focus_rect) { | 1830 selection_focus_rect_ != params.focus_rect) { |
| 1825 selection_anchor_rect_ = params.anchor_rect; | 1831 selection_anchor_rect_ = params.anchor_rect; |
| 1826 selection_focus_rect_ = params.focus_rect; | 1832 selection_focus_rect_ = params.focus_rect; |
| 1827 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); | 1833 webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir); |
| 1828 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); | 1834 params.is_anchor_first = webwidget_->isSelectionAnchorFirst(); |
| 1829 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); | 1835 Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params)); |
| 1830 } | 1836 } |
| 1837 #endif | |
| 1838 | |
| 1831 #if defined(OS_MACOSX) || defined(USE_AURA) | 1839 #if defined(OS_MACOSX) || defined(USE_AURA) |
| 1832 UpdateCompositionInfo(false); | 1840 UpdateCompositionInfo(false); |
| 1833 #endif | 1841 #endif |
| 1834 } | 1842 } |
| 1835 | 1843 |
| 1836 // Check blink::WebTextInputType and ui::TextInputType is kept in sync. | 1844 // Check blink::WebTextInputType and ui::TextInputType is kept in sync. |
| 1837 COMPILE_ASSERT(int(blink::WebTextInputTypeNone) == \ | 1845 COMPILE_ASSERT(int(blink::WebTextInputTypeNone) == \ |
| 1838 int(ui::TEXT_INPUT_TYPE_NONE), mismatching_enums); | 1846 int(ui::TEXT_INPUT_TYPE_NONE), mismatching_enums); |
| 1839 COMPILE_ASSERT(int(blink::WebTextInputTypeText) == \ | 1847 COMPILE_ASSERT(int(blink::WebTextInputTypeText) == \ |
| 1840 int(ui::TEXT_INPUT_TYPE_TEXT), mismatching_enums); | 1848 int(ui::TEXT_INPUT_TYPE_TEXT), mismatching_enums); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2181 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2189 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2182 video_hole_frames_.AddObserver(frame); | 2190 video_hole_frames_.AddObserver(frame); |
| 2183 } | 2191 } |
| 2184 | 2192 |
| 2185 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2193 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2186 video_hole_frames_.RemoveObserver(frame); | 2194 video_hole_frames_.RemoveObserver(frame); |
| 2187 } | 2195 } |
| 2188 #endif // defined(VIDEO_HOLE) | 2196 #endif // defined(VIDEO_HOLE) |
| 2189 | 2197 |
| 2190 } // namespace content | 2198 } // namespace content |
| OLD | NEW |