| 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 "app/gfx/native_widget_types.h" | 10 #include "app/gfx/native_widget_types.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). | 135 // mainly intended to be used in conjuction with WebView::SetIsTransparent(). |
| 136 virtual void SetBackground(const SkBitmap& bitmap); | 136 virtual void SetBackground(const SkBitmap& bitmap); |
| 137 | 137 |
| 138 // RenderWidget IPC message handlers | 138 // RenderWidget IPC message handlers |
| 139 void OnClose(); | 139 void OnClose(); |
| 140 void OnCreatingNewAck(gfx::NativeViewId parent); | 140 void OnCreatingNewAck(gfx::NativeViewId parent); |
| 141 virtual void OnResize(const gfx::Size& new_size, | 141 virtual void OnResize(const gfx::Size& new_size, |
| 142 const gfx::Rect& resizer_rect); | 142 const gfx::Rect& resizer_rect); |
| 143 void OnWasHidden(); | 143 void OnWasHidden(); |
| 144 void OnWasRestored(bool needs_repainting); | 144 void OnWasRestored(bool needs_repainting); |
| 145 void OnUpdateRectAck(); | 145 void OnPaintRectAck(); |
| 146 void OnScrollRectAck(); |
| 146 void OnRequestMoveAck(); | 147 void OnRequestMoveAck(); |
| 147 void OnHandleInputEvent(const IPC::Message& message); | 148 void OnHandleInputEvent(const IPC::Message& message); |
| 148 void OnMouseCaptureLost(); | 149 void OnMouseCaptureLost(); |
| 149 void OnSetFocus(bool enable); | 150 void OnSetFocus(bool enable); |
| 150 void OnImeSetInputMode(bool is_active); | 151 void OnImeSetInputMode(bool is_active); |
| 151 void OnImeSetComposition(WebKit::WebCompositionCommand command, | 152 void OnImeSetComposition(WebKit::WebCompositionCommand command, |
| 152 int cursor_position, | 153 int cursor_position, |
| 153 int target_start, int target_end, | 154 int target_start, int target_end, |
| 154 const string16& ime_string); | 155 const string16& ime_string); |
| 155 void OnMsgRepaint(const gfx::Size& size_to_paint); | 156 void OnMsgRepaint(const gfx::Size& size_to_paint); |
| 156 void OnSetTextDirection(WebKit::WebTextDirection direction); | 157 void OnSetTextDirection(WebKit::WebTextDirection direction); |
| 157 | 158 |
| 158 // Override point to notify that a paint has happened. This fires after the | 159 // Override point to notify that a paint has happened. This fires after the |
| 159 // browser side has updated the screen for a newly painted region. | 160 // browser side has updated the screen for a newly painted region. |
| 160 virtual void DidPaint() {} | 161 virtual void DidPaint() {} |
| 161 | 162 |
| 162 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should | 163 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should |
| 163 // use this method so that we can properly inform the RenderThread of our | 164 // use this method so that we can properly inform the RenderThread of our |
| 164 // state. | 165 // state. |
| 165 void SetHidden(bool hidden); | 166 void SetHidden(bool hidden); |
| 166 | 167 |
| 167 bool is_hidden() const { return is_hidden_; } | 168 bool is_hidden() const { return is_hidden_; } |
| 168 | 169 |
| 169 // True if an UpdateRect_ACK message is pending. | 170 // True if a PaintRect_ACK message is pending. |
| 170 bool update_reply_pending() const { | 171 bool paint_reply_pending() const { |
| 171 return update_reply_pending_; | 172 return paint_reply_pending_; |
| 173 } |
| 174 |
| 175 // True if a ScrollRect_ACK message is pending. |
| 176 bool scroll_reply_pending() const { |
| 177 return current_scroll_buf_ != NULL; |
| 172 } | 178 } |
| 173 | 179 |
| 174 bool next_paint_is_resize_ack() const; | 180 bool next_paint_is_resize_ack() const; |
| 175 bool next_paint_is_restore_ack() const; | 181 bool next_paint_is_restore_ack() const; |
| 176 void set_next_paint_is_resize_ack(); | 182 void set_next_paint_is_resize_ack(); |
| 177 void set_next_paint_is_restore_ack(); | 183 void set_next_paint_is_restore_ack(); |
| 178 void set_next_paint_is_repaint_ack(); | 184 void set_next_paint_is_repaint_ack(); |
| 179 | 185 |
| 180 // Called when a renderer process moves an input focus or updates the | 186 // Called when a renderer process moves an input focus or updates the |
| 181 // position of its caret. | 187 // position of its caret. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // The window we are embedded within. TODO(darin): kill this. | 231 // The window we are embedded within. TODO(darin): kill this. |
| 226 gfx::NativeViewId host_window_; | 232 gfx::NativeViewId host_window_; |
| 227 | 233 |
| 228 // We store the current cursor object so we can avoid spamming SetCursor | 234 // We store the current cursor object so we can avoid spamming SetCursor |
| 229 // messages. | 235 // messages. |
| 230 WebCursor current_cursor_; | 236 WebCursor current_cursor_; |
| 231 | 237 |
| 232 // The size of the RenderWidget. | 238 // The size of the RenderWidget. |
| 233 gfx::Size size_; | 239 gfx::Size size_; |
| 234 | 240 |
| 235 // The TransportDIB that is being used to transfer an image to the browser. | 241 // Transport DIBs that are currently in use to transfer an image to the |
| 242 // browser. |
| 236 TransportDIB* current_paint_buf_; | 243 TransportDIB* current_paint_buf_; |
| 244 TransportDIB* current_scroll_buf_; |
| 237 | 245 |
| 238 PaintAggregator paint_aggregator_; | 246 PaintAggregator paint_aggregator_; |
| 239 | 247 |
| 240 // The area that must be reserved for drawing the resize corner. | 248 // The area that must be reserved for drawing the resize corner. |
| 241 gfx::Rect resizer_rect_; | 249 gfx::Rect resizer_rect_; |
| 242 | 250 |
| 243 // Flags for the next ViewHostMsg_UpdateRect message. | 251 // Flags for the next ViewHostMsg_PaintRect message. |
| 244 int next_paint_flags_; | 252 int next_paint_flags_; |
| 245 | 253 |
| 246 // True if we are expecting an UpdateRect_ACK message (i.e., that a | 254 // True if we are expecting a PaintRect_ACK message (i.e., that a PaintRect |
| 247 // UpdateRect message has been sent). | 255 // message has been sent). |
| 248 bool update_reply_pending_; | 256 bool paint_reply_pending_; |
| 249 | 257 |
| 250 // Set to true if we should ignore RenderWidget::Show calls. | 258 // Set to true if we should ignore RenderWidget::Show calls. |
| 251 bool did_show_; | 259 bool did_show_; |
| 252 | 260 |
| 253 // Indicates that we shouldn't bother generated paint events. | 261 // Indicates that we shouldn't bother generated paint events. |
| 254 bool is_hidden_; | 262 bool is_hidden_; |
| 255 | 263 |
| 256 // Indicates that we should be repainted when restored. This flag is set to | 264 // Indicates that we should be repainted when restored. This flag is set to |
| 257 // true if we receive an invalidation / scroll event from webkit while our | 265 // true if we receive an invalidation / scroll event from webkit while our |
| 258 // is_hidden_ flag is set to true. This is used to force a repaint once we | 266 // is_hidden_ flag is set to true. This is used to force a repaint once we |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 316 |
| 309 scoped_ptr<IPC::Message> pending_input_event_ack_; | 317 scoped_ptr<IPC::Message> pending_input_event_ack_; |
| 310 | 318 |
| 311 // Indicates if the next sequence of Char events should be suppressed or not. | 319 // Indicates if the next sequence of Char events should be suppressed or not. |
| 312 bool suppress_next_char_events_; | 320 bool suppress_next_char_events_; |
| 313 | 321 |
| 314 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 322 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 315 }; | 323 }; |
| 316 | 324 |
| 317 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ | 325 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |