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

Side by Side Diff: content/browser/devtools/protocol/input_handler.h

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: addressed comments Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "content/browser/devtools/protocol/devtools_domain_handler.h"
10 #include "content/browser/devtools/protocol/input.h" 11 #include "content/browser/devtools/protocol/input.h"
11 #include "content/browser/renderer_host/input/synthetic_gesture.h" 12 #include "content/browser/renderer_host/input/synthetic_gesture.h"
12 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" 13 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
13 #include "ui/gfx/geometry/size_f.h" 14 #include "ui/gfx/geometry/size_f.h"
14 15
15 namespace cc { 16 namespace cc {
16 class CompositorFrameMetadata; 17 class CompositorFrameMetadata;
17 } 18 }
18 19
19 namespace content { 20 namespace content {
20 21
22 class DevToolsSession;
21 class RenderFrameHostImpl; 23 class RenderFrameHostImpl;
22 24
23 namespace protocol { 25 namespace protocol {
24 26
25 class InputHandler : public Input::Backend { 27 class InputHandler : public DevToolsDomainHandler,
28 public Input::Backend {
26 public: 29 public:
27 InputHandler(); 30 InputHandler();
28 ~InputHandler() override; 31 ~InputHandler() override;
29 32
30 void Wire(UberDispatcher*); 33 static InputHandler* FromSession(DevToolsSession* session);
31 void SetRenderFrameHost(RenderFrameHostImpl* host); 34
35 void Wire(UberDispatcher* dispatcher) override;
36 void SetRenderFrameHost(RenderFrameHostImpl* host) override;
32 void OnSwapCompositorFrame(const cc::CompositorFrameMetadata& frame_metadata); 37 void OnSwapCompositorFrame(const cc::CompositorFrameMetadata& frame_metadata);
33 Response Disable() override; 38 Response Disable() override;
34 39
35 Response DispatchKeyEvent(const std::string& type, 40 Response DispatchKeyEvent(const std::string& type,
36 Maybe<int> modifiers, 41 Maybe<int> modifiers,
37 Maybe<double> timestamp, 42 Maybe<double> timestamp,
38 Maybe<std::string> text, 43 Maybe<std::string> text,
39 Maybe<std::string> unmodified_text, 44 Maybe<std::string> unmodified_text,
40 Maybe<std::string> key_identifier, 45 Maybe<std::string> key_identifier,
41 Maybe<std::string> code, 46 Maybe<std::string> code,
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 int last_id_; 124 int last_id_;
120 base::WeakPtrFactory<InputHandler> weak_factory_; 125 base::WeakPtrFactory<InputHandler> weak_factory_;
121 126
122 DISALLOW_COPY_AND_ASSIGN(InputHandler); 127 DISALLOW_COPY_AND_ASSIGN(InputHandler);
123 }; 128 };
124 129
125 } // namespace protocol 130 } // namespace protocol
126 } // namespace content 131 } // namespace content
127 132
128 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ 133 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698