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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/child/runtime_features.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 8cf0ae0735652ea30717f1baa56af0806975a309..1034e08991b2638cc1389cd86abc31b4acfecce1 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -64,6 +64,7 @@
#include "third_party/WebKit/public/web/WebPopupMenu.h"
#include "third_party/WebKit/public/web/WebPopupMenuInfo.h"
#include "third_party/WebKit/public/web/WebRange.h"
+#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/skia/include/core/SkShader.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/frame_time.h"
@@ -1818,16 +1819,22 @@ void RenderWidget::UpdateSelectionBounds() {
if (handling_ime_event_)
return;
- ViewHostMsg_SelectionBounds_Params params;
- GetSelectionBounds(&params.anchor_rect, &params.focus_rect);
- if (selection_anchor_rect_ != params.anchor_rect ||
- selection_focus_rect_ != params.focus_rect) {
- selection_anchor_rect_ = params.anchor_rect;
- selection_focus_rect_ = params.focus_rect;
- webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir);
- params.is_anchor_first = webwidget_->isSelectionAnchorFirst();
- Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params));
+ // With composited selection updates, the selection bounds will be reported
+ // directly by the compositor, in which case explicit IPC selection
+ // notifications should be suppressed.
+ if (!blink::WebRuntimeFeatures::isCompositedSelectionUpdateEnabled()) {
+ ViewHostMsg_SelectionBounds_Params params;
+ GetSelectionBounds(&params.anchor_rect, &params.focus_rect);
+ if (selection_anchor_rect_ != params.anchor_rect ||
+ selection_focus_rect_ != params.focus_rect) {
+ selection_anchor_rect_ = params.anchor_rect;
+ selection_focus_rect_ = params.focus_rect;
+ webwidget_->selectionTextDirection(params.focus_dir, params.anchor_dir);
+ params.is_anchor_first = webwidget_->isSelectionAnchorFirst();
+ Send(new ViewHostMsg_SelectionBoundsChanged(routing_id_, params));
+ }
}
+
#if defined(OS_MACOSX) || defined(USE_AURA)
UpdateCompositionInfo(false);
#endif
« 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