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

Unified Diff: content/renderer/render_widget.cc

Issue 2561543003: Move call path for resetInputMethod (Closed)
Patch Set: rebase Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index a77c98f6761fe545aa0f92015d0fd4a2f2abac48..a086f7baa99da0d06210a62d4b1bafdcdc46a698 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -2022,6 +2022,8 @@ void RenderWidget::GetCompositionRange(gfx::Range* range) {
bool RenderWidget::ShouldUpdateCompositionInfo(
const gfx::Range& range,
const std::vector<gfx::Rect>& bounds) {
+ if (!range.IsValid())
+ return false;
if (composition_range_ != range)
return true;
if (bounds.size() != composition_character_bounds_.size())
@@ -2077,17 +2079,7 @@ blink::WebScreenInfo RenderWidget::screenInfo() {
void RenderWidget::resetInputMethod() {
ImeEventGuard guard(this);
- // If the last text input type is not None, then we should finish any
- // ongoing composition regardless of the new text input type.
- if (text_input_type_ != ui::TEXT_INPUT_TYPE_NONE) {
- // If a composition text exists, then we need to let the browser process
- // to cancel the input method's ongoing composition session.
- blink::WebInputMethodController* controller = GetInputMethodController();
- if (controller &&
- controller->finishComposingText(
- WebInputMethodController::DoNotKeepSelection))
- Send(new InputHostMsg_ImeCancelComposition(routing_id()));
- }
+ Send(new InputHostMsg_ImeCancelComposition(routing_id()));
UpdateCompositionInfo(false /* not an immediate request */);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/InputMethodController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698