Merge ~osomon/oxide:hide-insertion-handle-on-input into oxide:master

Proposed by Olivier Tilloy on 2016-06-09
Status: Merged
Merged at revision: 298acc65db5cb678f6a6d033d6ed340b4028d7dc
Proposed branch: ~osomon/oxide:hide-insertion-handle-on-input
Merge into: oxide:master
Diff against target: 90 lines (+20/-1)
4 files modified
shared/browser/input/oxide_ime_bridge_impl.cc (+5/-1)
shared/browser/oxide_render_widget_host_view.cc (+7/-0)
shared/browser/oxide_render_widget_host_view.h (+2/-0)
shared/browser/oxide_web_contents_view.cc (+6/-0)
Reviewer Review Type Date Requested Status
Chris Coulson 2016-06-09 Approve on 2016-06-16
Review via email: mp+296959@code.launchpad.net

Commit message

Hide the selection handle upon keyboard/mouse/OSK interaction.

This does something similar to TouchSelectionControllerClientAura::EnvPreTargetHandler.
Fixes: https://launchpad.net/bugs/1590776.

To post a comment you must log in.
Chris Coulson (chrisccoulson) wrote :

This mostly looks ok, although I think I'd like to see the copy/pasted code implemented as a new function somewhere

review: Needs Fixing
2aa8a09... by Olivier Tilloy on 2016-06-15

Factor out common code into RenderWidgetHostView::OnUserInput().

Olivier Tilloy (osomon) wrote :

Updated. Does that look good?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/shared/browser/input/oxide_ime_bridge_impl.cc b/shared/browser/input/oxide_ime_bridge_impl.cc
2index cd24cda..3fb8fcc 100644
3--- a/shared/browser/input/oxide_ime_bridge_impl.cc
4+++ b/shared/browser/input/oxide_ime_bridge_impl.cc
5@@ -1,5 +1,5 @@
6 // vim:expandtab:shiftwidth=2:tabstop=2:
7-// Copyright (C) 2015 Canonical Ltd.
8+// Copyright (C) 2015-2016 Canonical Ltd.
9
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12@@ -63,6 +63,8 @@ void ImeBridgeImpl::CommitText(const base::string16& text,
13 return;
14 }
15
16+ rwhv_->OnUserInput();
17+
18 content::RenderWidgetHostImpl* rwhi =
19 content::RenderWidgetHostImpl::From(rwhv_->GetRenderWidgetHost());
20 SendFakeCompositionKeyEvent(rwhi, blink::WebInputEvent::RawKeyDown);
21@@ -78,6 +80,8 @@ void ImeBridgeImpl::SetComposingText(
22 return;
23 }
24
25+ rwhv_->OnUserInput();
26+
27 content::RenderWidgetHostImpl* rwhi =
28 content::RenderWidgetHostImpl::From(rwhv_->GetRenderWidgetHost());
29 SendFakeCompositionKeyEvent(rwhi, blink::WebInputEvent::RawKeyDown);
30diff --git a/shared/browser/oxide_render_widget_host_view.cc b/shared/browser/oxide_render_widget_host_view.cc
31index 711174e..efef1ca 100644
32--- a/shared/browser/oxide_render_widget_host_view.cc
33+++ b/shared/browser/oxide_render_widget_host_view.cc
34@@ -568,6 +568,13 @@ void RenderWidgetHostView::OnGestureEvent(
35 host_->ForwardGestureEvent(event);
36 }
37
38+void RenderWidgetHostView::OnUserInput() const {
39+ if (selection_controller_->active_status() ==
40+ ui::TouchSelectionController::INSERTION_ACTIVE) {
41+ selection_controller_->HideAndDisallowShowingAutomatically();
42+ }
43+}
44+
45 bool RenderWidgetHostView::HandleContextMenu(
46 const content::ContextMenuParams& params) {
47 if ((params.source_type == ui::MENU_SOURCE_LONG_PRESS) &&
48diff --git a/shared/browser/oxide_render_widget_host_view.h b/shared/browser/oxide_render_widget_host_view.h
49index af620cc..7607dde 100644
50--- a/shared/browser/oxide_render_widget_host_view.h
51+++ b/shared/browser/oxide_render_widget_host_view.h
52@@ -107,6 +107,8 @@ class RenderWidgetHostView
53 return selection_controller_.get();
54 }
55
56+ void OnUserInput() const;
57+
58 bool HandleContextMenu(const content::ContextMenuParams& params);
59
60 private:
61diff --git a/shared/browser/oxide_web_contents_view.cc b/shared/browser/oxide_web_contents_view.cc
62index 6094b8e..0828883 100644
63--- a/shared/browser/oxide_web_contents_view.cc
64+++ b/shared/browser/oxide_web_contents_view.cc
65@@ -830,6 +830,8 @@ void WebContentsView::HandleKeyEvent(
66 return;
67 }
68
69+ GetRenderWidgetHostView()->OnUserInput();
70+
71 host->ForwardKeyboardEvent(event);
72 }
73
74@@ -843,6 +845,8 @@ void WebContentsView::HandleMouseEvent(const blink::WebMouseEvent& event) {
75 return;
76 }
77
78+ GetRenderWidgetHostView()->OnUserInput();
79+
80 host->ForwardMouseEvent(e);
81 }
82
83@@ -862,6 +866,8 @@ void WebContentsView::HandleWheelEvent(
84 return;
85 }
86
87+ GetRenderWidgetHostView()->OnUserInput();
88+
89 host->ForwardWheelEvent(event);
90 }
91

Subscribers

People subscribed via source and target branches