| 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 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <queue> | 14 #include <queue> |
| 15 | 15 |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "content/common/content_export.h" | 23 #include "content/common/content_export.h" |
| 24 #include "content/common/cursors/webcursor.h" | 24 #include "content/common/cursors/webcursor.h" |
| 25 #include "content/common/edit_command.h" |
| 25 #include "content/common/input/synthetic_gesture_params.h" | 26 #include "content/common/input/synthetic_gesture_params.h" |
| 26 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega
te.h" | 27 #include "content/renderer/devtools/render_widget_screen_metrics_emulator_delega
te.h" |
| 27 #include "content/renderer/gpu/render_widget_compositor_delegate.h" | 28 #include "content/renderer/gpu/render_widget_compositor_delegate.h" |
| 28 #include "content/renderer/input/render_widget_input_handler.h" | 29 #include "content/renderer/input/render_widget_input_handler.h" |
| 29 #include "content/renderer/input/render_widget_input_handler_delegate.h" | 30 #include "content/renderer/input/render_widget_input_handler_delegate.h" |
| 30 #include "content/renderer/message_delivery_policy.h" | 31 #include "content/renderer/message_delivery_policy.h" |
| 31 #include "content/renderer/mouse_lock_dispatcher.h" | 32 #include "content/renderer/mouse_lock_dispatcher.h" |
| 32 #include "content/renderer/render_widget_mouse_lock_dispatcher.h" | 33 #include "content/renderer/render_widget_mouse_lock_dispatcher.h" |
| 33 #include "ipc/ipc_listener.h" | 34 #include "ipc/ipc_listener.h" |
| 34 #include "ipc/ipc_sender.h" | 35 #include "ipc/ipc_sender.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 void set_owner_delegate(RenderWidgetOwnerDelegate* owner_delegate) { | 172 void set_owner_delegate(RenderWidgetOwnerDelegate* owner_delegate) { |
| 172 DCHECK(!owner_delegate_); | 173 DCHECK(!owner_delegate_); |
| 173 owner_delegate_ = owner_delegate; | 174 owner_delegate_ = owner_delegate; |
| 174 } | 175 } |
| 175 | 176 |
| 176 RenderWidgetOwnerDelegate* owner_delegate() { return owner_delegate_; } | 177 RenderWidgetOwnerDelegate* owner_delegate() { return owner_delegate_; } |
| 177 | 178 |
| 178 // ScreenInfo exposed so it can be passed to subframe RenderWidgets. | 179 // ScreenInfo exposed so it can be passed to subframe RenderWidgets. |
| 179 blink::WebScreenInfo screen_info() const { return screen_info_; } | 180 blink::WebScreenInfo screen_info() const { return screen_info_; } |
| 180 | 181 |
| 182 // Manage edit commands to be used for the next keyboard event. |
| 183 const EditCommands& edit_commands() const { return edit_commands_; } |
| 184 void SetEditCommandForNextKeyEvent(const std::string& name, |
| 185 const std::string& value); |
| 186 void ClearEditCommands(); |
| 187 |
| 181 // Functions to track out-of-process frames for special notifications. | 188 // Functions to track out-of-process frames for special notifications. |
| 182 void RegisterRenderFrameProxy(RenderFrameProxy* proxy); | 189 void RegisterRenderFrameProxy(RenderFrameProxy* proxy); |
| 183 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); | 190 void UnregisterRenderFrameProxy(RenderFrameProxy* proxy); |
| 184 | 191 |
| 185 // Functions to track all RenderFrame objects associated with this | 192 // Functions to track all RenderFrame objects associated with this |
| 186 // RenderWidget. | 193 // RenderWidget. |
| 187 void RegisterRenderFrame(RenderFrameImpl* frame); | 194 void RegisterRenderFrame(RenderFrameImpl* frame); |
| 188 void UnregisterRenderFrame(RenderFrameImpl* frame); | 195 void UnregisterRenderFrame(RenderFrameImpl* frame); |
| 189 | 196 |
| 190 #if defined(VIDEO_HOLE) | 197 #if defined(VIDEO_HOLE) |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 ExternalPopupMenu* popup, | 470 ExternalPopupMenu* popup, |
| 464 RenderWidgetScreenMetricsEmulator* emulator); | 471 RenderWidgetScreenMetricsEmulator* emulator); |
| 465 #endif | 472 #endif |
| 466 | 473 |
| 467 // RenderWidget IPC message handlers | 474 // RenderWidget IPC message handlers |
| 468 void OnHandleInputEvent(const blink::WebInputEvent* event, | 475 void OnHandleInputEvent(const blink::WebInputEvent* event, |
| 469 const ui::LatencyInfo& latency_info, | 476 const ui::LatencyInfo& latency_info, |
| 470 InputEventDispatchType dispatch_type); | 477 InputEventDispatchType dispatch_type); |
| 471 void OnCursorVisibilityChange(bool is_visible); | 478 void OnCursorVisibilityChange(bool is_visible); |
| 472 void OnMouseCaptureLost(); | 479 void OnMouseCaptureLost(); |
| 480 void OnSetEditCommandsForNextKeyEvent(const EditCommands& edit_commands); |
| 473 virtual void OnSetFocus(bool enable); | 481 virtual void OnSetFocus(bool enable); |
| 474 void OnClose(); | 482 void OnClose(); |
| 475 void OnCreatingNewAck(); | 483 void OnCreatingNewAck(); |
| 476 virtual void OnResize(const ResizeParams& params); | 484 virtual void OnResize(const ResizeParams& params); |
| 477 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params); | 485 void OnEnableDeviceEmulation(const blink::WebDeviceEmulationParams& params); |
| 478 void OnDisableDeviceEmulation(); | 486 void OnDisableDeviceEmulation(); |
| 479 void OnChangeResizeRect(const gfx::Rect& resizer_rect); | 487 void OnChangeResizeRect(const gfx::Rect& resizer_rect); |
| 480 virtual void OnWasHidden(); | 488 virtual void OnWasHidden(); |
| 481 virtual void OnWasShown(bool needs_repainting, | 489 virtual void OnWasShown(bool needs_repainting, |
| 482 const ui::LatencyInfo& latency_info); | 490 const ui::LatencyInfo& latency_info); |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; | 810 std::unique_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_; |
| 803 | 811 |
| 804 private: | 812 private: |
| 805 // Indicates whether this widget has focus. | 813 // Indicates whether this widget has focus. |
| 806 bool has_focus_; | 814 bool has_focus_; |
| 807 | 815 |
| 808 // This reference is set by the RenderFrame and is used to query the IME- | 816 // This reference is set by the RenderFrame and is used to query the IME- |
| 809 // related state from the plugin to later send to the browser. | 817 // related state from the plugin to later send to the browser. |
| 810 PepperPluginInstanceImpl* focused_pepper_plugin_; | 818 PepperPluginInstanceImpl* focused_pepper_plugin_; |
| 811 | 819 |
| 820 // Stores edit commands associated to the next key event. |
| 821 // Will be cleared as soon as the next key event is processed. |
| 822 EditCommands edit_commands_; |
| 823 |
| 812 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 824 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 813 }; | 825 }; |
| 814 | 826 |
| 815 } // namespace content | 827 } // namespace content |
| 816 | 828 |
| 817 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 829 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |