| OLD | NEW |
| 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 #include "content/browser/devtools/protocol/input_handler.h" | 5 #include "content/browser/devtools/protocol/input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 input_queued_(false), | 196 input_queued_(false), |
| 197 page_scale_factor_(1.0), | 197 page_scale_factor_(1.0), |
| 198 last_id_(0), | 198 last_id_(0), |
| 199 weak_factory_(this) { | 199 weak_factory_(this) { |
| 200 } | 200 } |
| 201 | 201 |
| 202 InputHandler::~InputHandler() { | 202 InputHandler::~InputHandler() { |
| 203 } | 203 } |
| 204 | 204 |
| 205 // static | 205 // static |
| 206 InputHandler* InputHandler::FromSession(DevToolsSession* session) { | 206 std::vector<InputHandler*> InputHandler::ForAgentHost( |
| 207 return static_cast<InputHandler*>( | 207 DevToolsAgentHostImpl* host) { |
| 208 session->GetHandlerByName(Input::Metainfo::domainName)); | 208 return DevToolsSession::HandlersForAgentHost<InputHandler>( |
| 209 host, Input::Metainfo::domainName); |
| 209 } | 210 } |
| 210 | 211 |
| 211 void InputHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { | 212 void InputHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { |
| 212 ClearPendingKeyAndMouseCallbacks(); | 213 ClearPendingKeyAndMouseCallbacks(); |
| 213 if (host_) | 214 if (host_) |
| 214 host_->GetRenderWidgetHost()->RemoveInputEventObserver(this); | 215 host_->GetRenderWidgetHost()->RemoveInputEventObserver(this); |
| 215 host_ = host; | 216 host_ = host; |
| 216 if (host) | 217 if (host) |
| 217 host->GetRenderWidgetHost()->AddInputEventObserver(this); | 218 host->GetRenderWidgetHost()->AddInputEventObserver(this); |
| 218 } | 219 } |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 for (auto& callback : pending_key_callbacks_) | 640 for (auto& callback : pending_key_callbacks_) |
| 640 callback->sendSuccess(); | 641 callback->sendSuccess(); |
| 641 pending_key_callbacks_.clear(); | 642 pending_key_callbacks_.clear(); |
| 642 for (auto& callback : pending_mouse_callbacks_) | 643 for (auto& callback : pending_mouse_callbacks_) |
| 643 callback->sendSuccess(); | 644 callback->sendSuccess(); |
| 644 pending_mouse_callbacks_.clear(); | 645 pending_mouse_callbacks_.clear(); |
| 645 } | 646 } |
| 646 | 647 |
| 647 } // namespace protocol | 648 } // namespace protocol |
| 648 } // namespace content | 649 } // namespace content |
| OLD | NEW |