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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/keyboard/content/keyboard_ui_content.h" 5 #include "ui/keyboard/content/keyboard_ui_content.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/public/browser/render_widget_host.h" 10 #include "content/public/browser/render_widget_host.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 89
90 // Overridden from content::WebContentsDelegate: 90 // Overridden from content::WebContentsDelegate:
91 void RequestMediaAccessPermission( 91 void RequestMediaAccessPermission(
92 content::WebContents* web_contents, 92 content::WebContents* web_contents,
93 const content::MediaStreamRequest& request, 93 const content::MediaStreamRequest& request,
94 const content::MediaResponseCallback& callback) override { 94 const content::MediaResponseCallback& callback) override {
95 ui_->RequestAudioInput(web_contents, request, callback); 95 ui_->RequestAudioInput(web_contents, request, callback);
96 } 96 }
97 97
98 // Overridden from content::WebContentsDelegate:
99 bool PreHandleGestureEvent(content::WebContents* source,
100 const blink::WebGestureEvent& event) override {
101 switch (event.type()) {
102 // Scroll events are not suppressed because the menu to select IME should
103 // be scrollable.
104 case blink::WebInputEvent::GestureScrollBegin:
105 case blink::WebInputEvent::GestureScrollEnd:
106 case blink::WebInputEvent::GestureScrollUpdate:
107 case blink::WebInputEvent::GestureFlingStart:
108 case blink::WebInputEvent::GestureFlingCancel:
109 return false;
110 default:
111 // Stop gesture events from being passed to renderer to suppress the
112 // context menu. crbug.com/685140
113 return true;
114 }
115 }
116
98 // Overridden from content::WebContentsObserver: 117 // Overridden from content::WebContentsObserver:
99 void WebContentsDestroyed() override { delete this; } 118 void WebContentsDestroyed() override { delete this; }
100 119
101 keyboard::KeyboardUIContent* ui_; 120 keyboard::KeyboardUIContent* ui_;
102 121
103 DISALLOW_COPY_AND_ASSIGN(KeyboardContentsDelegate); 122 DISALLOW_COPY_AND_ASSIGN(KeyboardContentsDelegate);
104 }; 123 };
105 124
106 } // namespace 125 } // namespace
107 126
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 keyboard_controller()->keyboard_visible()); 347 keyboard_controller()->keyboard_visible());
329 } 348 }
330 349
331 void KeyboardUIContent::AddBoundsChangedObserver(aura::Window* window) { 350 void KeyboardUIContent::AddBoundsChangedObserver(aura::Window* window) {
332 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr; 351 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr;
333 if (target_window) 352 if (target_window)
334 window_bounds_observer_->AddObservedWindow(target_window); 353 window_bounds_observer_->AddObservedWindow(target_window);
335 } 354 }
336 355
337 } // namespace keyboard 356 } // namespace keyboard
OLDNEW
« 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