Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: chrome/renderer/render_widget.h

Issue 506013: Combine ViewHostMsg_{Paint,Scroll}Rect into one IPC.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 OnPaintRectAck(); 145 void OnUpdateRectAck();
146 void OnScrollRectAck();
147 void OnRequestMoveAck(); 146 void OnRequestMoveAck();
148 void OnHandleInputEvent(const IPC::Message& message); 147 void OnHandleInputEvent(const IPC::Message& message);
149 void OnMouseCaptureLost(); 148 void OnMouseCaptureLost();
150 void OnSetFocus(bool enable); 149 void OnSetFocus(bool enable);
151 void OnImeSetInputMode(bool is_active); 150 void OnImeSetInputMode(bool is_active);
152 void OnImeSetComposition(WebKit::WebCompositionCommand command, 151 void OnImeSetComposition(WebKit::WebCompositionCommand command,
153 int cursor_position, 152 int cursor_position,
154 int target_start, int target_end, 153 int target_start, int target_end,
155 const string16& ime_string); 154 const string16& ime_string);
156 void OnMsgRepaint(const gfx::Size& size_to_paint); 155 void OnMsgRepaint(const gfx::Size& size_to_paint);
157 void OnSetTextDirection(WebKit::WebTextDirection direction); 156 void OnSetTextDirection(WebKit::WebTextDirection direction);
158 157
159 // Override point to notify that a paint has happened. This fires after the 158 // Override point to notify that a paint has happened. This fires after the
160 // browser side has updated the screen for a newly painted region. 159 // browser side has updated the screen for a newly painted region.
161 virtual void DidPaint() {} 160 virtual void DidPaint() {}
162 161
163 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should 162 // Sets the "hidden" state of this widget. All accesses to is_hidden_ should
164 // use this method so that we can properly inform the RenderThread of our 163 // use this method so that we can properly inform the RenderThread of our
165 // state. 164 // state.
166 void SetHidden(bool hidden); 165 void SetHidden(bool hidden);
167 166
168 bool is_hidden() const { return is_hidden_; } 167 bool is_hidden() const { return is_hidden_; }
169 168
170 // True if a PaintRect_ACK message is pending. 169 // True if an UpdateRect_ACK message is pending.
171 bool paint_reply_pending() const { 170 bool update_reply_pending() const {
172 return paint_reply_pending_; 171 return update_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;
178 } 172 }
179 173
180 bool next_paint_is_resize_ack() const; 174 bool next_paint_is_resize_ack() const;
181 bool next_paint_is_restore_ack() const; 175 bool next_paint_is_restore_ack() const;
182 void set_next_paint_is_resize_ack(); 176 void set_next_paint_is_resize_ack();
183 void set_next_paint_is_restore_ack(); 177 void set_next_paint_is_restore_ack();
184 void set_next_paint_is_repaint_ack(); 178 void set_next_paint_is_repaint_ack();
185 179
186 // Called when a renderer process moves an input focus or updates the 180 // Called when a renderer process moves an input focus or updates the
187 // position of its caret. 181 // position of its caret.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // The window we are embedded within. TODO(darin): kill this. 225 // The window we are embedded within. TODO(darin): kill this.
232 gfx::NativeViewId host_window_; 226 gfx::NativeViewId host_window_;
233 227
234 // We store the current cursor object so we can avoid spamming SetCursor 228 // We store the current cursor object so we can avoid spamming SetCursor
235 // messages. 229 // messages.
236 WebCursor current_cursor_; 230 WebCursor current_cursor_;
237 231
238 // The size of the RenderWidget. 232 // The size of the RenderWidget.
239 gfx::Size size_; 233 gfx::Size size_;
240 234
241 // Transport DIBs that are currently in use to transfer an image to the 235 // The TransportDIB that is being used to transfer an image to the browser.
242 // browser.
243 TransportDIB* current_paint_buf_; 236 TransportDIB* current_paint_buf_;
244 TransportDIB* current_scroll_buf_;
245 237
246 PaintAggregator paint_aggregator_; 238 PaintAggregator paint_aggregator_;
247 239
248 // The area that must be reserved for drawing the resize corner. 240 // The area that must be reserved for drawing the resize corner.
249 gfx::Rect resizer_rect_; 241 gfx::Rect resizer_rect_;
250 242
251 // Flags for the next ViewHostMsg_PaintRect message. 243 // Flags for the next ViewHostMsg_UpdateRect message.
252 int next_paint_flags_; 244 int next_paint_flags_;
253 245
254 // True if we are expecting a PaintRect_ACK message (i.e., that a PaintRect 246 // True if we are expecting an UpdateRect_ACK message (i.e., that a
255 // message has been sent). 247 // UpdateRect message has been sent).
256 bool paint_reply_pending_; 248 bool update_reply_pending_;
257 249
258 // Set to true if we should ignore RenderWidget::Show calls. 250 // Set to true if we should ignore RenderWidget::Show calls.
259 bool did_show_; 251 bool did_show_;
260 252
261 // Indicates that we shouldn't bother generated paint events. 253 // Indicates that we shouldn't bother generated paint events.
262 bool is_hidden_; 254 bool is_hidden_;
263 255
264 // Indicates that we should be repainted when restored. This flag is set to 256 // Indicates that we should be repainted when restored. This flag is set to
265 // true if we receive an invalidation / scroll event from webkit while our 257 // true if we receive an invalidation / scroll event from webkit while our
266 // is_hidden_ flag is set to true. This is used to force a repaint once we 258 // 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
316 308
317 scoped_ptr<IPC::Message> pending_input_event_ack_; 309 scoped_ptr<IPC::Message> pending_input_event_ack_;
318 310
319 // Indicates if the next sequence of Char events should be suppressed or not. 311 // Indicates if the next sequence of Char events should be suppressed or not.
320 bool suppress_next_char_events_; 312 bool suppress_next_char_events_;
321 313
322 DISALLOW_COPY_AND_ASSIGN(RenderWidget); 314 DISALLOW_COPY_AND_ASSIGN(RenderWidget);
323 }; 315 };
324 316
325 #endif // CHROME_RENDERER_RENDER_WIDGET_H_ 317 #endif // CHROME_RENDERER_RENDER_WIDGET_H_
OLDNEW
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698