| 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/histogram.h" | 8 #include "base/histogram.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "chrome/browser/gpu_process_host.h" | |
| 12 #include "chrome/browser/renderer_host/backing_store.h" | 11 #include "chrome/browser/renderer_host/backing_store.h" |
| 13 #include "chrome/browser/renderer_host/backing_store_manager.h" | 12 #include "chrome/browser/renderer_host/backing_store_manager.h" |
| 14 #include "chrome/browser/renderer_host/render_process_host.h" | 13 #include "chrome/browser/renderer_host/render_process_host.h" |
| 15 #include "chrome/browser/renderer_host/render_widget_helper.h" | 14 #include "chrome/browser/renderer_host/render_widget_helper.h" |
| 16 #include "chrome/browser/renderer_host/render_widget_host_painting_observer.h" | 15 #include "chrome/browser/renderer_host/render_widget_host_painting_observer.h" |
| 17 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 16 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 18 #include "chrome/browser/renderer_host/video_layer.h" | 17 #include "chrome/browser/renderer_host/video_layer.h" |
| 19 #include "chrome/common/gpu_messages.h" | |
| 20 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
| 21 #include "chrome/common/render_messages.h" | 19 #include "chrome/common/render_messages.h" |
| 22 #include "webkit/glue/webcursor.h" | 20 #include "webkit/glue/webcursor.h" |
| 23 | 21 |
| 24 #if defined(TOOLKIT_VIEWS) | 22 #if defined(TOOLKIT_VIEWS) |
| 25 #include "views/view.h" | 23 #include "views/view.h" |
| 26 #endif | 24 #endif |
| 27 | 25 |
| 28 #if defined (OS_MACOSX) | 26 #if defined (OS_MACOSX) |
| 29 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | 27 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnMsgUpdateRect) | 130 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnMsgUpdateRect) |
| 133 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateVideo, OnMsgCreateVideo) | 131 IPC_MESSAGE_HANDLER(ViewHostMsg_CreateVideo, OnMsgCreateVideo) |
| 134 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateVideo, OnMsgUpdateVideo) | 132 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateVideo, OnMsgUpdateVideo) |
| 135 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyVideo, OnMsgDestroyVideo) | 133 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyVideo, OnMsgDestroyVideo) |
| 136 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck) | 134 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck) |
| 137 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnMsgFocus) | 135 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnMsgFocus) |
| 138 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnMsgBlur) | 136 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnMsgBlur) |
| 139 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnMsgFocusedNodeChanged) | 137 IPC_MESSAGE_HANDLER(ViewHostMsg_FocusedNodeChanged, OnMsgFocusedNodeChanged) |
| 140 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnMsgSetCursor) | 138 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnMsgSetCursor) |
| 141 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeUpdateStatus, OnMsgImeUpdateStatus) | 139 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeUpdateStatus, OnMsgImeUpdateStatus) |
| 142 IPC_MESSAGE_HANDLER(ViewHostMsg_EstablishGpuChannel, | |
| 143 OnMsgEstablishGpuChannel) | |
| 144 #if defined(OS_LINUX) | 140 #if defined(OS_LINUX) |
| 145 IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer, | 141 IPC_MESSAGE_HANDLER(ViewHostMsg_CreatePluginContainer, |
| 146 OnMsgCreatePluginContainer) | 142 OnMsgCreatePluginContainer) |
| 147 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer, | 143 IPC_MESSAGE_HANDLER(ViewHostMsg_DestroyPluginContainer, |
| 148 OnMsgDestroyPluginContainer) | 144 OnMsgDestroyPluginContainer) |
| 149 #elif defined(OS_MACOSX) | 145 #elif defined(OS_MACOSX) |
| 150 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) | 146 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowPopup, OnMsgShowPopup) |
| 151 IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) | 147 IPC_MESSAGE_HANDLER(ViewHostMsg_GetScreenInfo, OnMsgGetScreenInfo) |
| 152 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) | 148 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) |
| 153 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) | 149 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 view_->UpdateCursor(cursor); | 858 view_->UpdateCursor(cursor); |
| 863 } | 859 } |
| 864 | 860 |
| 865 void RenderWidgetHost::OnMsgImeUpdateStatus(int control, | 861 void RenderWidgetHost::OnMsgImeUpdateStatus(int control, |
| 866 const gfx::Rect& caret_rect) { | 862 const gfx::Rect& caret_rect) { |
| 867 if (view_) { | 863 if (view_) { |
| 868 view_->IMEUpdateStatus(control, caret_rect); | 864 view_->IMEUpdateStatus(control, caret_rect); |
| 869 } | 865 } |
| 870 } | 866 } |
| 871 | 867 |
| 872 void RenderWidgetHost::OnMsgEstablishGpuChannel() { | |
| 873 GpuProcessHost::Get()->EstablishGpuChannel(process_->id(), routing_id_); | |
| 874 } | |
| 875 | |
| 876 #if defined(OS_LINUX) | 868 #if defined(OS_LINUX) |
| 877 | 869 |
| 878 void RenderWidgetHost::OnMsgCreatePluginContainer(gfx::PluginWindowHandle id) { | 870 void RenderWidgetHost::OnMsgCreatePluginContainer(gfx::PluginWindowHandle id) { |
| 879 // TODO(piman): view_ can only be NULL with delayed view creation in | 871 // TODO(piman): view_ can only be NULL with delayed view creation in |
| 880 // extensions (see ExtensionHost::CreateRenderViewSoon). Figure out how to | 872 // extensions (see ExtensionHost::CreateRenderViewSoon). Figure out how to |
| 881 // support plugins in that case. | 873 // support plugins in that case. |
| 882 if (view_) { | 874 if (view_) { |
| 883 view_->CreatePluginContainer(id); | 875 view_->CreatePluginContainer(id); |
| 884 } else { | 876 } else { |
| 885 NOTIMPLEMENTED(); | 877 NOTIMPLEMENTED(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 // of this key event. | 1073 // of this key event. |
| 1082 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { | 1074 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { |
| 1083 UnhandledKeyboardEvent(front_item); | 1075 UnhandledKeyboardEvent(front_item); |
| 1084 | 1076 |
| 1085 // WARNING: This RenderWidgetHost can be deallocated at this point | 1077 // WARNING: This RenderWidgetHost can be deallocated at this point |
| 1086 // (i.e. in the case of Ctrl+W, where the call to | 1078 // (i.e. in the case of Ctrl+W, where the call to |
| 1087 // UnhandledKeyboardEvent destroys this RenderWidgetHost). | 1079 // UnhandledKeyboardEvent destroys this RenderWidgetHost). |
| 1088 } | 1080 } |
| 1089 } | 1081 } |
| 1090 } | 1082 } |
| OLD | NEW |