| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 for_oopif_(false), | 365 for_oopif_(false), |
| 366 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), | 366 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), |
| 367 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), | 367 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), |
| 368 text_input_flags_(0), | 368 text_input_flags_(0), |
| 369 can_compose_inline_(true), | 369 can_compose_inline_(true), |
| 370 composition_range_(gfx::Range::InvalidRange()), | 370 composition_range_(gfx::Range::InvalidRange()), |
| 371 popup_type_(popup_type), | 371 popup_type_(popup_type), |
| 372 pending_window_rect_count_(0), | 372 pending_window_rect_count_(0), |
| 373 screen_info_(screen_info), | 373 screen_info_(screen_info), |
| 374 device_scale_factor_(screen_info_.device_scale_factor), | 374 device_scale_factor_(screen_info_.device_scale_factor), |
| 375 #if defined(OS_ANDROID) | |
| 376 text_field_is_dirty_(false), | |
| 377 #endif | |
| 378 monitor_composition_info_(false), | 375 monitor_composition_info_(false), |
| 379 popup_origin_scale_for_emulation_(0.f), | 376 popup_origin_scale_for_emulation_(0.f), |
| 380 frame_swap_message_queue_(new FrameSwapMessageQueue()), | 377 frame_swap_message_queue_(new FrameSwapMessageQueue()), |
| 381 resizing_mode_selector_(new ResizingModeSelector()), | 378 resizing_mode_selector_(new ResizingModeSelector()), |
| 382 has_host_context_menu_location_(false), | 379 has_host_context_menu_location_(false), |
| 383 has_focus_(false), | 380 has_focus_(false), |
| 384 #if defined(OS_MACOSX) | 381 #if defined(OS_MACOSX) |
| 385 text_input_client_observer_(new TextInputClientObserver(this)), | 382 text_input_client_observer_(new TextInputClientObserver(this)), |
| 386 #endif | 383 #endif |
| 387 focused_pepper_plugin_(nullptr) { | 384 focused_pepper_plugin_(nullptr) { |
| 388 DCHECK_NE(routing_id_, MSG_ROUTING_NONE); | 385 DCHECK_NE(routing_id_, MSG_ROUTING_NONE); |
| 389 if (!swapped_out) | 386 if (!swapped_out) |
| 390 RenderProcess::current()->AddRefProcess(); | 387 RenderProcess::current()->AddRefProcess(); |
| 391 DCHECK(RenderThread::Get()); | 388 DCHECK(RenderThread::Get()); |
| 392 device_color_profile_.push_back('0'); | 389 device_color_profile_.push_back('0'); |
| 393 #if defined(OS_ANDROID) | |
| 394 text_input_info_history_.push_back(blink::WebTextInputInfo()); | |
| 395 #endif | |
| 396 | 390 |
| 397 // In tests there may not be a RenderThreadImpl. | 391 // In tests there may not be a RenderThreadImpl. |
| 398 if (RenderThreadImpl::current()) { | 392 if (RenderThreadImpl::current()) { |
| 399 render_widget_scheduling_state_ = RenderThreadImpl::current() | 393 render_widget_scheduling_state_ = RenderThreadImpl::current() |
| 400 ->GetRendererScheduler() | 394 ->GetRendererScheduler() |
| 401 ->NewRenderWidgetSchedulingState(); | 395 ->NewRenderWidgetSchedulingState(); |
| 402 render_widget_scheduling_state_->SetHidden(is_hidden_); | 396 render_widget_scheduling_state_->SetHidden(is_hidden_); |
| 403 } | 397 } |
| 404 } | 398 } |
| 405 | 399 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 OnRequestCompositionUpdate) | 622 OnRequestCompositionUpdate) |
| 629 IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto) | 623 IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto) |
| 630 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) | 624 IPC_MESSAGE_HANDLER(DragMsg_TargetDragEnter, OnDragTargetDragEnter) |
| 631 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) | 625 IPC_MESSAGE_HANDLER(DragMsg_TargetDragOver, OnDragTargetDragOver) |
| 632 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) | 626 IPC_MESSAGE_HANDLER(DragMsg_TargetDragLeave, OnDragTargetDragLeave) |
| 633 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) | 627 IPC_MESSAGE_HANDLER(DragMsg_TargetDrop, OnDragTargetDrop) |
| 634 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) | 628 IPC_MESSAGE_HANDLER(DragMsg_SourceEnded, OnDragSourceEnded) |
| 635 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, | 629 IPC_MESSAGE_HANDLER(DragMsg_SourceSystemDragEnded, |
| 636 OnDragSourceSystemDragEnded) | 630 OnDragSourceSystemDragEnded) |
| 637 #if defined(OS_ANDROID) | 631 #if defined(OS_ANDROID) |
| 638 IPC_MESSAGE_HANDLER(InputMsg_ImeEventAck, OnImeEventAck) | |
| 639 IPC_MESSAGE_HANDLER(InputMsg_RequestTextInputStateUpdate, | 632 IPC_MESSAGE_HANDLER(InputMsg_RequestTextInputStateUpdate, |
| 640 OnRequestTextInputStateUpdate) | 633 OnRequestTextInputStateUpdate) |
| 641 #endif | 634 #endif |
| 642 IPC_MESSAGE_UNHANDLED(handled = false) | 635 IPC_MESSAGE_UNHANDLED(handled = false) |
| 643 IPC_END_MESSAGE_MAP() | 636 IPC_END_MESSAGE_MAP() |
| 644 return handled; | 637 return handled; |
| 645 } | 638 } |
| 646 | 639 |
| 647 bool RenderWidget::Send(IPC::Message* message) { | 640 bool RenderWidget::Send(IPC::Message* message) { |
| 648 // Don't send any messages after the browser has told us to close, and filter | 641 // Don't send any messages after the browser has told us to close, and filter |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 if (GetWebWidget()) | 1035 if (GetWebWidget()) |
| 1043 new_info = GetWebWidget()->textInputInfo(); | 1036 new_info = GetWebWidget()->textInputInfo(); |
| 1044 const ui::TextInputMode new_mode = | 1037 const ui::TextInputMode new_mode = |
| 1045 ConvertWebTextInputMode(new_info.inputMode); | 1038 ConvertWebTextInputMode(new_info.inputMode); |
| 1046 | 1039 |
| 1047 bool new_can_compose_inline = CanComposeInline(); | 1040 bool new_can_compose_inline = CanComposeInline(); |
| 1048 | 1041 |
| 1049 // Only sends text input params if they are changed or if the ime should be | 1042 // Only sends text input params if they are changed or if the ime should be |
| 1050 // shown. | 1043 // shown. |
| 1051 if (show_ime == ShowIme::IF_NEEDED || | 1044 if (show_ime == ShowIme::IF_NEEDED || |
| 1052 (IsUsingImeThread() && change_source == ChangeSource::FROM_IME) || | 1045 change_source == ChangeSource::FROM_IME || |
| 1053 (text_input_type_ != new_type || text_input_mode_ != new_mode || | 1046 text_input_type_ != new_type || text_input_mode_ != new_mode || |
| 1054 text_input_info_ != new_info || | 1047 text_input_info_ != new_info || |
| 1055 can_compose_inline_ != new_can_compose_inline) | 1048 can_compose_inline_ != new_can_compose_inline) { |
| 1056 #if defined(OS_ANDROID) | |
| 1057 || text_field_is_dirty_ | |
| 1058 #endif | |
| 1059 ) { | |
| 1060 TextInputState params; | 1049 TextInputState params; |
| 1061 params.type = new_type; | 1050 params.type = new_type; |
| 1062 params.mode = new_mode; | 1051 params.mode = new_mode; |
| 1063 params.flags = new_info.flags; | 1052 params.flags = new_info.flags; |
| 1064 params.value = new_info.value.utf8(); | 1053 params.value = new_info.value.utf8(); |
| 1065 params.selection_start = new_info.selectionStart; | 1054 params.selection_start = new_info.selectionStart; |
| 1066 params.selection_end = new_info.selectionEnd; | 1055 params.selection_end = new_info.selectionEnd; |
| 1067 params.composition_start = new_info.compositionStart; | 1056 params.composition_start = new_info.compositionStart; |
| 1068 params.composition_end = new_info.compositionEnd; | 1057 params.composition_end = new_info.compositionEnd; |
| 1069 params.can_compose_inline = new_can_compose_inline; | 1058 params.can_compose_inline = new_can_compose_inline; |
| 1070 params.show_ime_if_needed = (show_ime == ShowIme::IF_NEEDED); | 1059 params.show_ime_if_needed = (show_ime == ShowIme::IF_NEEDED); |
| 1071 #if defined(USE_AURA) | 1060 #if defined(OS_ANDROID) || defined(USE_AURA) |
| 1072 params.is_non_ime_change = true; | 1061 params.is_non_ime_change = (change_source == ChangeSource::FROM_NON_IME); |
| 1073 #endif | |
| 1074 #if defined(OS_ANDROID) | |
| 1075 params.is_non_ime_change = | |
| 1076 (change_source == ChangeSource::FROM_NON_IME) || text_field_is_dirty_; | |
| 1077 if (params.is_non_ime_change) | |
| 1078 OnImeEventSentForAck(new_info); | |
| 1079 text_field_is_dirty_ = false; | |
| 1080 #endif | 1062 #endif |
| 1081 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), params)); | 1063 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), params)); |
| 1082 | 1064 |
| 1083 text_input_info_ = new_info; | 1065 text_input_info_ = new_info; |
| 1084 text_input_type_ = new_type; | 1066 text_input_type_ = new_type; |
| 1085 text_input_mode_ = new_mode; | 1067 text_input_mode_ = new_mode; |
| 1086 can_compose_inline_ = new_can_compose_inline; | 1068 can_compose_inline_ = new_can_compose_inline; |
| 1087 text_input_flags_ = new_info.flags; | 1069 text_input_flags_ = new_info.flags; |
| 1088 } | 1070 } |
| 1089 } | 1071 } |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1525 focused_pepper_plugin_->render_frame()->OnImeSetComposition( | 1507 focused_pepper_plugin_->render_frame()->OnImeSetComposition( |
| 1526 text, underlines, selection_start, selection_end); | 1508 text, underlines, selection_start, selection_end); |
| 1527 return; | 1509 return; |
| 1528 } | 1510 } |
| 1529 #endif | 1511 #endif |
| 1530 if (replacement_range.IsValid()) { | 1512 if (replacement_range.IsValid()) { |
| 1531 GetWebWidget()->applyReplacementRange( | 1513 GetWebWidget()->applyReplacementRange( |
| 1532 WebRange(replacement_range.start(), replacement_range.length())); | 1514 WebRange(replacement_range.start(), replacement_range.length())); |
| 1533 } | 1515 } |
| 1534 | 1516 |
| 1535 if (!ShouldHandleImeEvent()) | 1517 if (!GetWebWidget()) |
| 1536 return; | 1518 return; |
| 1537 ImeEventGuard guard(this); | 1519 ImeEventGuard guard(this); |
| 1538 blink::WebInputMethodController* controller = GetInputMethodController(); | 1520 blink::WebInputMethodController* controller = GetInputMethodController(); |
| 1539 DCHECK(controller); | 1521 DCHECK(controller); |
| 1540 if (!controller || | 1522 if (!controller || |
| 1541 !controller->setComposition( | 1523 !controller->setComposition( |
| 1542 text, WebVector<WebCompositionUnderline>(underlines), selection_start, | 1524 text, WebVector<WebCompositionUnderline>(underlines), selection_start, |
| 1543 selection_end)) { | 1525 selection_end)) { |
| 1544 // If we failed to set the composition text, then we need to let the browser | 1526 // If we failed to set the composition text, then we need to let the browser |
| 1545 // process to cancel the input method's ongoing composition session, to make | 1527 // process to cancel the input method's ongoing composition session, to make |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1557 focused_pepper_plugin_->render_frame()->OnImeCommitText( | 1539 focused_pepper_plugin_->render_frame()->OnImeCommitText( |
| 1558 text, replacement_range, relative_cursor_pos); | 1540 text, replacement_range, relative_cursor_pos); |
| 1559 return; | 1541 return; |
| 1560 } | 1542 } |
| 1561 #endif | 1543 #endif |
| 1562 if (replacement_range.IsValid()) { | 1544 if (replacement_range.IsValid()) { |
| 1563 GetWebWidget()->applyReplacementRange( | 1545 GetWebWidget()->applyReplacementRange( |
| 1564 WebRange(replacement_range.start(), replacement_range.length())); | 1546 WebRange(replacement_range.start(), replacement_range.length())); |
| 1565 } | 1547 } |
| 1566 | 1548 |
| 1567 if (!ShouldHandleImeEvent()) | 1549 if (!GetWebWidget()) |
| 1568 return; | 1550 return; |
| 1569 ImeEventGuard guard(this); | 1551 ImeEventGuard guard(this); |
| 1570 input_handler_->set_handling_input_event(true); | 1552 input_handler_->set_handling_input_event(true); |
| 1571 if (auto* controller = GetInputMethodController()) | 1553 if (auto* controller = GetInputMethodController()) |
| 1572 controller->commitText(text, relative_cursor_pos); | 1554 controller->commitText(text, relative_cursor_pos); |
| 1573 input_handler_->set_handling_input_event(false); | 1555 input_handler_->set_handling_input_event(false); |
| 1574 UpdateCompositionInfo(false /* not an immediate request */); | 1556 UpdateCompositionInfo(false /* not an immediate request */); |
| 1575 } | 1557 } |
| 1576 | 1558 |
| 1577 void RenderWidget::OnImeFinishComposingText(bool keep_selection) { | 1559 void RenderWidget::OnImeFinishComposingText(bool keep_selection) { |
| 1578 #if BUILDFLAG(ENABLE_PLUGINS) | 1560 #if BUILDFLAG(ENABLE_PLUGINS) |
| 1579 if (focused_pepper_plugin_) { | 1561 if (focused_pepper_plugin_) { |
| 1580 focused_pepper_plugin_->render_frame()->OnImeFinishComposingText( | 1562 focused_pepper_plugin_->render_frame()->OnImeFinishComposingText( |
| 1581 keep_selection); | 1563 keep_selection); |
| 1582 return; | 1564 return; |
| 1583 } | 1565 } |
| 1584 #endif | 1566 #endif |
| 1585 | 1567 |
| 1586 if (!ShouldHandleImeEvent()) | 1568 if (!GetWebWidget()) |
| 1587 return; | 1569 return; |
| 1588 ImeEventGuard guard(this); | 1570 ImeEventGuard guard(this); |
| 1589 input_handler_->set_handling_input_event(true); | 1571 input_handler_->set_handling_input_event(true); |
| 1590 if (auto* controller = GetInputMethodController()) { | 1572 if (auto* controller = GetInputMethodController()) { |
| 1591 controller->finishComposingText( | 1573 controller->finishComposingText( |
| 1592 keep_selection ? WebInputMethodController::KeepSelection | 1574 keep_selection ? WebInputMethodController::KeepSelection |
| 1593 : WebInputMethodController::DoNotKeepSelection); | 1575 : WebInputMethodController::DoNotKeepSelection); |
| 1594 } | 1576 } |
| 1595 input_handler_->set_handling_input_event(false); | 1577 input_handler_->set_handling_input_event(false); |
| 1596 UpdateCompositionInfo(false /* not an immediate request */); | 1578 UpdateCompositionInfo(false /* not an immediate request */); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 void RenderWidget::convertWindowToViewport(blink::WebFloatRect* rect) { | 1776 void RenderWidget::convertWindowToViewport(blink::WebFloatRect* rect) { |
| 1795 if (IsUseZoomForDSFEnabled()) { | 1777 if (IsUseZoomForDSFEnabled()) { |
| 1796 rect->x *= GetOriginalDeviceScaleFactor(); | 1778 rect->x *= GetOriginalDeviceScaleFactor(); |
| 1797 rect->y *= GetOriginalDeviceScaleFactor(); | 1779 rect->y *= GetOriginalDeviceScaleFactor(); |
| 1798 rect->width *= GetOriginalDeviceScaleFactor(); | 1780 rect->width *= GetOriginalDeviceScaleFactor(); |
| 1799 rect->height *= GetOriginalDeviceScaleFactor(); | 1781 rect->height *= GetOriginalDeviceScaleFactor(); |
| 1800 } | 1782 } |
| 1801 } | 1783 } |
| 1802 | 1784 |
| 1803 #if defined(OS_ANDROID) | 1785 #if defined(OS_ANDROID) |
| 1804 void RenderWidget::OnImeEventSentForAck(const blink::WebTextInputInfo& info) { | |
| 1805 text_input_info_history_.push_back(info); | |
| 1806 } | |
| 1807 | |
| 1808 void RenderWidget::OnImeEventAck() { | |
| 1809 DCHECK_GE(text_input_info_history_.size(), 1u); | |
| 1810 text_input_info_history_.pop_front(); | |
| 1811 } | |
| 1812 | |
| 1813 void RenderWidget::OnRequestTextInputStateUpdate() { | 1786 void RenderWidget::OnRequestTextInputStateUpdate() { |
| 1814 DCHECK(!ime_event_guard_); | 1787 DCHECK(!ime_event_guard_); |
| 1815 UpdateSelectionBounds(); | 1788 UpdateSelectionBounds(); |
| 1816 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME); | 1789 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME); |
| 1817 } | 1790 } |
| 1818 #endif | 1791 #endif |
| 1819 | 1792 |
| 1820 void RenderWidget::OnRequestCompositionUpdate(bool immediate_request, | 1793 void RenderWidget::OnRequestCompositionUpdate(bool immediate_request, |
| 1821 bool monitor_request) { | 1794 bool monitor_request) { |
| 1822 monitor_composition_info_ = monitor_request; | 1795 monitor_composition_info_ = monitor_request; |
| 1823 if (!immediate_request) | 1796 if (!immediate_request) |
| 1824 return; | 1797 return; |
| 1825 UpdateCompositionInfo(true /* immediate request */); | 1798 UpdateCompositionInfo(true /* immediate request */); |
| 1826 } | 1799 } |
| 1827 | 1800 |
| 1828 bool RenderWidget::ShouldHandleImeEvent() { | |
| 1829 #if defined(OS_ANDROID) | |
| 1830 if (!GetWebWidget()) | |
| 1831 return false; | |
| 1832 if (IsUsingImeThread()) | |
| 1833 return true; | |
| 1834 | |
| 1835 // We cannot handle IME events if there is any chance that the event we are | |
| 1836 // receiving here from the browser is based on the state that is different | |
| 1837 // from our current one as indicated by |text_input_info_|. | |
| 1838 // The states the browser might be in are: | |
| 1839 // text_input_info_history_[0] - current state ack'd by browser | |
| 1840 // text_input_info_history_[1...N] - pending state changes | |
| 1841 for (size_t i = 0u; i < text_input_info_history_.size() - 1u; ++i) { | |
| 1842 if (text_input_info_history_[i] != text_input_info_) | |
| 1843 return false; | |
| 1844 } | |
| 1845 return true; | |
| 1846 #else | |
| 1847 return !!GetWebWidget(); | |
| 1848 #endif | |
| 1849 } | |
| 1850 | |
| 1851 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { | 1801 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { |
| 1852 if (device_scale_factor_ == device_scale_factor) | 1802 if (device_scale_factor_ == device_scale_factor) |
| 1853 return; | 1803 return; |
| 1854 | 1804 |
| 1855 device_scale_factor_ = device_scale_factor; | 1805 device_scale_factor_ = device_scale_factor; |
| 1856 | 1806 |
| 1857 OnDeviceScaleFactorChanged(); | 1807 OnDeviceScaleFactorChanged(); |
| 1858 ScheduleComposite(); | 1808 ScheduleComposite(); |
| 1859 | 1809 |
| 1860 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); | 1810 physical_backing_size_ = gfx::ScaleToCeiledSize(size_, device_scale_factor_); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1909 } | 1859 } |
| 1910 | 1860 |
| 1911 void RenderWidget::set_next_paint_is_resize_ack() { | 1861 void RenderWidget::set_next_paint_is_resize_ack() { |
| 1912 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK; | 1862 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_RESIZE_ACK; |
| 1913 } | 1863 } |
| 1914 | 1864 |
| 1915 void RenderWidget::set_next_paint_is_repaint_ack() { | 1865 void RenderWidget::set_next_paint_is_repaint_ack() { |
| 1916 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; | 1866 next_paint_flags_ |= ViewHostMsg_UpdateRect_Flags::IS_REPAINT_ACK; |
| 1917 } | 1867 } |
| 1918 | 1868 |
| 1919 bool RenderWidget::IsUsingImeThread() { | |
| 1920 #if defined(OS_ANDROID) | |
| 1921 return base::FeatureList::IsEnabled(features::kImeThread); | |
| 1922 #else | |
| 1923 return false; | |
| 1924 #endif | |
| 1925 } | |
| 1926 | |
| 1927 void RenderWidget::OnImeEventGuardStart(ImeEventGuard* guard) { | 1869 void RenderWidget::OnImeEventGuardStart(ImeEventGuard* guard) { |
| 1928 if (!ime_event_guard_) | 1870 if (!ime_event_guard_) |
| 1929 ime_event_guard_ = guard; | 1871 ime_event_guard_ = guard; |
| 1930 } | 1872 } |
| 1931 | 1873 |
| 1932 void RenderWidget::OnImeEventGuardFinish(ImeEventGuard* guard) { | 1874 void RenderWidget::OnImeEventGuardFinish(ImeEventGuard* guard) { |
| 1933 if (ime_event_guard_ != guard) { | 1875 if (ime_event_guard_ != guard) { |
| 1934 #if defined(OS_ANDROID) | 1876 #if defined(OS_ANDROID) |
| 1935 // In case a from-IME event (e.g. touch) ends up in not-from-IME event | 1877 // In case a from-IME event (e.g. touch) ends up in not-from-IME event |
| 1936 // (e.g. long press gesture), we want to treat it as not-from-IME event | 1878 // (e.g. long press gesture), we want to treat it as not-from-IME event |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 // Ignore setTouchAction calls that result from synthetic touch events (eg. | 2167 // Ignore setTouchAction calls that result from synthetic touch events (eg. |
| 2226 // when blink is emulating touch with mouse). | 2168 // when blink is emulating touch with mouse). |
| 2227 if (input_handler_->handling_event_type() != WebInputEvent::TouchStart) | 2169 if (input_handler_->handling_event_type() != WebInputEvent::TouchStart) |
| 2228 return; | 2170 return; |
| 2229 | 2171 |
| 2230 content::TouchAction content_touch_action = | 2172 content::TouchAction content_touch_action = |
| 2231 static_cast<content::TouchAction>(web_touch_action); | 2173 static_cast<content::TouchAction>(web_touch_action); |
| 2232 Send(new InputHostMsg_SetTouchAction(routing_id_, content_touch_action)); | 2174 Send(new InputHostMsg_SetTouchAction(routing_id_, content_touch_action)); |
| 2233 } | 2175 } |
| 2234 | 2176 |
| 2235 void RenderWidget::didUpdateTextOfFocusedElementByNonUserInput() { | |
| 2236 #if defined(OS_ANDROID) | |
| 2237 if (!IsUsingImeThread()) | |
| 2238 text_field_is_dirty_ = true; | |
| 2239 #endif | |
| 2240 } | |
| 2241 | |
| 2242 void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) { | 2177 void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) { |
| 2243 render_frame_proxies_.AddObserver(proxy); | 2178 render_frame_proxies_.AddObserver(proxy); |
| 2244 } | 2179 } |
| 2245 | 2180 |
| 2246 void RenderWidget::UnregisterRenderFrameProxy(RenderFrameProxy* proxy) { | 2181 void RenderWidget::UnregisterRenderFrameProxy(RenderFrameProxy* proxy) { |
| 2247 render_frame_proxies_.RemoveObserver(proxy); | 2182 render_frame_proxies_.RemoveObserver(proxy); |
| 2248 } | 2183 } |
| 2249 | 2184 |
| 2250 void RenderWidget::RegisterRenderFrame(RenderFrameImpl* frame) { | 2185 void RenderWidget::RegisterRenderFrame(RenderFrameImpl* frame) { |
| 2251 render_frames_.AddObserver(frame); | 2186 render_frames_.AddObserver(frame); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2309 blink::WebInputMethodController* RenderWidget::GetInputMethodController() | 2244 blink::WebInputMethodController* RenderWidget::GetInputMethodController() |
| 2310 const { | 2245 const { |
| 2311 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is | 2246 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is |
| 2312 // always a WebFrameWidget. | 2247 // always a WebFrameWidget. |
| 2313 CHECK(GetWebWidget()->isWebFrameWidget()); | 2248 CHECK(GetWebWidget()->isWebFrameWidget()); |
| 2314 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2249 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
| 2315 ->getActiveWebInputMethodController(); | 2250 ->getActiveWebInputMethodController(); |
| 2316 } | 2251 } |
| 2317 | 2252 |
| 2318 } // namespace content | 2253 } // namespace content |
| OLD | NEW |