OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlapp.h> | 10 #include <atlapp.h> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 public RenderWidgetHostView, | 68 public RenderWidgetHostView, |
69 public NotificationObserver, | 69 public NotificationObserver, |
70 public BrowserAccessibilityDelegate { | 70 public BrowserAccessibilityDelegate { |
71 public: | 71 public: |
72 // The view will associate itself with the given widget. | 72 // The view will associate itself with the given widget. |
73 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); | 73 explicit RenderWidgetHostViewWin(RenderWidgetHost* widget); |
74 virtual ~RenderWidgetHostViewWin(); | 74 virtual ~RenderWidgetHostViewWin(); |
75 | 75 |
76 void CreateWnd(HWND parent); | 76 void CreateWnd(HWND parent); |
77 | 77 |
78 // This method schedules and waits for compositing unless it was already done | |
79 // during this windows event handling loop. | |
80 // render_widget_host_->ScheduleComposite() blocks waiting for rendering | |
81 // results. ScheduleCompositeIfNeeded can be called in response to a WM_PAINT | |
82 // message to the compositor window or an OnPaint message to the parent | |
83 // window, or both, and we only want to wait once. | |
84 void ScheduleCompositeIfNeeded(); | |
85 | |
78 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); | 86 DECLARE_WND_CLASS_EX(kRenderWidgetHostHWNDClass, CS_DBLCLKS, 0); |
79 | 87 |
80 BEGIN_MSG_MAP(RenderWidgetHostHWND) | 88 BEGIN_MSG_MAP(RenderWidgetHostHWND) |
81 MSG_WM_CREATE(OnCreate) | 89 MSG_WM_CREATE(OnCreate) |
82 MSG_WM_ACTIVATE(OnActivate) | 90 MSG_WM_ACTIVATE(OnActivate) |
83 MSG_WM_DESTROY(OnDestroy) | 91 MSG_WM_DESTROY(OnDestroy) |
84 MSG_WM_PAINT(OnPaint) | 92 MSG_WM_PAINT(OnPaint) |
85 MSG_WM_NCPAINT(OnNCPaint) | 93 MSG_WM_NCPAINT(OnNCPaint) |
86 MSG_WM_ERASEBKGND(OnEraseBkgnd) | 94 MSG_WM_ERASEBKGND(OnEraseBkgnd) |
87 MSG_WM_SETCURSOR(OnSetCursor) | 95 MSG_WM_SETCURSOR(OnSetCursor) |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 // will be tiled such that it lines up with existing tiles starting from the | 269 // will be tiled such that it lines up with existing tiles starting from the |
262 // origin of |dc|. | 270 // origin of |dc|. |
263 void DrawBackground(const RECT& rect, CPaintDC* dc); | 271 void DrawBackground(const RECT& rect, CPaintDC* dc); |
264 | 272 |
265 // Create an intermediate window between the given HWND and its parent. | 273 // Create an intermediate window between the given HWND and its parent. |
266 HWND ReparentWindow(HWND window); | 274 HWND ReparentWindow(HWND window); |
267 | 275 |
268 // Clean up the compositor window, if needed. | 276 // Clean up the compositor window, if needed. |
269 void CleanupCompositorWindow(); | 277 void CleanupCompositorWindow(); |
270 | 278 |
279 // Reset was_compositing_just_scheduled_ to false. | |
280 void ResetWasCompositingJustScheduled(); | |
281 | |
271 // Whether the window should be activated. | 282 // Whether the window should be activated. |
272 bool IsActivatable() const; | 283 bool IsActivatable() const; |
273 | 284 |
274 // The associated Model. | 285 // The associated Model. |
275 RenderWidgetHost* render_widget_host_; | 286 RenderWidgetHost* render_widget_host_; |
276 | 287 |
277 // When we are doing accelerated compositing | 288 // When we are doing accelerated compositing |
278 HWND compositor_host_window_; | 289 HWND compositor_host_window_; |
279 | 290 |
291 // This bool is set to true on the first call to ScheduleComposite, and an | |
darin (slow to review)
2011/05/26 23:03:06
ScheduleComposite -> ScheduleCompositeIfNeeded, ri
| |
292 // async task is posted to reset it to false. | |
293 // This is to ensure that the blocking call to | |
294 // render_widget_host_->ScheduleComposite() only happens once for the same | |
295 // set of windows WM_PAINT/OnPaint events. | |
296 bool was_compositing_just_scheduled_; | |
297 | |
280 // true if the compositor host window must be hidden after the | 298 // true if the compositor host window must be hidden after the |
281 // software renderered view is updated. | 299 // software renderered view is updated. |
282 bool hide_compositor_window_at_next_paint_; | 300 bool hide_compositor_window_at_next_paint_; |
283 | 301 |
284 // The cursor for the page. This is passed up from the renderer. | 302 // The cursor for the page. This is passed up from the renderer. |
285 WebCursor current_cursor_; | 303 WebCursor current_cursor_; |
286 | 304 |
287 // Indicates if the page is loading. | 305 // Indicates if the page is loading. |
288 bool is_loading_; | 306 bool is_loading_; |
289 | 307 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
324 // The tooltip control hwnd | 342 // The tooltip control hwnd |
325 HWND tooltip_hwnd_; | 343 HWND tooltip_hwnd_; |
326 // Whether or not a tooltip is currently visible. We use this to track | 344 // Whether or not a tooltip is currently visible. We use this to track |
327 // whether or not we want to force-close the tooltip when we receive mouse | 345 // whether or not we want to force-close the tooltip when we receive mouse |
328 // move notifications from the renderer. See comment in OnMsgSetTooltipText. | 346 // move notifications from the renderer. See comment in OnMsgSetTooltipText. |
329 bool tooltip_showing_; | 347 bool tooltip_showing_; |
330 | 348 |
331 // Factory used to safely scope delayed calls to ShutdownHost(). | 349 // Factory used to safely scope delayed calls to ShutdownHost(). |
332 ScopedRunnableMethodFactory<RenderWidgetHostViewWin> shutdown_factory_; | 350 ScopedRunnableMethodFactory<RenderWidgetHostViewWin> shutdown_factory_; |
333 | 351 |
352 // Factory used to safely scope calls to RenderWidgetHostViewWin methods. | |
353 ScopedRunnableMethodFactory<RenderWidgetHostViewWin> method_factory_; | |
354 | |
334 // Our parent HWND. We keep a reference to it as we SetParent(NULL) when | 355 // Our parent HWND. We keep a reference to it as we SetParent(NULL) when |
335 // hidden to prevent getting messages (Paint, Resize...), and we reattach | 356 // hidden to prevent getting messages (Paint, Resize...), and we reattach |
336 // when shown again. | 357 // when shown again. |
337 HWND parent_hwnd_; | 358 HWND parent_hwnd_; |
338 | 359 |
339 // Instance of accessibility information for the root of the MSAA | 360 // Instance of accessibility information for the root of the MSAA |
340 // tree representation of the WebKit render tree. | 361 // tree representation of the WebKit render tree. |
341 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; | 362 scoped_ptr<BrowserAccessibilityManager> browser_accessibility_manager_; |
342 | 363 |
343 // The time at which this view started displaying white pixels as a result of | 364 // The time at which this view started displaying white pixels as a result of |
(...skipping 16 matching lines...) Expand all Loading... | |
360 WebKit::WebTextInputType text_input_type_; | 381 WebKit::WebTextInputType text_input_type_; |
361 | 382 |
362 ScopedVector<ui::ViewProp> props_; | 383 ScopedVector<ui::ViewProp> props_; |
363 | 384 |
364 scoped_ptr<ui::ViewProp> accessibility_prop_; | 385 scoped_ptr<ui::ViewProp> accessibility_prop_; |
365 | 386 |
366 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); | 387 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); |
367 }; | 388 }; |
368 | 389 |
369 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ | 390 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_WIN_H_ |
OLD | NEW |