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