| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) | 732 IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) |
| 733 IPC_MESSAGE_HANDLER(ViewMsg_EnableDeviceEmulation, | 733 IPC_MESSAGE_HANDLER(ViewMsg_EnableDeviceEmulation, |
| 734 OnEnableDeviceEmulation) | 734 OnEnableDeviceEmulation) |
| 735 IPC_MESSAGE_HANDLER(ViewMsg_DisableDeviceEmulation, | 735 IPC_MESSAGE_HANDLER(ViewMsg_DisableDeviceEmulation, |
| 736 OnDisableDeviceEmulation) | 736 OnDisableDeviceEmulation) |
| 737 IPC_MESSAGE_HANDLER(ViewMsg_ColorProfile, OnColorProfile) | 737 IPC_MESSAGE_HANDLER(ViewMsg_ColorProfile, OnColorProfile) |
| 738 IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect) | 738 IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect) |
| 739 IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden) | 739 IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden) |
| 740 IPC_MESSAGE_HANDLER(ViewMsg_WasShown, OnWasShown) | 740 IPC_MESSAGE_HANDLER(ViewMsg_WasShown, OnWasShown) |
| 741 IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive) | 741 IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive) |
| 742 IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowShown, OnCandidateWindowShown) | |
| 743 IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowUpdated, | |
| 744 OnCandidateWindowUpdated) | |
| 745 IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowHidden, OnCandidateWindowHidden) | |
| 746 IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnRepaint) | 742 IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnRepaint) |
| 747 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) | 743 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) |
| 748 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) | 744 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) |
| 749 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) | 745 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) |
| 750 IPC_MESSAGE_HANDLER(ViewMsg_SetSurfaceIdNamespace, OnSetSurfaceIdNamespace) | 746 IPC_MESSAGE_HANDLER(ViewMsg_SetSurfaceIdNamespace, OnSetSurfaceIdNamespace) |
| 751 #if defined(OS_ANDROID) | 747 #if defined(OS_ANDROID) |
| 752 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) | 748 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) |
| 753 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) | 749 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) |
| 754 #endif | 750 #endif |
| 755 IPC_MESSAGE_UNHANDLED(handled = false) | 751 IPC_MESSAGE_UNHANDLED(handled = false) |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 return resizer_rect_; | 1648 return resizer_rect_; |
| 1653 } | 1649 } |
| 1654 | 1650 |
| 1655 void RenderWidget::OnSetInputMethodActive(bool is_active) { | 1651 void RenderWidget::OnSetInputMethodActive(bool is_active) { |
| 1656 // To prevent this renderer process from sending unnecessary IPC messages to | 1652 // To prevent this renderer process from sending unnecessary IPC messages to |
| 1657 // a browser process, we permit the renderer process to send IPC messages | 1653 // a browser process, we permit the renderer process to send IPC messages |
| 1658 // only during the input method attached to the browser process is active. | 1654 // only during the input method attached to the browser process is active. |
| 1659 input_method_is_active_ = is_active; | 1655 input_method_is_active_ = is_active; |
| 1660 } | 1656 } |
| 1661 | 1657 |
| 1662 void RenderWidget::OnCandidateWindowShown() { | |
| 1663 } | |
| 1664 | |
| 1665 void RenderWidget::OnCandidateWindowUpdated() { | |
| 1666 } | |
| 1667 | |
| 1668 void RenderWidget::OnCandidateWindowHidden() { | |
| 1669 } | |
| 1670 | |
| 1671 void RenderWidget::OnImeSetComposition( | 1658 void RenderWidget::OnImeSetComposition( |
| 1672 const base::string16& text, | 1659 const base::string16& text, |
| 1673 const std::vector<WebCompositionUnderline>& underlines, | 1660 const std::vector<WebCompositionUnderline>& underlines, |
| 1674 int selection_start, int selection_end) { | 1661 int selection_start, int selection_end) { |
| 1675 if (!ShouldHandleImeEvent()) | 1662 if (!ShouldHandleImeEvent()) |
| 1676 return; | 1663 return; |
| 1677 ImeEventGuard guard(this); | 1664 ImeEventGuard guard(this); |
| 1678 if (!webwidget_->setComposition( | 1665 if (!webwidget_->setComposition( |
| 1679 text, WebVector<WebCompositionUnderline>(underlines), | 1666 text, WebVector<WebCompositionUnderline>(underlines), |
| 1680 selection_start, selection_end)) { | 1667 selection_start, selection_end)) { |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2449 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2436 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2450 video_hole_frames_.AddObserver(frame); | 2437 video_hole_frames_.AddObserver(frame); |
| 2451 } | 2438 } |
| 2452 | 2439 |
| 2453 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2440 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2454 video_hole_frames_.RemoveObserver(frame); | 2441 video_hole_frames_.RemoveObserver(frame); |
| 2455 } | 2442 } |
| 2456 #endif // defined(VIDEO_HOLE) | 2443 #endif // defined(VIDEO_HOLE) |
| 2457 | 2444 |
| 2458 } // namespace content | 2445 } // namespace content |
| OLD | NEW |