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

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: Made InspectorBaseAgent RefCounted 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
Index: Source/core/inspector/InspectorInputAgent.h
diff --git a/Source/core/inspector/InspectorInputAgent.h b/Source/core/inspector/InspectorInputAgent.h
index d3295293afbba5eac7b1b1a3158d36d4eb810a92..dc4df487d648af8e8d1081d5df107a4885504f84 100644
--- a/Source/core/inspector/InspectorInputAgent.h
+++ b/Source/core/inspector/InspectorInputAgent.h
@@ -45,12 +45,12 @@ 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();
@@ -60,13 +60,29 @@ public:
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 InspectorInputController: public InspectorBaseController<InspectorInputController, InspectorInputAgent> {
+public:
+
+ static PassOwnPtr<InspectorInputController> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, Page* page, InspectorClient* client)
+ {
+ return adoptPtr(new InspectorInputController(instrumentingAgents, compositeState, page, client));
+ }
+
+protected:
+ InspectorInputController(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* compositeState, Page* page, InspectorClient* client)
+ : InspectorBaseController<InspectorInputController, InspectorInputAgent>("Input", instrumentingAgents, compositeState)
+ {
+ setAgent(InspectorInputAgent::create(m_instrumentingAgents, m_state, page, client));
+ }
+};
+
} // namespace WebCore
#endif // !defined(InspectorInputAgent_h)

Powered by Google App Engine
This is Rietveld 408576698