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

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

Issue 17030009: Inspector: wrapped inspector agent instances into factory-like wrappers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 7 years, 6 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/InspectorIndexedDBAgent.cpp ('k') | Source/core/inspector/InspectorInputAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorInputAgent.h
diff --git a/Source/core/inspector/InspectorInputAgent.h b/Source/core/inspector/InspectorInputAgent.h
index d3295293afbba5eac7b1b1a3158d36d4eb810a92..575b4ba25917c52229cb1a35a71799a708d55795 100644
--- a/Source/core/inspector/InspectorInputAgent.h
+++ b/Source/core/inspector/InspectorInputAgent.h
@@ -45,28 +45,44 @@ class Page;
typedef String ErrorString;
-class InspectorInputAgent : public InspectorBaseAgent<InspectorInputAgent>, public InspectorBackendDispatcher::InputCommandHandler {
+class InspectorInputAgent : public InspectorBaseAgent, public InspectorBackendDispatcher::InputCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorInputAgent);
public:
- static PassOwnPtr<InspectorInputAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* inspectorState, Page* page, InspectorClient* client)
+ static PassRefPtr<InspectorInputAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* inspectorState, Page* page, InspectorClient* client)
{
- return adoptPtr(new InspectorInputAgent(instrumentingAgents, inspectorState, page, client));
+ return adoptRef(new InspectorInputAgent(instrumentingAgents, inspectorState, page, client));
}
- ~InspectorInputAgent();
+ virtual ~InspectorInputAgent();
// Methods called from the frontend for simulating input.
virtual void dispatchKeyEvent(ErrorString*, const String& type, const int* modifiers, const double* timestamp, const String* text, const String* unmodifiedText, const String* keyIdentifier, const int* windowsVirtualKeyCode, const int* nativeVirtualKeyCode, const int* macCharCode, const bool* autoRepeat, const bool* isKeypad, const bool* isSystemKey);
virtual void dispatchMouseEvent(ErrorString*, const String& type, int x, int y, const int* modifiers, const double* timestamp, const String* button, const int* clickCount);
private:
- InspectorInputAgent(InstrumentingAgents*, InspectorCompositeState*, Page*, InspectorClient*);
+ InspectorInputAgent(InstrumentingAgents*, InspectorState*, Page*, InspectorClient*);
Page* m_page;
InspectorClient* m_client;
};
+class InspectorInputFactory : public InspectorBaseFactory<InspectorInputFactory, InspectorInputAgent> {
+public:
+
+ static PassOwnPtr<InspectorInputFactory> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, Page* page, InspectorClient* client)
+ {
+ return adoptPtr(new InspectorInputFactory(instrumentingAgents, compositeState, page, client));
+ }
+
+protected:
+ InspectorInputFactory(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, Page* page, InspectorClient* client)
+ : InspectorBaseFactory<InspectorInputFactory, InspectorInputAgent>("Input", instrumentingAgents, compositeState)
+ {
+ setAgent(InspectorInputAgent::create(m_instrumentingAgents, m_state, page, client));
+ }
+};
+
} // namespace WebCore
#endif // !defined(InspectorInputAgent_h)
« no previous file with comments | « Source/core/inspector/InspectorIndexedDBAgent.cpp ('k') | Source/core/inspector/InspectorInputAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698