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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1678 return resizer_rect_; | 1678 return resizer_rect_; |
1679 } | 1679 } |
1680 | 1680 |
1681 void RenderWidget::OnImeSetComposition( | 1681 void RenderWidget::OnImeSetComposition( |
1682 const base::string16& text, | 1682 const base::string16& text, |
1683 const std::vector<WebCompositionUnderline>& underlines, | 1683 const std::vector<WebCompositionUnderline>& underlines, |
1684 int selection_start, int selection_end) { | 1684 int selection_start, int selection_end) { |
1685 if (!ShouldHandleImeEvent()) | 1685 if (!ShouldHandleImeEvent()) |
1686 return; | 1686 return; |
1687 ImeEventGuard guard(this); | 1687 ImeEventGuard guard(this); |
| 1688 base::AutoReset<bool> handling_input_event_resetter(&handling_input_event_, |
| 1689 true); |
1688 if (!webwidget_->setComposition( | 1690 if (!webwidget_->setComposition( |
1689 text, WebVector<WebCompositionUnderline>(underlines), | 1691 text, WebVector<WebCompositionUnderline>(underlines), |
1690 selection_start, selection_end)) { | 1692 selection_start, selection_end)) { |
1691 // If we failed to set the composition text, then we need to let the browser | 1693 // If we failed to set the composition text, then we need to let the browser |
1692 // process to cancel the input method's ongoing composition session, to make | 1694 // process to cancel the input method's ongoing composition session, to make |
1693 // sure we are in a consistent state. | 1695 // sure we are in a consistent state. |
1694 Send(new InputHostMsg_ImeCancelComposition(routing_id())); | 1696 Send(new InputHostMsg_ImeCancelComposition(routing_id())); |
1695 } | 1697 } |
1696 UpdateCompositionInfo(true); | 1698 UpdateCompositionInfo(true); |
1697 } | 1699 } |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2461 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2463 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2462 video_hole_frames_.AddObserver(frame); | 2464 video_hole_frames_.AddObserver(frame); |
2463 } | 2465 } |
2464 | 2466 |
2465 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2467 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2466 video_hole_frames_.RemoveObserver(frame); | 2468 video_hole_frames_.RemoveObserver(frame); |
2467 } | 2469 } |
2468 #endif // defined(VIDEO_HOLE) | 2470 #endif // defined(VIDEO_HOLE) |
2469 | 2471 |
2470 } // namespace content | 2472 } // namespace content |
OLD | NEW |