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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) | 584 IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) |
585 IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck) | 585 IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck) |
586 IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) | 586 IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) |
587 IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect) | 587 IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect) |
588 IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden) | 588 IPC_MESSAGE_HANDLER(ViewMsg_WasHidden, OnWasHidden) |
589 IPC_MESSAGE_HANDLER(ViewMsg_WasShown, OnWasShown) | 589 IPC_MESSAGE_HANDLER(ViewMsg_WasShown, OnWasShown) |
590 IPC_MESSAGE_HANDLER(ViewMsg_WasSwappedOut, OnWasSwappedOut) | 590 IPC_MESSAGE_HANDLER(ViewMsg_WasSwappedOut, OnWasSwappedOut) |
591 IPC_MESSAGE_HANDLER(ViewMsg_UpdateRect_ACK, OnUpdateRectAck) | 591 IPC_MESSAGE_HANDLER(ViewMsg_UpdateRect_ACK, OnUpdateRectAck) |
592 IPC_MESSAGE_HANDLER(ViewMsg_SwapBuffers_ACK, OnSwapBuffersComplete) | 592 IPC_MESSAGE_HANDLER(ViewMsg_SwapBuffers_ACK, OnSwapBuffersComplete) |
593 IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive) | 593 IPC_MESSAGE_HANDLER(ViewMsg_SetInputMethodActive, OnSetInputMethodActive) |
| 594 IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowShown, OnCandidateWindowShown) |
| 595 IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowUpdated, |
| 596 OnCandidateWindowUpdated) |
| 597 IPC_MESSAGE_HANDLER(ViewMsg_CandidateWindowHidden, OnCandidateWindowHidden) |
594 IPC_MESSAGE_HANDLER(ViewMsg_ImeSetComposition, OnImeSetComposition) | 598 IPC_MESSAGE_HANDLER(ViewMsg_ImeSetComposition, OnImeSetComposition) |
595 IPC_MESSAGE_HANDLER(ViewMsg_ImeConfirmComposition, OnImeConfirmComposition) | 599 IPC_MESSAGE_HANDLER(ViewMsg_ImeConfirmComposition, OnImeConfirmComposition) |
596 IPC_MESSAGE_HANDLER(ViewMsg_PaintAtSize, OnPaintAtSize) | 600 IPC_MESSAGE_HANDLER(ViewMsg_PaintAtSize, OnPaintAtSize) |
597 IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnRepaint) | 601 IPC_MESSAGE_HANDLER(ViewMsg_Repaint, OnRepaint) |
598 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) | 602 IPC_MESSAGE_HANDLER(ViewMsg_SetTextDirection, OnSetTextDirection) |
599 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) | 603 IPC_MESSAGE_HANDLER(ViewMsg_Move_ACK, OnRequestMoveAck) |
600 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) | 604 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScreenRects, OnUpdateScreenRects) |
601 #if defined(OS_ANDROID) | 605 #if defined(OS_ANDROID) |
602 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) | 606 IPC_MESSAGE_HANDLER(ViewMsg_ShowImeIfNeeded, OnShowImeIfNeeded) |
603 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) | 607 IPC_MESSAGE_HANDLER(ViewMsg_ImeEventAck, OnImeEventAck) |
(...skipping 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 return resizer_rect_; | 2079 return resizer_rect_; |
2076 } | 2080 } |
2077 | 2081 |
2078 void RenderWidget::OnSetInputMethodActive(bool is_active) { | 2082 void RenderWidget::OnSetInputMethodActive(bool is_active) { |
2079 // To prevent this renderer process from sending unnecessary IPC messages to | 2083 // To prevent this renderer process from sending unnecessary IPC messages to |
2080 // a browser process, we permit the renderer process to send IPC messages | 2084 // a browser process, we permit the renderer process to send IPC messages |
2081 // only during the input method attached to the browser process is active. | 2085 // only during the input method attached to the browser process is active. |
2082 input_method_is_active_ = is_active; | 2086 input_method_is_active_ = is_active; |
2083 } | 2087 } |
2084 | 2088 |
| 2089 void RenderWidget::OnCandidateWindowShown() { |
| 2090 webwidget_->didShowCandidateWindow(); |
| 2091 } |
| 2092 |
| 2093 void RenderWidget::OnCandidateWindowUpdated() { |
| 2094 webwidget_->didUpdateCandidateWindow(); |
| 2095 } |
| 2096 |
| 2097 void RenderWidget::OnCandidateWindowHidden() { |
| 2098 webwidget_->didHideCandidateWindow(); |
| 2099 } |
| 2100 |
2085 void RenderWidget::OnImeSetComposition( | 2101 void RenderWidget::OnImeSetComposition( |
2086 const string16& text, | 2102 const string16& text, |
2087 const std::vector<WebCompositionUnderline>& underlines, | 2103 const std::vector<WebCompositionUnderline>& underlines, |
2088 int selection_start, int selection_end) { | 2104 int selection_start, int selection_end) { |
2089 if (!ShouldHandleImeEvent()) | 2105 if (!ShouldHandleImeEvent()) |
2090 return; | 2106 return; |
2091 ImeEventGuard guard(this); | 2107 ImeEventGuard guard(this); |
2092 if (!webwidget_->setComposition( | 2108 if (!webwidget_->setComposition( |
2093 text, WebVector<WebCompositionUnderline>(underlines), | 2109 text, WebVector<WebCompositionUnderline>(underlines), |
2094 selection_start, selection_end)) { | 2110 selection_start, selection_end)) { |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2817 GetURLForGraphicsContext3D(), | 2833 GetURLForGraphicsContext3D(), |
2818 gpu_channel_host.get(), | 2834 gpu_channel_host.get(), |
2819 use_echo_for_swap_ack, | 2835 use_echo_for_swap_ack, |
2820 attributes, | 2836 attributes, |
2821 false /* bind generates resources */, | 2837 false /* bind generates resources */, |
2822 limits)); | 2838 limits)); |
2823 return context.Pass(); | 2839 return context.Pass(); |
2824 } | 2840 } |
2825 | 2841 |
2826 } // namespace content | 2842 } // namespace content |
OLD | NEW |