Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: content/renderer/render_widget.cc

Issue 2309983002: Allow selection change update before beginBatchEdit (Closed)
Patch Set: polish up a bit Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 opener_id_(MSG_ROUTING_NONE), 229 opener_id_(MSG_ROUTING_NONE),
230 next_paint_flags_(0), 230 next_paint_flags_(0),
231 auto_resize_mode_(false), 231 auto_resize_mode_(false),
232 need_update_rect_for_auto_resize_(false), 232 need_update_rect_for_auto_resize_(false),
233 did_show_(false), 233 did_show_(false),
234 is_hidden_(hidden), 234 is_hidden_(hidden),
235 compositor_never_visible_(never_visible), 235 compositor_never_visible_(never_visible),
236 is_fullscreen_granted_(false), 236 is_fullscreen_granted_(false),
237 display_mode_(blink::WebDisplayModeUndefined), 237 display_mode_(blink::WebDisplayModeUndefined),
238 ime_event_guard_(nullptr), 238 ime_event_guard_(nullptr),
239 ime_in_batch_edit_(false),
239 closing_(false), 240 closing_(false),
240 host_closing_(false), 241 host_closing_(false),
241 is_swapped_out_(swapped_out), 242 is_swapped_out_(swapped_out),
242 for_oopif_(false), 243 for_oopif_(false),
243 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), 244 text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT),
244 text_input_flags_(0), 245 text_input_flags_(0),
245 can_compose_inline_(true), 246 can_compose_inline_(true),
246 composition_range_(gfx::Range::InvalidRange()), 247 composition_range_(gfx::Range::InvalidRange()),
247 popup_type_(popup_type), 248 popup_type_(popup_type),
248 pending_window_rect_count_(0), 249 pending_window_rect_count_(0),
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) 507 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects)
507 IPC_MESSAGE_HANDLER(ViewMsg_SetSurfaceClientId, OnSetSurfaceClientId) 508 IPC_MESSAGE_HANDLER(ViewMsg_SetSurfaceClientId, OnSetSurfaceClientId)
508 IPC_MESSAGE_HANDLER(ViewMsg_WaitForNextFrameForTests, 509 IPC_MESSAGE_HANDLER(ViewMsg_WaitForNextFrameForTests,
509 OnWaitNextFrameForTests) 510 OnWaitNextFrameForTests)
510 IPC_MESSAGE_HANDLER(InputMsg_RequestCompositionUpdate, 511 IPC_MESSAGE_HANDLER(InputMsg_RequestCompositionUpdate,
511 OnRequestCompositionUpdate) 512 OnRequestCompositionUpdate)
512 #if defined(OS_ANDROID) 513 #if defined(OS_ANDROID)
513 IPC_MESSAGE_HANDLER(InputMsg_ImeEventAck, OnImeEventAck) 514 IPC_MESSAGE_HANDLER(InputMsg_ImeEventAck, OnImeEventAck)
514 IPC_MESSAGE_HANDLER(InputMsg_RequestTextInputStateUpdate, 515 IPC_MESSAGE_HANDLER(InputMsg_RequestTextInputStateUpdate,
515 OnRequestTextInputStateUpdate) 516 OnRequestTextInputStateUpdate)
517 IPC_MESSAGE_HANDLER(InputMsg_ImeBatchEdit,
518 OnImeBatchEdit)
516 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) 519 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded)
517 #endif 520 #endif
518 IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto) 521 IPC_MESSAGE_HANDLER(ViewMsg_HandleCompositorProto, OnHandleCompositorProto)
519 IPC_MESSAGE_UNHANDLED(handled = false) 522 IPC_MESSAGE_UNHANDLED(handled = false)
520 IPC_END_MESSAGE_MAP() 523 IPC_END_MESSAGE_MAP()
521 return handled; 524 return handled;
522 } 525 }
523 526
524 bool RenderWidget::Send(IPC::Message* message) { 527 bool RenderWidget::Send(IPC::Message* message) {
525 // Don't send any messages after the browser has told us to close, and filter 528 // Don't send any messages after the browser has told us to close, and filter
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 params.composition_start = new_info.compositionStart; 965 params.composition_start = new_info.compositionStart;
963 params.composition_end = new_info.compositionEnd; 966 params.composition_end = new_info.compositionEnd;
964 params.can_compose_inline = new_can_compose_inline; 967 params.can_compose_inline = new_can_compose_inline;
965 params.show_ime_if_needed = (show_ime == ShowIme::IF_NEEDED); 968 params.show_ime_if_needed = (show_ime == ShowIme::IF_NEEDED);
966 #if defined(USE_AURA) 969 #if defined(USE_AURA)
967 params.is_non_ime_change = true; 970 params.is_non_ime_change = true;
968 #endif 971 #endif
969 #if defined(OS_ANDROID) 972 #if defined(OS_ANDROID)
970 params.is_non_ime_change = 973 params.is_non_ime_change =
971 (change_source == ChangeSource::FROM_NON_IME) || text_field_is_dirty_; 974 (change_source == ChangeSource::FROM_NON_IME) || text_field_is_dirty_;
975 params.batch_edit = ime_in_batch_edit_;
972 if (params.is_non_ime_change) 976 if (params.is_non_ime_change)
973 OnImeEventSentForAck(new_info); 977 OnImeEventSentForAck(new_info);
974 text_field_is_dirty_ = false; 978 text_field_is_dirty_ = false;
975 #endif 979 #endif
976 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), params)); 980 Send(new ViewHostMsg_TextInputStateChanged(routing_id(), params));
977 981
978 text_input_info_ = new_info; 982 text_input_info_ = new_info;
979 text_input_mode_ = new_mode; 983 text_input_mode_ = new_mode;
980 can_compose_inline_ = new_can_compose_inline; 984 can_compose_inline_ = new_can_compose_inline;
981 text_input_flags_ = new_info.flags; 985 text_input_flags_ = new_info.flags;
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 void RenderWidget::OnImeEventAck() { 1583 void RenderWidget::OnImeEventAck() {
1580 DCHECK_GE(text_input_info_history_.size(), 1u); 1584 DCHECK_GE(text_input_info_history_.size(), 1u);
1581 text_input_info_history_.pop_front(); 1585 text_input_info_history_.pop_front();
1582 } 1586 }
1583 1587
1584 void RenderWidget::OnRequestTextInputStateUpdate() { 1588 void RenderWidget::OnRequestTextInputStateUpdate() {
1585 DCHECK(!ime_event_guard_); 1589 DCHECK(!ime_event_guard_);
1586 UpdateSelectionBounds(); 1590 UpdateSelectionBounds();
1587 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME); 1591 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME);
1588 } 1592 }
1593
1594 void RenderWidget::OnImeBatchEdit(bool begin) {
aelias_OOO_until_Jul13 2016/09/13 02:26:51 Please add in a call to RenderWidgetCompositor::se
Changwan Ryu 2016/09/19 01:51:27 Hmm... Let me try it on another CL (which depends
aelias_OOO_until_Jul13 2016/09/19 19:29:27 Sounds good.
1595 if (begin) {
1596 ime_in_batch_edit_ = true;
1597 return;
1598 }
1599 if (!ime_in_batch_edit_)
1600 return;
1601 ime_in_batch_edit_ = false;
1602 DCHECK(!ime_event_guard_);
1603 UpdateSelectionBounds();
1604 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME);
1605 }
1589 #endif 1606 #endif
1590 1607
1591 void RenderWidget::OnRequestCompositionUpdate(bool immediate_request, 1608 void RenderWidget::OnRequestCompositionUpdate(bool immediate_request,
1592 bool monitor_request) { 1609 bool monitor_request) {
1593 monitor_composition_info_ = monitor_request; 1610 monitor_composition_info_ = monitor_request;
1594 if (!immediate_request) 1611 if (!immediate_request)
1595 return; 1612 return;
1596 UpdateCompositionInfo(true /* immediate request */); 1613 UpdateCompositionInfo(true /* immediate request */);
1597 } 1614 }
1598 1615
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 void RenderWidget::requestPointerUnlock() { 2104 void RenderWidget::requestPointerUnlock() {
2088 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); 2105 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get());
2089 } 2106 }
2090 2107
2091 bool RenderWidget::isPointerLocked() { 2108 bool RenderWidget::isPointerLocked() {
2092 return mouse_lock_dispatcher_->IsMouseLockedTo( 2109 return mouse_lock_dispatcher_->IsMouseLockedTo(
2093 webwidget_mouse_lock_target_.get()); 2110 webwidget_mouse_lock_target_.get());
2094 } 2111 }
2095 2112
2096 } // namespace content 2113 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698