| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/render_widget_input_handler.h" | 5 #include "content/renderer/input/render_widget_input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 RenderThreadImpl::current() | 406 RenderThreadImpl::current() |
| 407 ->GetRendererScheduler() | 407 ->GetRendererScheduler() |
| 408 ->DidHandleInputEventOnMainThread(input_event); | 408 ->DidHandleInputEventOnMainThread(input_event); |
| 409 } | 409 } |
| 410 | 410 |
| 411 #if defined(OS_ANDROID) | 411 #if defined(OS_ANDROID) |
| 412 // Allow the IME to be shown when the focus changes as a consequence | 412 // Allow the IME to be shown when the focus changes as a consequence |
| 413 // of a processed touch end event. | 413 // of a processed touch end event. |
| 414 if (input_event.type == WebInputEvent::TouchEnd && | 414 if (input_event.type == WebInputEvent::TouchEnd && |
| 415 processed != WebInputEventResult::NotHandled) { | 415 processed != WebInputEventResult::NotHandled) { |
| 416 delegate_->UpdateTextInputState(ShowIme::IF_NEEDED, | 416 delegate_->UpdateTextInputState(ShowIme::IF_NEEDED); |
| 417 ChangeSource::FROM_NON_IME); | |
| 418 } | 417 } |
| 419 #elif defined(USE_AURA) | 418 #elif defined(USE_AURA) |
| 420 // Show the virtual keyboard if enabled and a user gesture triggers a focus | 419 // Show the virtual keyboard if enabled and a user gesture triggers a focus |
| 421 // change. | 420 // change. |
| 422 if (processed != WebInputEventResult::NotHandled && | 421 if (processed != WebInputEventResult::NotHandled && |
| 423 (input_event.type == WebInputEvent::TouchEnd || | 422 (input_event.type == WebInputEvent::TouchEnd || |
| 424 input_event.type == WebInputEvent::MouseUp)) { | 423 input_event.type == WebInputEvent::MouseUp)) { |
| 425 delegate_->UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_IME); | 424 delegate_->UpdateTextInputState(ShowIme::IF_NEEDED); |
| 426 } | 425 } |
| 427 #endif | 426 #endif |
| 428 | 427 |
| 429 if (!prevent_default && WebInputEvent::isKeyboardEventType(input_event.type)) | 428 if (!prevent_default && WebInputEvent::isKeyboardEventType(input_event.type)) |
| 430 delegate_->OnDidHandleKeyEvent(); | 429 delegate_->OnDidHandleKeyEvent(); |
| 431 | 430 |
| 432 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with | 431 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with |
| 433 // virtual keyboard. | 432 // virtual keyboard. |
| 434 #if !defined(OS_ANDROID) | 433 #if !defined(OS_ANDROID) |
| 435 // Virtual keyboard is not supported, so react to focus change immediately. | 434 // Virtual keyboard is not supported, so react to focus change immediately. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 459 // it can be bundled in the event ack. | 458 // it can be bundled in the event ack. |
| 460 if (handling_event_overscroll_) { | 459 if (handling_event_overscroll_) { |
| 461 *handling_event_overscroll_ = std::move(params); | 460 *handling_event_overscroll_ = std::move(params); |
| 462 return; | 461 return; |
| 463 } | 462 } |
| 464 | 463 |
| 465 delegate_->OnDidOverscroll(*params); | 464 delegate_->OnDidOverscroll(*params); |
| 466 } | 465 } |
| 467 | 466 |
| 468 } // namespace content | 467 } // namespace content |
| OLD | NEW |