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

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

Issue 2463583002: Revert of Fix endBatchEdit() state update order issue (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 TRACE_EVENT0("renderer", "RenderWidget::UpdateTextInputState"); 900 TRACE_EVENT0("renderer", "RenderWidget::UpdateTextInputState");
901 if (ime_event_guard_) { 901 if (ime_event_guard_) {
902 // show_ime should still be effective even if it was set inside the IME 902 // show_ime should still be effective even if it was set inside the IME
903 // event guard. 903 // event guard.
904 if (show_ime == ShowIme::IF_NEEDED) { 904 if (show_ime == ShowIme::IF_NEEDED) {
905 ime_event_guard_->set_show_ime(true); 905 ime_event_guard_->set_show_ime(true);
906 } 906 }
907 return; 907 return;
908 } 908 }
909 909
910 if (ime_in_batch_edit_ && change_source == ChangeSource::FROM_NON_IME)
911 return;
912
913 ui::TextInputType new_type = GetTextInputType(); 910 ui::TextInputType new_type = GetTextInputType();
914 if (IsDateTimeInput(new_type)) 911 if (IsDateTimeInput(new_type))
915 return; // Not considered as a text input field in WebKit/Chromium. 912 return; // Not considered as a text input field in WebKit/Chromium.
916 913
917 blink::WebTextInputInfo new_info; 914 blink::WebTextInputInfo new_info;
918 if (GetWebWidget()) 915 if (GetWebWidget())
919 new_info = GetWebWidget()->textInputInfo(); 916 new_info = GetWebWidget()->textInputInfo();
920 const ui::TextInputMode new_mode = 917 const ui::TextInputMode new_mode =
921 ConvertWebTextInputMode(new_info.inputMode); 918 ConvertWebTextInputMode(new_info.inputMode);
922 919
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 void RenderWidget::OnImeBatchEdit(bool begin) { 1612 void RenderWidget::OnImeBatchEdit(bool begin) {
1616 if (begin) { 1613 if (begin) {
1617 ime_in_batch_edit_ = true; 1614 ime_in_batch_edit_ = true;
1618 return; 1615 return;
1619 } 1616 }
1620 if (!ime_in_batch_edit_) 1617 if (!ime_in_batch_edit_)
1621 return; 1618 return;
1622 ime_in_batch_edit_ = false; 1619 ime_in_batch_edit_ = false;
1623 DCHECK(!ime_event_guard_); 1620 DCHECK(!ime_event_guard_);
1624 UpdateSelectionBounds(); 1621 UpdateSelectionBounds();
1625 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); 1622 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_IME);
1626 } 1623 }
1627 #endif 1624 #endif
1628 1625
1629 void RenderWidget::OnRequestCompositionUpdate(bool immediate_request, 1626 void RenderWidget::OnRequestCompositionUpdate(bool immediate_request,
1630 bool monitor_request) { 1627 bool monitor_request) {
1631 monitor_composition_info_ = monitor_request; 1628 monitor_composition_info_ = monitor_request;
1632 if (!immediate_request) 1629 if (!immediate_request)
1633 return; 1630 return;
1634 UpdateCompositionInfo(true /* immediate request */); 1631 UpdateCompositionInfo(true /* immediate request */);
1635 } 1632 }
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 bool RenderWidget::isPointerLocked() { 2096 bool RenderWidget::isPointerLocked() {
2100 return mouse_lock_dispatcher_->IsMouseLockedTo( 2097 return mouse_lock_dispatcher_->IsMouseLockedTo(
2101 webwidget_mouse_lock_target_.get()); 2098 webwidget_mouse_lock_target_.get());
2102 } 2099 }
2103 2100
2104 blink::WebWidget* RenderWidget::GetWebWidget() const { 2101 blink::WebWidget* RenderWidget::GetWebWidget() const {
2105 return webwidget_internal_; 2102 return webwidget_internal_;
2106 } 2103 }
2107 2104
2108 } // namespace content 2105 } // namespace content
OLDNEW
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/input/ThreadedInputConnection.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698