| OLD | NEW |
| 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 "content/browser/devtools/renderer_overrides_handler.h" | 5 #include "content/browser/devtools/renderer_overrides_handler.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/barrier_closure.h" | 10 #include "base/barrier_closure.h" |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 RendererOverridesHandler::InputDispatchGestureEvent( | 926 RendererOverridesHandler::InputDispatchGestureEvent( |
| 927 scoped_refptr<DevToolsProtocol::Command> command) { | 927 scoped_refptr<DevToolsProtocol::Command> command) { |
| 928 base::DictionaryValue* params = command->params(); | 928 base::DictionaryValue* params = command->params(); |
| 929 if (!params) | 929 if (!params) |
| 930 return NULL; | 930 return NULL; |
| 931 | 931 |
| 932 RenderViewHostImpl* host = static_cast<RenderViewHostImpl*>( | 932 RenderViewHostImpl* host = static_cast<RenderViewHostImpl*>( |
| 933 agent_->GetRenderViewHost()); | 933 agent_->GetRenderViewHost()); |
| 934 blink::WebGestureEvent event; | 934 blink::WebGestureEvent event; |
| 935 ParseGenericInputParams(params, &event); | 935 ParseGenericInputParams(params, &event); |
| 936 event.sourceDevice = WebGestureEvent::Touchscreen; | 936 event.sourceDevice = blink::WebGestureDeviceTouchscreen; |
| 937 | 937 |
| 938 std::string type; | 938 std::string type; |
| 939 if (params->GetString(devtools::Input::dispatchGestureEvent::kParamType, | 939 if (params->GetString(devtools::Input::dispatchGestureEvent::kParamType, |
| 940 &type)) { | 940 &type)) { |
| 941 if (type == | 941 if (type == |
| 942 devtools::Input::dispatchGestureEvent::Type::kEnumScrollBegin) | 942 devtools::Input::dispatchGestureEvent::Type::kEnumScrollBegin) |
| 943 event.type = WebInputEvent::GestureScrollBegin; | 943 event.type = WebInputEvent::GestureScrollBegin; |
| 944 else if (type == | 944 else if (type == |
| 945 devtools::Input::dispatchGestureEvent::Type::kEnumScrollUpdate) | 945 devtools::Input::dispatchGestureEvent::Type::kEnumScrollUpdate) |
| 946 event.type = WebInputEvent::GestureScrollUpdate; | 946 event.type = WebInputEvent::GestureScrollUpdate; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 return NULL; | 998 return NULL; |
| 999 } | 999 } |
| 1000 event.data.pinchUpdate.scale = static_cast<float>(scale); | 1000 event.data.pinchUpdate.scale = static_cast<float>(scale); |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 host->ForwardGestureEvent(event); | 1003 host->ForwardGestureEvent(event); |
| 1004 return command->SuccessResponse(NULL); | 1004 return command->SuccessResponse(NULL); |
| 1005 } | 1005 } |
| 1006 | 1006 |
| 1007 } // namespace content | 1007 } // namespace content |
| OLD | NEW |