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 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 #endif | 1529 #endif |
1530 if (replacement_range.IsValid()) { | 1530 if (replacement_range.IsValid()) { |
1531 GetWebWidget()->applyReplacementRange( | 1531 GetWebWidget()->applyReplacementRange( |
1532 WebRange(replacement_range.start(), replacement_range.length())); | 1532 WebRange(replacement_range.start(), replacement_range.length())); |
1533 } | 1533 } |
1534 | 1534 |
1535 if (!ShouldHandleImeEvent()) | 1535 if (!ShouldHandleImeEvent()) |
1536 return; | 1536 return; |
1537 ImeEventGuard guard(this); | 1537 ImeEventGuard guard(this); |
1538 blink::WebInputMethodController* controller = GetInputMethodController(); | 1538 blink::WebInputMethodController* controller = GetInputMethodController(); |
1539 DCHECK(controller); | |
1540 if (!controller || | 1539 if (!controller || |
1541 !controller->setComposition( | 1540 !controller->setComposition( |
1542 text, WebVector<WebCompositionUnderline>(underlines), selection_start, | 1541 text, WebVector<WebCompositionUnderline>(underlines), selection_start, |
1543 selection_end)) { | 1542 selection_end)) { |
1544 // If we failed to set the composition text, then we need to let the browser | 1543 // 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 | 1544 // process to cancel the input method's ongoing composition session, to make |
1546 // sure we are in a consistent state. | 1545 // sure we are in a consistent state. |
1547 Send(new InputHostMsg_ImeCancelComposition(routing_id())); | 1546 Send(new InputHostMsg_ImeCancelComposition(routing_id())); |
1548 } | 1547 } |
1549 UpdateCompositionInfo(false /* not an immediate request */); | 1548 UpdateCompositionInfo(false /* not an immediate request */); |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2309 blink::WebInputMethodController* RenderWidget::GetInputMethodController() | 2308 blink::WebInputMethodController* RenderWidget::GetInputMethodController() |
2310 const { | 2309 const { |
2311 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is | 2310 // TODO(ekaramad): Remove this CHECK when GetWebWidget() is |
2312 // always a WebFrameWidget. | 2311 // always a WebFrameWidget. |
2313 CHECK(GetWebWidget()->isWebFrameWidget()); | 2312 CHECK(GetWebWidget()->isWebFrameWidget()); |
2314 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) | 2313 return static_cast<blink::WebFrameWidget*>(GetWebWidget()) |
2315 ->getActiveWebInputMethodController(); | 2314 ->getActiveWebInputMethodController(); |
2316 } | 2315 } |
2317 | 2316 |
2318 } // namespace content | 2317 } // namespace content |
OLD | NEW |