OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 "x", mouse_event.x, "y", mouse_event.y); | 563 "x", mouse_event.x, "y", mouse_event.y); |
564 prevent_default = WillHandleMouseEvent(mouse_event); | 564 prevent_default = WillHandleMouseEvent(mouse_event); |
565 } | 565 } |
566 | 566 |
567 if (WebInputEvent::isGestureEventType(input_event->type)) { | 567 if (WebInputEvent::isGestureEventType(input_event->type)) { |
568 const WebGestureEvent& gesture_event = | 568 const WebGestureEvent& gesture_event = |
569 *static_cast<const WebGestureEvent*>(input_event); | 569 *static_cast<const WebGestureEvent*>(input_event); |
570 prevent_default = prevent_default || WillHandleGestureEvent(gesture_event); | 570 prevent_default = prevent_default || WillHandleGestureEvent(gesture_event); |
571 } | 571 } |
572 | 572 |
| 573 if (input_event->type == WebInputEvent::GestureTap || |
| 574 input_event->type == WebInputEvent::GestureLongPress) |
| 575 resetInputMethod(); |
| 576 |
573 bool processed = prevent_default; | 577 bool processed = prevent_default; |
574 if (input_event->type != WebInputEvent::Char || !suppress_next_char_events_) { | 578 if (input_event->type != WebInputEvent::Char || !suppress_next_char_events_) { |
575 suppress_next_char_events_ = false; | 579 suppress_next_char_events_ = false; |
576 if (!processed && webwidget_) | 580 if (!processed && webwidget_) |
577 processed = webwidget_->handleInputEvent(*input_event); | 581 processed = webwidget_->handleInputEvent(*input_event); |
578 } | 582 } |
579 | 583 |
580 // If this RawKeyDown event corresponds to a browser keyboard shortcut and | 584 // If this RawKeyDown event corresponds to a browser keyboard shortcut and |
581 // it's not processed by webkit, then we need to suppress the upcoming Char | 585 // it's not processed by webkit, then we need to suppress the upcoming Char |
582 // events. | 586 // events. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 } | 1233 } |
1230 | 1234 |
1231 void RenderWidget::willBeginCompositorFrame() { | 1235 void RenderWidget::willBeginCompositorFrame() { |
1232 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); | 1236 TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame"); |
1233 | 1237 |
1234 DCHECK(RenderThreadImpl::current()->compositor_thread()); | 1238 DCHECK(RenderThreadImpl::current()->compositor_thread()); |
1235 | 1239 |
1236 // The following two can result in further layout and possibly | 1240 // The following two can result in further layout and possibly |
1237 // enable GPU acceleration so they need to be called before any painting | 1241 // enable GPU acceleration so they need to be called before any painting |
1238 // is done. | 1242 // is done. |
1239 UpdateTextInputState(DO_NOT_SHOW_IME); | |
1240 UpdateSelectionBounds(); | 1243 UpdateSelectionBounds(); |
1241 | 1244 |
1242 WillInitiatePaint(); | 1245 WillInitiatePaint(); |
1243 } | 1246 } |
1244 | 1247 |
1245 void RenderWidget::didBecomeReadyForAdditionalInput() { | 1248 void RenderWidget::didBecomeReadyForAdditionalInput() { |
1246 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); | 1249 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); |
1247 if (pending_input_event_ack_.get()) | 1250 if (pending_input_event_ack_.get()) |
1248 Send(pending_input_event_ack_.release()); | 1251 Send(pending_input_event_ack_.release()); |
1249 } | 1252 } |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 | 1984 |
1982 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1985 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1983 return false; | 1986 return false; |
1984 } | 1987 } |
1985 | 1988 |
1986 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { | 1989 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { |
1987 return true; | 1990 return true; |
1988 } | 1991 } |
1989 | 1992 |
1990 } // namespace content | 1993 } // namespace content |
OLD | NEW |