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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 // RenderWidgetHost to this function to determine who should ultimately | 128 // RenderWidgetHost to this function to determine who should ultimately |
127 // consume the event. This facilitates keyboard event routing with | 129 // consume the event. This facilitates keyboard event routing with |
128 // out-of-process iframes, where multiple RenderWidgetHosts may be involved | 130 // out-of-process iframes, where multiple RenderWidgetHosts may be involved |
129 // in rendering a page, yet keyboard events all arrive at the main frame's | 131 // in rendering a page, yet keyboard events all arrive at the main frame's |
130 // RenderWidgetHostView. When a main frame's RenderWidgetHost is passed in, | 132 // RenderWidgetHostView. When a main frame's RenderWidgetHost is passed in, |
131 // the function returns the focused frame that should consume keyboard | 133 // the function returns the focused frame that should consume keyboard |
132 // events. In all other cases, the function returns back |receiving_widget|. | 134 // events. In all other cases, the function returns back |receiving_widget|. |
133 virtual RenderWidgetHostImpl* GetFocusedRenderWidgetHost( | 135 virtual RenderWidgetHostImpl* GetFocusedRenderWidgetHost( |
134 RenderWidgetHostImpl* receiving_widget); | 136 RenderWidgetHostImpl* receiving_widget); |
135 | 137 |
138 // Returns the current value of text input state. This should be the value | |
139 // obtained from the focused RWHV. | |
Charlie Reis
2016/03/15 18:32:00
nit: Remove extra space.
EhsanK
2016/03/15 23:51:17
Done. Thanks!
| |
140 virtual TextInputState GetTextInputState(); | |
141 | |
142 // This method is called by any RWHV which receives an IPC regarding a change | |
143 // in the text input state. The IPC could or could not have lead to a change | |
Charlie Reis
2016/03/15 18:32:00
nit: s/could/might/g
EhsanK
2016/03/15 23:51:17
Done. Thanks!
| |
144 // in state but this method must be called for IME related logic. | |
145 virtual void UpdateTextInputState(RenderWidgetHostViewBase* rwhv, | |
146 bool text_input_state_changed); | |
147 | |
136 // Notification that the renderer has become unresponsive. The | 148 // Notification that the renderer has become unresponsive. The |
137 // delegate can use this notification to show a warning to the user. | 149 // delegate can use this notification to show a warning to the user. |
138 virtual void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host) {} | 150 virtual void RendererUnresponsive(RenderWidgetHostImpl* render_widget_host) {} |
139 | 151 |
140 // Notification that a previously unresponsive renderer has become | 152 // Notification that a previously unresponsive renderer has become |
141 // responsive again. The delegate can use this notification to end the | 153 // responsive again. The delegate can use this notification to end the |
142 // warning shown to the user. | 154 // warning shown to the user. |
143 virtual void RendererResponsive(RenderWidgetHostImpl* render_widget_host) {} | 155 virtual void RendererResponsive(RenderWidgetHostImpl* render_widget_host) {} |
144 | 156 |
145 // Requests to lock the mouse. Once the request is approved or rejected, | 157 // Requests to lock the mouse. Once the request is approved or rejected, |
(...skipping 19 matching lines...) Expand all Loading... | |
165 // Notification that the widget has lost capture. | 177 // Notification that the widget has lost capture. |
166 virtual void LostCapture(RenderWidgetHostImpl* render_widget_host) {} | 178 virtual void LostCapture(RenderWidgetHostImpl* render_widget_host) {} |
167 | 179 |
168 // Notification that the widget has lost the mouse lock. | 180 // Notification that the widget has lost the mouse lock. |
169 virtual void LostMouseLock(RenderWidgetHostImpl* render_widget_host) {} | 181 virtual void LostMouseLock(RenderWidgetHostImpl* render_widget_host) {} |
170 | 182 |
171 #if defined(OS_WIN) | 183 #if defined(OS_WIN) |
172 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible(); | 184 virtual gfx::NativeViewAccessible GetParentNativeViewAccessible(); |
173 #endif | 185 #endif |
174 | 186 |
175 // Called when the widget has sent a compositor proto. This is used in Btlimp | 187 // Called when the widget has sent a compositor proto. This is used in Blimp |
176 // mode with the RemoteChannel compositor. | 188 // mode with the RemoteChannel compositor. |
177 virtual void ForwardCompositorProto(RenderWidgetHostImpl* render_widget_host, | 189 virtual void ForwardCompositorProto(RenderWidgetHostImpl* render_widget_host, |
178 const std::vector<uint8_t>& proto) {} | 190 const std::vector<uint8_t>& proto) {} |
179 | 191 |
180 // Called when the visibility of the RenderFrameProxyHost in outter | 192 // Called when the visibility of the RenderFrameProxyHost in outer |
181 // WebContents changes. This method is only called on an inner WebContents and | 193 // WebContents changes. This method is only called on an inner WebContents and |
182 // will eventually notify all the RenderWidgetHostViews belonging to that | 194 // will eventually notify all the RenderWidgetHostViews belonging to that |
183 // WebContents. | 195 // WebContents. |
184 virtual void OnRenderFrameProxyVisibilityChanged(bool visible) {} | 196 virtual void OnRenderFrameProxyVisibilityChanged(bool visible) {} |
185 | 197 |
186 // Update the renderer's cache of the screen rect of the view and window. | 198 // Update the renderer's cache of the screen rect of the view and window. |
187 virtual void SendScreenRects() {} | 199 virtual void SendScreenRects() {} |
188 | 200 |
189 protected: | 201 protected: |
190 virtual ~RenderWidgetHostDelegate() {} | 202 virtual ~RenderWidgetHostDelegate() {} |
191 }; | 203 }; |
192 | 204 |
193 } // namespace content | 205 } // namespace content |
194 | 206 |
195 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ | 207 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_DELEGATE_H_ |
OLD | NEW |