OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CHROME_RENDERER_RENDER_WIDGET_H_ |
6 #define CHROME_RENDERER_RENDER_WIDGET_H_ | 6 #define CHROME_RENDERER_RENDER_WIDGET_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
13 #include "chrome/renderer/gpu_channel_host.h" | |
14 #include "chrome/renderer/paint_aggregator.h" | 13 #include "chrome/renderer/paint_aggregator.h" |
15 #include "chrome/renderer/render_process.h" | 14 #include "chrome/renderer/render_process.h" |
16 #include "gfx/native_widget_types.h" | 15 #include "gfx/native_widget_types.h" |
17 #include "gfx/point.h" | 16 #include "gfx/point.h" |
18 #include "gfx/rect.h" | 17 #include "gfx/rect.h" |
19 #include "gfx/size.h" | 18 #include "gfx/size.h" |
20 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
21 #include "ipc/ipc_channel_handle.h" | |
22 #include "skia/ext/platform_canvas.h" | 20 #include "skia/ext/platform_canvas.h" |
23 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
24 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h" | 22 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h" |
25 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 23 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
26 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" | 24 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" |
27 #include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h" | 25 #include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h" |
28 #include "webkit/glue/webcursor.h" | 26 #include "webkit/glue/webcursor.h" |
29 | 27 |
30 class RenderThreadBase; | 28 class RenderThreadBase; |
31 struct ViewHostMsg_ShowPopup_Params; | 29 struct ViewHostMsg_ShowPopup_Params; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Called when a plugin window has been destroyed, to make sure the currently | 98 // Called when a plugin window has been destroyed, to make sure the currently |
101 // pending moves don't try to reference it. | 99 // pending moves don't try to reference it. |
102 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); | 100 void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); |
103 | 101 |
104 // Invalidates entire widget rect to generate a full repaint. | 102 // Invalidates entire widget rect to generate a full repaint. |
105 void GenerateFullRepaint(); | 103 void GenerateFullRepaint(); |
106 | 104 |
107 // Close the underlying WebWidget. | 105 // Close the underlying WebWidget. |
108 virtual void Close(); | 106 virtual void Close(); |
109 | 107 |
110 // Asynchronously establish a channel to the GPU plugin if not previously | |
111 // established or if it has been lost (for example if the GPU plugin crashed). | |
112 // Use GetGpuChannel() to determine when the channel is ready for use. | |
113 void EstablishGpuChannel(); | |
114 | |
115 // Get the GPU channel. Returns NULL if the channel is not established or | |
116 // has been lost. | |
117 GpuChannelHost* GetGpuChannel(); | |
118 | |
119 protected: | 108 protected: |
120 // Friend RefCounted so that the dtor can be non-public. Using this class | 109 // Friend RefCounted so that the dtor can be non-public. Using this class |
121 // without ref-counting is an error. | 110 // without ref-counting is an error. |
122 friend class base::RefCounted<RenderWidget>; | 111 friend class base::RefCounted<RenderWidget>; |
123 | 112 |
124 RenderWidget(RenderThreadBase* render_thread, bool activatable); | 113 RenderWidget(RenderThreadBase* render_thread, bool activatable); |
125 virtual ~RenderWidget(); | 114 virtual ~RenderWidget(); |
126 | 115 |
127 // Initializes this view with the given opener. CompleteInit must be called | 116 // Initializes this view with the given opener. CompleteInit must be called |
128 // later. | 117 // later. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 void OnHandleInputEvent(const IPC::Message& message); | 153 void OnHandleInputEvent(const IPC::Message& message); |
165 void OnMouseCaptureLost(); | 154 void OnMouseCaptureLost(); |
166 virtual void OnSetFocus(bool enable); | 155 virtual void OnSetFocus(bool enable); |
167 void OnImeSetInputMode(bool is_active); | 156 void OnImeSetInputMode(bool is_active); |
168 void OnImeSetComposition(WebKit::WebCompositionCommand command, | 157 void OnImeSetComposition(WebKit::WebCompositionCommand command, |
169 int cursor_position, | 158 int cursor_position, |
170 int target_start, int target_end, | 159 int target_start, int target_end, |
171 const string16& ime_string); | 160 const string16& ime_string); |
172 void OnMsgRepaint(const gfx::Size& size_to_paint); | 161 void OnMsgRepaint(const gfx::Size& size_to_paint); |
173 void OnSetTextDirection(WebKit::WebTextDirection direction); | 162 void OnSetTextDirection(WebKit::WebTextDirection direction); |
174 void OnGpuChannelEstablished(const IPC::ChannelHandle& channel_handle); | |
175 | 163 |
176 // Override point to notify derived classes that a paint has happened. | 164 // Override point to notify derived classes that a paint has happened. |
177 // DidInitiatePaint happens when we've generated a new bitmap and sent it to | 165 // DidInitiatePaint happens when we've generated a new bitmap and sent it to |
178 // the browser. DidFlushPaint happens once we've received the ACK that the | 166 // the browser. DidFlushPaint happens once we've received the ACK that the |
179 // screen has actually been updated. | 167 // screen has actually been updated. |
180 virtual void DidInitiatePaint() {} | 168 virtual void DidInitiatePaint() {} |
181 virtual void DidFlushPaint() {} | 169 virtual void DidFlushPaint() {} |
182 | 170 |
183 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should | 171 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
184 // use this method so that we can properly inform the RenderThread of our | 172 // use this method so that we can properly inform the RenderThread of our |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 int pending_window_rect_count_; | 313 int pending_window_rect_count_; |
326 WebKit::WebRect pending_window_rect_; | 314 WebKit::WebRect pending_window_rect_; |
327 | 315 |
328 scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_; | 316 scoped_ptr<ViewHostMsg_ShowPopup_Params> popup_params_; |
329 | 317 |
330 scoped_ptr<IPC::Message> pending_input_event_ack_; | 318 scoped_ptr<IPC::Message> pending_input_event_ack_; |
331 | 319 |
332 // Indicates if the next sequence of Char events should be suppressed or not. | 320 // Indicates if the next sequence of Char events should be suppressed or not. |
333 bool suppress_next_char_events_; | 321 bool suppress_next_char_events_; |
334 | 322 |
335 // The channel from the renderer process to the GPU process. | |
336 scoped_refptr<GpuChannelHost> gpu_channel_; | |
337 | |
338 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 323 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
339 }; | 324 }; |
340 | 325 |
341 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ | 326 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |