| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "content/renderer/input/input_handler_manager.h" | 45 #include "content/renderer/input/input_handler_manager.h" |
| 46 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 46 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 47 #include "content/renderer/render_frame_impl.h" | 47 #include "content/renderer/render_frame_impl.h" |
| 48 #include "content/renderer/render_frame_proxy.h" | 48 #include "content/renderer/render_frame_proxy.h" |
| 49 #include "content/renderer/render_process.h" | 49 #include "content/renderer/render_process.h" |
| 50 #include "content/renderer/render_thread_impl.h" | 50 #include "content/renderer/render_thread_impl.h" |
| 51 #include "content/renderer/render_view_impl.h" | 51 #include "content/renderer/render_view_impl.h" |
| 52 #include "content/renderer/render_widget_owner_delegate.h" | 52 #include "content/renderer/render_widget_owner_delegate.h" |
| 53 #include "content/renderer/renderer_blink_platform_impl.h" | 53 #include "content/renderer/renderer_blink_platform_impl.h" |
| 54 #include "content/renderer/resizing_mode_selector.h" | 54 #include "content/renderer/resizing_mode_selector.h" |
| 55 #include "ipc/ipc_message_start.h" |
| 55 #include "ipc/ipc_sync_message.h" | 56 #include "ipc/ipc_sync_message.h" |
| 56 #include "skia/ext/platform_canvas.h" | 57 #include "skia/ext/platform_canvas.h" |
| 57 #include "third_party/WebKit/public/platform/WebCursorInfo.h" | 58 #include "third_party/WebKit/public/platform/WebCursorInfo.h" |
| 58 #include "third_party/WebKit/public/platform/WebPoint.h" | 59 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 59 #include "third_party/WebKit/public/platform/WebRect.h" | 60 #include "third_party/WebKit/public/platform/WebRect.h" |
| 60 #include "third_party/WebKit/public/platform/WebSize.h" | 61 #include "third_party/WebKit/public/platform/WebSize.h" |
| 61 #include "third_party/WebKit/public/platform/WebString.h" | 62 #include "third_party/WebKit/public/platform/WebString.h" |
| 62 #include "third_party/WebKit/public/platform/scheduler/renderer/render_widget_sc
heduling_state.h" | 63 #include "third_party/WebKit/public/platform/scheduler/renderer/render_widget_sc
heduling_state.h" |
| 63 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" | 64 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul
er.h" |
| 64 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" | 65 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 88 #include "ipc/ipc_channel_posix.h" | 89 #include "ipc/ipc_channel_posix.h" |
| 89 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 90 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
| 90 #include "third_party/skia/include/core/SkPixelRef.h" | 91 #include "third_party/skia/include/core/SkPixelRef.h" |
| 91 #endif // defined(OS_POSIX) | 92 #endif // defined(OS_POSIX) |
| 92 | 93 |
| 93 #if defined(USE_AURA) | 94 #if defined(USE_AURA) |
| 94 #include "content/public/common/mojo_shell_connection.h" | 95 #include "content/public/common/mojo_shell_connection.h" |
| 95 #include "content/renderer/mus/render_widget_mus_connection.h" | 96 #include "content/renderer/mus/render_widget_mus_connection.h" |
| 96 #endif | 97 #endif |
| 97 | 98 |
| 99 #if defined(OS_MACOSX) |
| 100 #include "content/renderer/text_input_client_observer.h" |
| 101 #endif |
| 102 |
| 98 using blink::WebCompositionUnderline; | 103 using blink::WebCompositionUnderline; |
| 99 using blink::WebCursorInfo; | 104 using blink::WebCursorInfo; |
| 100 using blink::WebDeviceEmulationParams; | 105 using blink::WebDeviceEmulationParams; |
| 101 using blink::WebGestureEvent; | 106 using blink::WebGestureEvent; |
| 102 using blink::WebInputEvent; | 107 using blink::WebInputEvent; |
| 103 using blink::WebInputEventResult; | 108 using blink::WebInputEventResult; |
| 104 using blink::WebKeyboardEvent; | 109 using blink::WebKeyboardEvent; |
| 105 using blink::WebMouseEvent; | 110 using blink::WebMouseEvent; |
| 106 using blink::WebMouseWheelEvent; | 111 using blink::WebMouseWheelEvent; |
| 107 using blink::WebNavigationPolicy; | 112 using blink::WebNavigationPolicy; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 device_scale_factor_(screen_info_.device_scale_factor), | 253 device_scale_factor_(screen_info_.device_scale_factor), |
| 249 #if defined(OS_ANDROID) | 254 #if defined(OS_ANDROID) |
| 250 text_field_is_dirty_(false), | 255 text_field_is_dirty_(false), |
| 251 #endif | 256 #endif |
| 252 monitor_composition_info_(false), | 257 monitor_composition_info_(false), |
| 253 popup_origin_scale_for_emulation_(0.f), | 258 popup_origin_scale_for_emulation_(0.f), |
| 254 frame_swap_message_queue_(new FrameSwapMessageQueue()), | 259 frame_swap_message_queue_(new FrameSwapMessageQueue()), |
| 255 resizing_mode_selector_(new ResizingModeSelector()), | 260 resizing_mode_selector_(new ResizingModeSelector()), |
| 256 has_host_context_menu_location_(false), | 261 has_host_context_menu_location_(false), |
| 257 has_focus_(false), | 262 has_focus_(false), |
| 263 #if defined(OS_MACOSX) |
| 264 text_input_client_observer_(new TextInputClientObserver(this)), |
| 265 #endif |
| 258 focused_pepper_plugin_(nullptr) { | 266 focused_pepper_plugin_(nullptr) { |
| 259 if (!swapped_out) | 267 if (!swapped_out) |
| 260 RenderProcess::current()->AddRefProcess(); | 268 RenderProcess::current()->AddRefProcess(); |
| 261 DCHECK(RenderThread::Get()); | 269 DCHECK(RenderThread::Get()); |
| 262 device_color_profile_.push_back('0'); | 270 device_color_profile_.push_back('0'); |
| 263 #if defined(OS_ANDROID) | 271 #if defined(OS_ANDROID) |
| 264 text_input_info_history_.push_back(blink::WebTextInputInfo()); | 272 text_input_info_history_.push_back(blink::WebTextInputInfo()); |
| 265 #endif | 273 #endif |
| 266 | 274 |
| 267 // In tests there may not be a RenderThreadImpl. | 275 // In tests there may not be a RenderThreadImpl. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 emulator->scale(), emulator->offset()); | 476 emulator->scale(), emulator->offset()); |
| 469 } | 477 } |
| 470 #endif | 478 #endif |
| 471 | 479 |
| 472 void RenderWidget::OnShowHostContextMenu(ContextMenuParams* params) { | 480 void RenderWidget::OnShowHostContextMenu(ContextMenuParams* params) { |
| 473 if (screen_metrics_emulator_) | 481 if (screen_metrics_emulator_) |
| 474 screen_metrics_emulator_->OnShowContextMenu(params); | 482 screen_metrics_emulator_->OnShowContextMenu(params); |
| 475 } | 483 } |
| 476 | 484 |
| 477 bool RenderWidget::OnMessageReceived(const IPC::Message& message) { | 485 bool RenderWidget::OnMessageReceived(const IPC::Message& message) { |
| 486 #if defined(OS_MACOSX) |
| 487 if (IPC_MESSAGE_CLASS(message) == TextInputClientMsgStart) |
| 488 return text_input_client_observer_->OnMessageReceived(message); |
| 489 #endif |
| 478 if (mouse_lock_dispatcher_ && | 490 if (mouse_lock_dispatcher_ && |
| 479 mouse_lock_dispatcher_->OnMessageReceived(message)) | 491 mouse_lock_dispatcher_->OnMessageReceived(message)) |
| 480 return true; | 492 return true; |
| 481 | 493 |
| 482 bool handled = true; | 494 bool handled = true; |
| 483 IPC_BEGIN_MESSAGE_MAP(RenderWidget, message) | 495 IPC_BEGIN_MESSAGE_MAP(RenderWidget, message) |
| 484 IPC_MESSAGE_HANDLER(InputMsg_HandleInputEvent, OnHandleInputEvent) | 496 IPC_MESSAGE_HANDLER(InputMsg_HandleInputEvent, OnHandleInputEvent) |
| 485 IPC_MESSAGE_HANDLER(InputMsg_CursorVisibilityChange, | 497 IPC_MESSAGE_HANDLER(InputMsg_CursorVisibilityChange, |
| 486 OnCursorVisibilityChange) | 498 OnCursorVisibilityChange) |
| 487 IPC_MESSAGE_HANDLER(InputMsg_ImeSetComposition, OnImeSetComposition) | 499 IPC_MESSAGE_HANDLER(InputMsg_ImeSetComposition, OnImeSetComposition) |
| (...skipping 1663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 bool RenderWidget::isPointerLocked() { | 2163 bool RenderWidget::isPointerLocked() { |
| 2152 return mouse_lock_dispatcher_->IsMouseLockedTo( | 2164 return mouse_lock_dispatcher_->IsMouseLockedTo( |
| 2153 webwidget_mouse_lock_target_.get()); | 2165 webwidget_mouse_lock_target_.get()); |
| 2154 } | 2166 } |
| 2155 | 2167 |
| 2156 blink::WebWidget* RenderWidget::GetWebWidget() const { | 2168 blink::WebWidget* RenderWidget::GetWebWidget() const { |
| 2157 return webwidget_internal_; | 2169 return webwidget_internal_; |
| 2158 } | 2170 } |
| 2159 | 2171 |
| 2160 } // namespace content | 2172 } // namespace content |
| OLD | NEW |