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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2883653002: Implement TouchSelectionEditing controls for OOPIF. (Closed)
Patch Set: Rebase to master@{#474649}. Created 3 years, 7 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 4b4424e91734beea6329c407b5f59482958bfa91..e3278364433111e1b3e4ffc632dbc52538142254 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -918,7 +918,6 @@ void RenderWidgetHostViewAura::SubmitCompositorFrame(
UpdateBackgroundColorFromRenderer(frame.metadata.root_background_color);
last_scroll_offset_ = frame.metadata.root_scroll_offset;
-
cc::Selection<gfx::SelectionBound> selection = frame.metadata.selection;
if (IsUseZoomForDSFEnabled()) {
float viewportToDIPScale = 1.0f / current_device_scale_factor_;
@@ -940,8 +939,12 @@ void RenderWidgetHostViewAura::SubmitCompositorFrame(
delegated_frame_host_->SubmitCompositorFrame(local_surface_id,
std::move(frame));
}
- selection_controller_->OnSelectionBoundsChanged(selection.start,
- selection.end);
+ if (selection.start != selection_start_ || selection.end != selection_end_) {
+ selection_start_ = selection.start;
+ selection_end_ = selection.end;
+ selection_controller_client_->UpdateClientSelectionBounds(selection_start_,
+ selection_end_);
+ }
}
void RenderWidgetHostViewAura::OnDidNotProduceFrame(
@@ -1789,6 +1792,10 @@ void RenderWidgetHostViewAura::OnWindowFocused(aura::Window* gained_focus,
DetachFromInputMethod();
+ // TODO(wjmaclean): Do we need to let TouchSelectionControllerClientAura
+ // handle this, just in case it stomps on a new highlight in another view
+ // that has just become focused? So far it doesn't appear to be a problem,
+ // but we should keep an eye on it.
selection_controller_->HideAndDisallowShowingAutomatically();
if (overscroll_controller_)
@@ -2038,6 +2045,11 @@ void RenderWidgetHostViewAura::Shutdown() {
}
}
+TouchSelectionControllerClientManager*
+RenderWidgetHostViewAura::touch_selection_controller_client_manager() {
+ return selection_controller_client_.get();
+}
+
bool RenderWidgetHostViewAura::NeedsInputGrab() {
return popup_type_ == blink::kWebPopupTypePage;
}

Powered by Google App Engine
This is Rietveld 408576698