| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/renderer/input/frame_input_handler_impl.h" | 5 #include "content/renderer/input/frame_input_handler_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // static | 48 // static |
| 49 void FrameInputHandlerImpl::CreateMojoService( | 49 void FrameInputHandlerImpl::CreateMojoService( |
| 50 base::WeakPtr<RenderFrameImpl> render_frame, | 50 base::WeakPtr<RenderFrameImpl> render_frame, |
| 51 mojom::FrameInputHandlerRequest request) { | 51 mojom::FrameInputHandlerRequest request) { |
| 52 DCHECK(render_frame); | 52 DCHECK(render_frame); |
| 53 | 53 |
| 54 // Owns itself. Will be deleted when message pipe is destroyed. | 54 // Owns itself. Will be deleted when message pipe is destroyed. |
| 55 new FrameInputHandlerImpl(render_frame, std::move(request)); | 55 new FrameInputHandlerImpl(render_frame, std::move(request)); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void FrameInputHandlerImpl::RunOnMainThread(const base::Closure& closure) { | 58 void FrameInputHandlerImpl::RunOnMainThread(base::OnceClosure closure) { |
| 59 if (input_event_queue_) { | 59 if (input_event_queue_) { |
| 60 input_event_queue_->QueueClosure(closure); | 60 input_event_queue_->QueueClosure(std::move(closure)); |
| 61 } else { | 61 } else { |
| 62 closure.Run(); | 62 std::move(closure).Run(); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 void FrameInputHandlerImpl::SetCompositionFromExistingText( | 66 void FrameInputHandlerImpl::SetCompositionFromExistingText( |
| 67 int32_t start, | 67 int32_t start, |
| 68 int32_t end, | 68 int32_t end, |
| 69 const std::vector<ui::CompositionUnderline>& ui_underlines) { | 69 const std::vector<ui::CompositionUnderline>& ui_underlines) { |
| 70 if (!main_thread_task_runner_->BelongsToCurrentThread()) { | 70 if (!main_thread_task_runner_->BelongsToCurrentThread()) { |
| 71 RunOnMainThread( | 71 RunOnMainThread( |
| 72 base::Bind(&FrameInputHandlerImpl::SetCompositionFromExistingText, | 72 base::Bind(&FrameInputHandlerImpl::SetCompositionFromExistingText, |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 break; | 416 break; |
| 417 } | 417 } |
| 418 } | 418 } |
| 419 | 419 |
| 420 FrameInputHandlerImpl::HandlingState::~HandlingState() { | 420 FrameInputHandlerImpl::HandlingState::~HandlingState() { |
| 421 render_frame_->set_handling_select_range(original_select_range_value_); | 421 render_frame_->set_handling_select_range(original_select_range_value_); |
| 422 render_frame_->set_is_pasting(original_pasting_value_); | 422 render_frame_->set_is_pasting(original_pasting_value_); |
| 423 } | 423 } |
| 424 | 424 |
| 425 } // namespace content | 425 } // namespace content |
| OLD | NEW |