| 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "content/common/text_input_state.h" |
| 14 #include "third_party/WebKit/public/platform/WebDisplayMode.h" | 15 #include "third_party/WebKit/public/platform/WebDisplayMode.h" |
| 15 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| 19 class WebMouseWheelEvent; | 20 class WebMouseWheelEvent; |
| 20 class WebGestureEvent; | 21 class WebGestureEvent; |
| 21 } | 22 } |
| 22 | 23 |
| 23 namespace gfx { | 24 namespace gfx { |
| 24 class Point; | 25 class Point; |
| 25 class Rect; | 26 class Rect; |
| 26 class Size; | 27 class Size; |
| 27 } | 28 } |
| 28 | 29 |
| 29 namespace content { | 30 namespace content { |
| 30 | 31 |
| 31 class BrowserAccessibilityManager; | 32 class BrowserAccessibilityManager; |
| 32 class RenderWidgetHostImpl; | 33 class RenderWidgetHostImpl; |
| 33 class RenderWidgetHostInputEventRouter; | 34 class RenderWidgetHostInputEventRouter; |
| 35 class RenderWidgetHostViewBase; |
| 34 struct NativeWebKeyboardEvent; | 36 struct NativeWebKeyboardEvent; |
| 35 | 37 |
| 36 // | 38 // |
| 37 // RenderWidgetHostDelegate | 39 // RenderWidgetHostDelegate |
| 38 // | 40 // |
| 39 // An interface implemented by an object interested in knowing about the state | 41 // An interface implemented by an object interested in knowing about the state |
| 40 // of the RenderWidgetHost. | 42 // of the RenderWidgetHost. |
| 41 class CONTENT_EXPORT RenderWidgetHostDelegate { | 43 class CONTENT_EXPORT RenderWidgetHostDelegate { |
| 42 public: | 44 public: |
| 43 // The RenderWidgetHost has just been created. | 45 // The RenderWidgetHost has just been created. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // RenderWidgetHost to this function to determine who should ultimately | 127 // RenderWidgetHost to this function to determine who should ultimately |
| 126 // consume the event. This facilitates keyboard event routing with | 128 // consume the event. This facilitates keyboard event routing with |
| 127 // out-of-process iframes, where multiple RenderWidgetHosts may be involved | 129 // out-of-process iframes, where multiple RenderWidgetHosts may be involved |
| 128 // in rendering a page, yet keyboard events all arrive at the main frame's | 130 // in rendering a page, yet keyboard events all arrive at the main frame's |
| 129 // RenderWidgetHostView. When a main frame's RenderWidgetHost is passed in, | 131 // RenderWidgetHostView. When a main frame's RenderWidgetHost is passed in, |
| 130 // the function returns the focused frame that should consume keyboard | 132 // the function returns the focused frame that should consume keyboard |
| 131 // events. In all other cases, the function returns back |receiving_widget|. | 133 // events. In all other cases, the function returns back |receiving_widget|. |
| 132 virtual RenderWidgetHostImpl* GetFocusedRenderWidgetHost( | 134 virtual RenderWidgetHostImpl* GetFocusedRenderWidgetHost( |
| 133 RenderWidgetHostImpl* receiving_widget); | 135 RenderWidgetHostImpl* receiving_widget); |
| 134 | 136 |
| 137 // Returns the current value of text input state. This should be the value |
| 138 // obtained from the focused RWHV. |
| 139 virtual TextInputState GetTextInputState(); |
| 140 |
| 141 // This method is called by any RWHV which receives an IPC regarding a change |
| 142 // in the text input state. The IPC might or might not have lead to a change |
| 143 // in state but this method must be called for IME related logic. |
| 144 virtual void UpdateTextInputState(RenderWidgetHostViewBase* rwhv, |
| 145 bool text_input_state_changed); |
| 146 |
| 135 // Notification that the renderer has become unresponsive. The | 147 // Notification that the renderer has become unresponsive. The |
| 136 // delegate can use this notification to show a warning to the user. | 148 // delegate can use this notification to show a warning to the user. |
| 137 virtual void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host) {} | 149 virtual void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host) {} |
| 138 | 150 |
| 139 // Notification that a previously unresponsive renderer has become | 151 // Notification that a previously unresponsive renderer has become |
| 140 // responsive again. The delegate can use this notification to end the | 152 // responsive again. The delegate can use this notification to end the |
| 141 // warning shown to the user. | 153 // warning shown to the user. |
| 142 virtual void RendererResponsive(RenderWidgetHostImpl* render_widget_host) {} | 154 virtual void RendererResponsive(RenderWidgetHostImpl* render_widget_host) {} |
| 143 | 155 |
| 144 // Requests to lock the mouse. Once the request is approved or rejected, | 156 // Requests to lock the mouse. Once the request is approved or rejected, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 160 // Returns the display mode for the view. | 172 // Returns the display mode for the view. |
| 161 virtual blink::WebDisplayMode GetDisplayMode( | 173 virtual blink::WebDisplayMode GetDisplayMode( |
| 162 RenderWidgetHostImpl* render_widget_host) const; | 174 RenderWidgetHostImpl* render_widget_host) const; |
| 163 | 175 |
| 164 // Notification that the widget has lost capture. | 176 // Notification that the widget has lost capture. |
| 165 virtual void LostCapture(RenderWidgetHostImpl* render_widget_host) {} | 177 virtual void LostCapture(RenderWidgetHostImpl* render_widget_host) {} |
| 166 | 178 |
| 167 // Notification that the widget has lost the mouse lock. | 179 // Notification that the widget has lost the mouse lock. |
| 168 virtual void LostMouseLock(RenderWidgetHostImpl* render_widget_host) {} | 180 virtual void LostMouseLock(RenderWidgetHostImpl* render_widget_host) {} |
| 169 | 181 |
| 170 // Called when the widget has sent a compositor proto. This is used in Btlimp | 182 // Called when the widget has sent a compositor proto. This is used in Blimp |
| 171 // mode with the RemoteChannel compositor. | 183 // mode with the RemoteChannel compositor. |
| 172 virtual void ForwardCompositorProto(RenderWidgetHostImpl* render_widget_host, | 184 virtual void ForwardCompositorProto(RenderWidgetHostImpl* render_widget_host, |
| 173 const std::vector<uint8_t>& proto) {} | 185 const std::vector<uint8_t>& proto) {} |
| 174 | 186 |
| 175 // Called when the visibility of the RenderFrameProxyHost in outter | 187 // Called when the visibility of the RenderFrameProxyHost in outer |
| 176 // WebContents changes. This method is only called on an inner WebContents and | 188 // WebContents changes. This method is only called on an inner WebContents and |
| 177 // will eventually notify all the RenderWidgetHostViews belonging to that | 189 // will eventually notify all the RenderWidgetHostViews belonging to that |
| 178 // WebContents. | 190 // WebContents. |
| 179 virtual void OnRenderFrameProxyVisibilityChanged(bool visible) {} | 191 virtual void OnRenderFrameProxyVisibilityChanged(bool visible) {} |
| 180 | 192 |
| 181 // Update the renderer's cache of the screen rect of the view and window. | 193 // Update the renderer's cache of the screen rect of the view and window. |
| 182 virtual void SendScreenRects() {} | 194 virtual void SendScreenRects() {} |
| 183 | 195 |
| 184 protected: | 196 protected: |
| 185 virtual ~RenderWidgetHostDelegate() {} | 197 virtual ~RenderWidgetHostDelegate() {} |
| 186 }; | 198 }; |
| 187 | 199 |
| 188 } // namespace content | 200 } // namespace content |
| 189 | 201 |
| 190 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ | 202 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ |
| OLD | NEW |