| 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/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 weak_factory_(this) { | 134 weak_factory_(this) { |
| 135 } | 135 } |
| 136 | 136 |
| 137 InputHandler::~InputHandler() { | 137 InputHandler::~InputHandler() { |
| 138 } | 138 } |
| 139 | 139 |
| 140 void InputHandler::SetRenderWidgetHost(RenderWidgetHostImpl* host) { | 140 void InputHandler::SetRenderWidgetHost(RenderWidgetHostImpl* host) { |
| 141 host_ = host; | 141 host_ = host; |
| 142 } | 142 } |
| 143 | 143 |
| 144 void InputHandler::SetClient(scoped_ptr<Client> client) { | 144 void InputHandler::SetClient(std::unique_ptr<Client> client) { |
| 145 client_.swap(client); | 145 client_.swap(client); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void InputHandler::OnSwapCompositorFrame( | 148 void InputHandler::OnSwapCompositorFrame( |
| 149 const cc::CompositorFrameMetadata& frame_metadata) { | 149 const cc::CompositorFrameMetadata& frame_metadata) { |
| 150 page_scale_factor_ = frame_metadata.page_scale_factor; | 150 page_scale_factor_ = frame_metadata.page_scale_factor; |
| 151 scrollable_viewport_size_ = frame_metadata.scrollable_viewport_size; | 151 scrollable_viewport_size_ = frame_metadata.scrollable_viewport_size; |
| 152 } | 152 } |
| 153 | 153 |
| 154 Response InputHandler::DispatchKeyEvent( | 154 Response InputHandler::DispatchKeyEvent( |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } else { | 519 } else { |
| 520 client_->SendError(command_id, | 520 client_->SendError(command_id, |
| 521 Response::InternalError(base::StringPrintf( | 521 Response::InternalError(base::StringPrintf( |
| 522 "Synthetic tap failed, result was %d", result))); | 522 "Synthetic tap failed, result was %d", result))); |
| 523 } | 523 } |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace input | 526 } // namespace input |
| 527 } // namespace devtools | 527 } // namespace devtools |
| 528 } // namespace content | 528 } // namespace content |
| OLD | NEW |