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

Unified Diff: ui/keyboard/content/keyboard_ui_content.cc

Issue 2692093005: Suppress context menu on virtual keyboard to fix crash (Closed)
Patch Set: Rebased. Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/content/keyboard_ui_content.cc
diff --git a/ui/keyboard/content/keyboard_ui_content.cc b/ui/keyboard/content/keyboard_ui_content.cc
index 886c1288e75fb346b136fa23f88333418a0c9b8e..68621065515d221b13f2f5864a309266dee44f98 100644
--- a/ui/keyboard/content/keyboard_ui_content.cc
+++ b/ui/keyboard/content/keyboard_ui_content.cc
@@ -95,6 +95,25 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate,
ui_->RequestAudioInput(web_contents, request, callback);
}
+ // Overridden from content::WebContentsDelegate:
+ bool PreHandleGestureEvent(content::WebContents* source,
+ const blink::WebGestureEvent& event) override {
+ switch (event.type()) {
+ // Scroll events are not suppressed because the menu to select IME should
+ // be scrollable.
+ case blink::WebInputEvent::GestureScrollBegin:
+ case blink::WebInputEvent::GestureScrollEnd:
+ case blink::WebInputEvent::GestureScrollUpdate:
+ case blink::WebInputEvent::GestureFlingStart:
+ case blink::WebInputEvent::GestureFlingCancel:
+ return false;
+ default:
+ // Stop gesture events from being passed to renderer to suppress the
+ // context menu. crbug.com/685140
+ return true;
+ }
+ }
+
// Overridden from content::WebContentsObserver:
void WebContentsDestroyed() override { delete this; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698