| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 // Now send the next (coalesced) mouse wheel event. | 875 // Now send the next (coalesced) mouse wheel event. |
| 876 if (!coalesced_mouse_wheel_events_.empty()) { | 876 if (!coalesced_mouse_wheel_events_.empty()) { |
| 877 WebMouseWheelEvent next_wheel_event = | 877 WebMouseWheelEvent next_wheel_event = |
| 878 coalesced_mouse_wheel_events_.front(); | 878 coalesced_mouse_wheel_events_.front(); |
| 879 coalesced_mouse_wheel_events_.pop_front(); | 879 coalesced_mouse_wheel_events_.pop_front(); |
| 880 ForwardWheelEvent(next_wheel_event); | 880 ForwardWheelEvent(next_wheel_event); |
| 881 } | 881 } |
| 882 } | 882 } |
| 883 | 883 |
| 884 void RenderWidgetHost::OnMsgFocus() { | 884 void RenderWidgetHost::OnMsgFocus() { |
| 885 // Only the user can focus a RenderWidgetHost. | 885 // Only RenderViewHost can deal with that message. |
| 886 process()->ReceivedBadMessage(ViewHostMsg_Focus__ID); | 886 process()->ReceivedBadMessage(ViewHostMsg_Focus__ID); |
| 887 } | 887 } |
| 888 | 888 |
| 889 void RenderWidgetHost::OnMsgBlur() { | 889 void RenderWidgetHost::OnMsgBlur() { |
| 890 if (view_) { | 890 // Only RenderViewHost can deal with that message. |
| 891 view_->Blur(); | 891 process()->ReceivedBadMessage(ViewHostMsg_Blur__ID); |
| 892 } | |
| 893 } | 892 } |
| 894 | 893 |
| 895 void RenderWidgetHost::OnMsgSetCursor(const WebCursor& cursor) { | 894 void RenderWidgetHost::OnMsgSetCursor(const WebCursor& cursor) { |
| 896 if (!view_) { | 895 if (!view_) { |
| 897 return; | 896 return; |
| 898 } | 897 } |
| 899 view_->UpdateCursor(cursor); | 898 view_->UpdateCursor(cursor); |
| 900 } | 899 } |
| 901 | 900 |
| 902 void RenderWidgetHost::OnMsgImeUpdateTextInputState( | 901 void RenderWidgetHost::OnMsgImeUpdateTextInputState( |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 // of this key event. | 1166 // of this key event. |
| 1168 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { | 1167 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { |
| 1169 UnhandledKeyboardEvent(front_item); | 1168 UnhandledKeyboardEvent(front_item); |
| 1170 | 1169 |
| 1171 // WARNING: This RenderWidgetHost can be deallocated at this point | 1170 // WARNING: This RenderWidgetHost can be deallocated at this point |
| 1172 // (i.e. in the case of Ctrl+W, where the call to | 1171 // (i.e. in the case of Ctrl+W, where the call to |
| 1173 // UnhandledKeyboardEvent destroys this RenderWidgetHost). | 1172 // UnhandledKeyboardEvent destroys this RenderWidgetHost). |
| 1174 } | 1173 } |
| 1175 } | 1174 } |
| 1176 } | 1175 } |
| OLD | NEW |