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

Unified Diff: Source/core/inspector/InspectorInputAgent.cpp

Issue 1063653002: [DevTools] Cleanup after moving input to browser. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorInputAgent.h ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorInputAgent.cpp
diff --git a/Source/core/inspector/InspectorInputAgent.cpp b/Source/core/inspector/InspectorInputAgent.cpp
index 2c948bec94159f814f24944aea21126d3b2da2fd..f093b8d0cfdab84e555d88481a5c4fb97dcc2e15 100644
--- a/Source/core/inspector/InspectorInputAgent.cpp
+++ b/Source/core/inspector/InspectorInputAgent.cpp
@@ -38,8 +38,6 @@
#include "core/page/EventHandler.h"
#include "core/page/Page.h"
#include "platform/JSONValues.h"
-#include "platform/PlatformKeyboardEvent.h"
-#include "platform/PlatformMouseEvent.h"
#include "platform/PlatformTouchEvent.h"
#include "platform/PlatformTouchPoint.h"
#include "platform/geometry/FloatSize.h"
@@ -89,10 +87,9 @@ void ConvertInspectorPoint(blink::LocalFrame* frame, const blink::IntPoint& poin
namespace blink {
-InspectorInputAgent::InspectorInputAgent(InspectorPageAgent* pageAgent, Client* client)
+InspectorInputAgent::InspectorInputAgent(InspectorPageAgent* pageAgent)
: InspectorBaseAgent<InspectorInputAgent, InspectorFrontend::Input>("Input")
, m_pageAgent(pageAgent)
- , m_client(client)
{
}
@@ -100,98 +97,6 @@ InspectorInputAgent::~InspectorInputAgent()
{
}
-void InspectorInputAgent::dispatchKeyEvent(ErrorString* error, const String& type, const int* modifiers, const double* timestamp, const String* text, const String* unmodifiedText, const String* keyIdentifier, const String* code, const int* windowsVirtualKeyCode, const int* nativeVirtualKeyCode, const bool* autoRepeat, const bool* isKeypad, const bool* isSystemKey)
-{
- PlatformEvent::Type convertedType;
- if (type == "keyDown")
- convertedType = PlatformEvent::KeyDown;
- else if (type == "keyUp")
- convertedType = PlatformEvent::KeyUp;
- else if (type == "char")
- convertedType = PlatformEvent::Char;
- else if (type == "rawKeyDown")
- convertedType = PlatformEvent::RawKeyDown;
- else {
- *error = "Unrecognized type: " + type;
- return;
- }
-
- PlatformKeyboardEvent event(
- convertedType,
- text ? *text : "",
- unmodifiedText ? *unmodifiedText : "",
- keyIdentifier ? *keyIdentifier : "",
- code ? *code : "",
- windowsVirtualKeyCode ? *windowsVirtualKeyCode : 0,
- nativeVirtualKeyCode ? *nativeVirtualKeyCode : 0,
- asBool(autoRepeat),
- asBool(isKeypad),
- asBool(isSystemKey),
- static_cast<PlatformEvent::Modifiers>(modifiers ? *modifiers : 0),
- timestamp ? *timestamp : currentTime());
-
- if (!m_client) {
- *error = "Not supported";
- return;
- }
- m_client->dispatchKeyEvent(event);
-}
-
-void InspectorInputAgent::dispatchMouseEvent(ErrorString* error, const String& type, int x, int y, const int* modifiers, const double* timestamp, const String* button, const int* clickCount)
-{
- PlatformEvent::Type convertedType;
- if (type == "mousePressed")
- convertedType = PlatformEvent::MousePressed;
- else if (type == "mouseReleased")
- convertedType = PlatformEvent::MouseReleased;
- else if (type == "mouseMoved")
- convertedType = PlatformEvent::MouseMoved;
- else {
- *error = "Unrecognized type: " + type;
- return;
- }
-
- int convertedModifiers = modifiers ? *modifiers : 0;
-
- MouseButton convertedButton = NoButton;
- if (button) {
- if (*button == "left")
- convertedButton = LeftButton;
- else if (*button == "middle")
- convertedButton = MiddleButton;
- else if (*button == "right")
- convertedButton = RightButton;
- else if (*button != "none") {
- *error = "Unrecognized button: " + *button;
- return;
- }
- }
-
- // Some platforms may have flipped coordinate systems, but the given coordinates
- // assume the origin is in the top-left of the window. Convert.
- IntPoint convertedPoint, globalPoint;
- ConvertInspectorPoint(m_pageAgent->inspectedFrame(), IntPoint(x, y), &convertedPoint, &globalPoint);
-
- PlatformMouseEvent event(
- convertedPoint,
- globalPoint,
- convertedButton,
- convertedType,
- clickCount ? *clickCount : 0,
- convertedModifiers & PlatformEvent::ShiftKey,
- convertedModifiers & PlatformEvent::CtrlKey,
- convertedModifiers & PlatformEvent::AltKey,
- convertedModifiers & PlatformEvent::MetaKey,
- PlatformMouseEvent::RealOrIndistinguishable,
- timestamp ? *timestamp : currentTime());
-
- if (!m_client) {
- *error = "Not supported";
- return;
- }
- m_client->dispatchMouseEvent(event);
-}
-
void InspectorInputAgent::dispatchTouchEvent(ErrorString* error, const String& type, const RefPtr<JSONArray>& touchPoints, const int* modifiers, const double* timestamp)
{
PlatformEvent::Type convertedType;
« no previous file with comments | « Source/core/inspector/InspectorInputAgent.h ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698