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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #include "third_party/skia/include/core/SkPixelRef.h" | 94 #include "third_party/skia/include/core/SkPixelRef.h" |
95 #endif // defined(OS_POSIX) | 95 #endif // defined(OS_POSIX) |
96 | 96 |
97 #include "third_party/WebKit/public/web/WebWidget.h" | 97 #include "third_party/WebKit/public/web/WebWidget.h" |
98 | 98 |
99 using blink::WebCompositionUnderline; | 99 using blink::WebCompositionUnderline; |
100 using blink::WebCursorInfo; | 100 using blink::WebCursorInfo; |
101 using blink::WebDeviceEmulationParams; | 101 using blink::WebDeviceEmulationParams; |
102 using blink::WebGestureEvent; | 102 using blink::WebGestureEvent; |
103 using blink::WebInputEvent; | 103 using blink::WebInputEvent; |
| 104 using blink::WebInputEventResult; |
104 using blink::WebKeyboardEvent; | 105 using blink::WebKeyboardEvent; |
105 using blink::WebMouseEvent; | 106 using blink::WebMouseEvent; |
106 using blink::WebMouseWheelEvent; | 107 using blink::WebMouseWheelEvent; |
107 using blink::WebNavigationPolicy; | 108 using blink::WebNavigationPolicy; |
108 using blink::WebNode; | 109 using blink::WebNode; |
109 using blink::WebPagePopup; | 110 using blink::WebPagePopup; |
110 using blink::WebPoint; | 111 using blink::WebPoint; |
111 using blink::WebPopupType; | 112 using blink::WebPopupType; |
112 using blink::WebRange; | 113 using blink::WebRange; |
113 using blink::WebRect; | 114 using blink::WebRect; |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1174 const WebGestureEvent& gesture_event = | 1175 const WebGestureEvent& gesture_event = |
1175 *static_cast<const WebGestureEvent*>(input_event); | 1176 *static_cast<const WebGestureEvent*>(input_event); |
1176 context_menu_source_type_ = ui::MENU_SOURCE_TOUCH; | 1177 context_menu_source_type_ = ui::MENU_SOURCE_TOUCH; |
1177 prevent_default = prevent_default || WillHandleGestureEvent(gesture_event); | 1178 prevent_default = prevent_default || WillHandleGestureEvent(gesture_event); |
1178 } | 1179 } |
1179 | 1180 |
1180 bool processed = prevent_default; | 1181 bool processed = prevent_default; |
1181 if (input_event->type != WebInputEvent::Char || !suppress_next_char_events_) { | 1182 if (input_event->type != WebInputEvent::Char || !suppress_next_char_events_) { |
1182 suppress_next_char_events_ = false; | 1183 suppress_next_char_events_ = false; |
1183 if (!processed && webwidget_) | 1184 if (!processed && webwidget_) |
1184 processed = webwidget_->handleInputEvent(*input_event); | 1185 processed = webwidget_->handleInputEvent(*input_event) != |
| 1186 WebInputEventResult::NotHandled; |
1185 } | 1187 } |
1186 | 1188 |
1187 // If this RawKeyDown event corresponds to a browser keyboard shortcut and | 1189 // If this RawKeyDown event corresponds to a browser keyboard shortcut and |
1188 // it's not processed by webkit, then we need to suppress the upcoming Char | 1190 // it's not processed by webkit, then we need to suppress the upcoming Char |
1189 // events. | 1191 // events. |
1190 bool is_keyboard_shortcut = | 1192 bool is_keyboard_shortcut = |
1191 input_event->type == WebInputEvent::RawKeyDown && | 1193 input_event->type == WebInputEvent::RawKeyDown && |
1192 static_cast<const WebKeyboardEvent*>(input_event)->isBrowserShortcut; | 1194 static_cast<const WebKeyboardEvent*>(input_event)->isBrowserShortcut; |
1193 if (!processed && is_keyboard_shortcut) | 1195 if (!processed && is_keyboard_shortcut) |
1194 suppress_next_char_events_ = true; | 1196 suppress_next_char_events_ = true; |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2453 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2452 video_hole_frames_.AddObserver(frame); | 2454 video_hole_frames_.AddObserver(frame); |
2453 } | 2455 } |
2454 | 2456 |
2455 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2457 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2456 video_hole_frames_.RemoveObserver(frame); | 2458 video_hole_frames_.RemoveObserver(frame); |
2457 } | 2459 } |
2458 #endif // defined(VIDEO_HOLE) | 2460 #endif // defined(VIDEO_HOLE) |
2459 | 2461 |
2460 } // namespace content | 2462 } // namespace content |
OLD | NEW |