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

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

Issue 359033002: [Android] Enable composited selection updates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_native_handles_0_compositor
Patch Set: Rebase Created 6 years, 3 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
« no previous file with comments | « content/child/runtime_features.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(&params.anchor_rect, &params.focus_rect); 1828 GetSelectionBounds(&params.anchor_rect, &params.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
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
OLDNEW
« no previous file with comments | « content/child/runtime_features.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698