| 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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 } | 1172 } |
| 1173 return; | 1173 return; |
| 1174 } | 1174 } |
| 1175 | 1175 |
| 1176 DispatchInputEventWithLatencyInfo(touch_event, &touch_with_latency.latency); | 1176 DispatchInputEventWithLatencyInfo(touch_event, &touch_with_latency.latency); |
| 1177 input_router_->SendTouchEvent(touch_with_latency); | 1177 input_router_->SendTouchEvent(touch_with_latency); |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 void RenderWidgetHostImpl::ForwardKeyboardEvent( | 1180 void RenderWidgetHostImpl::ForwardKeyboardEvent( |
| 1181 const NativeWebKeyboardEvent& key_event) { | 1181 const NativeWebKeyboardEvent& key_event) { |
| 1182 ForwardKeyboardEventWithCommands(key_event, nullptr); |
| 1183 } |
| 1184 |
| 1185 void RenderWidgetHostImpl::ForwardKeyboardEventWithCommands( |
| 1186 const NativeWebKeyboardEvent& key_event, |
| 1187 const std::vector<EditCommand>* commands) { |
| 1182 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardKeyboardEvent"); | 1188 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardKeyboardEvent"); |
| 1183 if (owner_delegate_ && | 1189 if (owner_delegate_ && |
| 1184 !owner_delegate_->MayRenderWidgetForwardKeyboardEvent(key_event)) { | 1190 !owner_delegate_->MayRenderWidgetForwardKeyboardEvent(key_event)) { |
| 1185 return; | 1191 return; |
| 1186 } | 1192 } |
| 1187 | 1193 |
| 1188 if (ShouldDropInputEvents()) | 1194 if (ShouldDropInputEvents()) |
| 1189 return; | 1195 return; |
| 1190 | 1196 |
| 1191 if (!process_->HasConnection()) | 1197 if (!process_->HasConnection()) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 suppress_events_until_keydown_ = false; | 1244 suppress_events_until_keydown_ = false; |
| 1239 } | 1245 } |
| 1240 | 1246 |
| 1241 if (touch_emulator_ && touch_emulator_->HandleKeyboardEvent(key_event)) | 1247 if (touch_emulator_ && touch_emulator_->HandleKeyboardEvent(key_event)) |
| 1242 return; | 1248 return; |
| 1243 ui::LatencyInfo latency_info(ui::SourceEventType::OTHER); | 1249 ui::LatencyInfo latency_info(ui::SourceEventType::OTHER); |
| 1244 NativeWebKeyboardEventWithLatencyInfo key_event_with_latency(key_event, | 1250 NativeWebKeyboardEventWithLatencyInfo key_event_with_latency(key_event, |
| 1245 latency_info); | 1251 latency_info); |
| 1246 key_event_with_latency.event.isBrowserShortcut = is_shortcut; | 1252 key_event_with_latency.event.isBrowserShortcut = is_shortcut; |
| 1247 DispatchInputEventWithLatencyInfo(key_event, &key_event_with_latency.latency); | 1253 DispatchInputEventWithLatencyInfo(key_event, &key_event_with_latency.latency); |
| 1254 // TODO(foolip): |InputRouter::SendKeyboardEvent()| may filter events, in |
| 1255 // which the commands will be treated as belonging to the next key event. |
| 1256 // InputMsg_SetEditCommandsForNextKeyEvent should only be sent if |
| 1257 // InputMsg_HandleInputEvent is, but has to be sent first. |
| 1258 // https://crbug.com/684298 |
| 1259 if (commands && !commands->empty()) { |
| 1260 Send( |
| 1261 new InputMsg_SetEditCommandsForNextKeyEvent(GetRoutingID(), *commands)); |
| 1262 } |
| 1248 input_router_->SendKeyboardEvent(key_event_with_latency); | 1263 input_router_->SendKeyboardEvent(key_event_with_latency); |
| 1249 } | 1264 } |
| 1250 | 1265 |
| 1251 void RenderWidgetHostImpl::QueueSyntheticGesture( | 1266 void RenderWidgetHostImpl::QueueSyntheticGesture( |
| 1252 std::unique_ptr<SyntheticGesture> synthetic_gesture, | 1267 std::unique_ptr<SyntheticGesture> synthetic_gesture, |
| 1253 const base::Callback<void(SyntheticGesture::Result)>& on_complete) { | 1268 const base::Callback<void(SyntheticGesture::Result)>& on_complete) { |
| 1254 if (!synthetic_gesture_controller_ && view_) { | 1269 if (!synthetic_gesture_controller_ && view_) { |
| 1255 synthetic_gesture_controller_.reset( | 1270 synthetic_gesture_controller_.reset( |
| 1256 new SyntheticGestureController(view_->CreateSyntheticGestureTarget())); | 1271 new SyntheticGestureController(view_->CreateSyntheticGestureTarget())); |
| 1257 } | 1272 } |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 // different from the receiver's. | 2527 // different from the receiver's. |
| 2513 file_system_file.url = | 2528 file_system_file.url = |
| 2514 GURL(storage::GetIsolatedFileSystemRootURIString( | 2529 GURL(storage::GetIsolatedFileSystemRootURIString( |
| 2515 file_system_url.origin(), filesystem_id, std::string()) | 2530 file_system_url.origin(), filesystem_id, std::string()) |
| 2516 .append(register_name)); | 2531 .append(register_name)); |
| 2517 file_system_file.filesystem_id = filesystem_id; | 2532 file_system_file.filesystem_id = filesystem_id; |
| 2518 } | 2533 } |
| 2519 } | 2534 } |
| 2520 | 2535 |
| 2521 } // namespace content | 2536 } // namespace content |
| OLD | NEW |