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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "content/public/browser/render_widget_host.h" | 36 #include "content/public/browser/render_widget_host.h" |
37 #include "content/public/common/page_zoom.h" | 37 #include "content/public/common/page_zoom.h" |
38 #include "ipc/ipc_listener.h" | 38 #include "ipc/ipc_listener.h" |
39 #include "ui/base/ime/text_input_mode.h" | 39 #include "ui/base/ime/text_input_mode.h" |
40 #include "ui/base/ime/text_input_type.h" | 40 #include "ui/base/ime/text_input_type.h" |
41 #include "ui/events/latency_info.h" | 41 #include "ui/events/latency_info.h" |
42 #include "ui/gfx/native_widget_types.h" | 42 #include "ui/gfx/native_widget_types.h" |
43 | 43 |
44 struct AcceleratedSurfaceMsg_BufferPresented_Params; | 44 struct AcceleratedSurfaceMsg_BufferPresented_Params; |
45 struct ViewHostMsg_BeginSmoothScroll_Params; | 45 struct ViewHostMsg_BeginSmoothScroll_Params; |
46 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | |
47 struct ViewHostMsg_SelectionBounds_Params; | 46 struct ViewHostMsg_SelectionBounds_Params; |
48 struct ViewHostMsg_TextInputState_Params; | 47 struct ViewHostMsg_TextInputState_Params; |
49 struct ViewHostMsg_UpdateRect_Params; | 48 struct ViewHostMsg_UpdateRect_Params; |
50 | 49 |
51 namespace base { | 50 namespace base { |
52 class TimeTicks; | 51 class TimeTicks; |
53 } | 52 } |
54 | 53 |
55 namespace cc { | 54 namespace cc { |
56 class CompositorFrame; | 55 class CompositorFrame; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 245 |
247 // Noifies the RenderWidget of the current mouse cursor visibility state. | 246 // Noifies the RenderWidget of the current mouse cursor visibility state. |
248 void SendCursorVisibilityState(bool is_visible); | 247 void SendCursorVisibilityState(bool is_visible); |
249 | 248 |
250 // Notifies the RenderWidgetHost that the View was destroyed. | 249 // Notifies the RenderWidgetHost that the View was destroyed. |
251 void ViewDestroyed(); | 250 void ViewDestroyed(); |
252 | 251 |
253 // Indicates if the page has finished loading. | 252 // Indicates if the page has finished loading. |
254 void SetIsLoading(bool is_loading); | 253 void SetIsLoading(bool is_loading); |
255 | 254 |
| 255 #if defined(OS_MACOSX) |
256 // Pause for a moment to wait for pending repaint or resize messages sent to | 256 // Pause for a moment to wait for pending repaint or resize messages sent to |
257 // the renderer to arrive. If pending resize messages are for an old window | 257 // the renderer to arrive. If pending resize messages are for an old window |
258 // size, then also pump through a new resize message if there is time. | 258 // size, then also pump through a new resize message if there is time. |
259 void PauseForPendingResizeOrRepaints(); | 259 void PauseForPendingResizeOrRepaints(); |
260 | 260 |
261 // Whether pausing may be useful. | 261 // Whether pausing may be useful. |
262 bool CanPauseForPendingResizeOrRepaints(); | 262 bool CanPauseForPendingResizeOrRepaints(); |
263 | 263 |
264 bool resize_ack_pending_for_testing() { return resize_ack_pending_; } | |
265 | |
266 // Wait for a surface matching the size of the widget's view, possibly | 264 // Wait for a surface matching the size of the widget's view, possibly |
267 // blocking until the renderer sends a new frame. | 265 // blocking until the renderer sends a new frame. |
268 void WaitForSurface(); | 266 void WaitForSurface(); |
| 267 #endif |
| 268 |
| 269 bool resize_ack_pending_for_testing() { return resize_ack_pending_; } |
269 | 270 |
270 // GPU accelerated version of GetBackingStore function. This will | 271 // GPU accelerated version of GetBackingStore function. This will |
271 // trigger a re-composite to the view. It may fail if a resize is pending, or | 272 // trigger a re-composite to the view. It may fail if a resize is pending, or |
272 // if a composite has already been requested and not acked yet. | 273 // if a composite has already been requested and not acked yet. |
273 bool ScheduleComposite(); | 274 bool ScheduleComposite(); |
274 | 275 |
275 // Starts a hang monitor timeout. If there's already a hang monitor timeout | 276 // Starts a hang monitor timeout. If there's already a hang monitor timeout |
276 // the new one will only fire if it has a shorter delay than the time | 277 // the new one will only fire if it has a shorter delay than the time |
277 // left on the existing timeouts. | 278 // left on the existing timeouts. |
278 void StartHangMonitorTimeout(base::TimeDelta delay); | 279 void StartHangMonitorTimeout(base::TimeDelta delay); |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 void RendererIsResponsive(); | 616 void RendererIsResponsive(); |
616 | 617 |
617 // IPC message handlers | 618 // IPC message handlers |
618 void OnRenderViewReady(); | 619 void OnRenderViewReady(); |
619 void OnRenderProcessGone(int status, int error_code); | 620 void OnRenderProcessGone(int status, int error_code); |
620 void OnClose(); | 621 void OnClose(); |
621 void OnUpdateScreenRectsAck(); | 622 void OnUpdateScreenRectsAck(); |
622 void OnRequestMove(const gfx::Rect& pos); | 623 void OnRequestMove(const gfx::Rect& pos); |
623 void OnSetTooltipText(const base::string16& tooltip_text, | 624 void OnSetTooltipText(const base::string16& tooltip_text, |
624 blink::WebTextDirection text_direction_hint); | 625 blink::WebTextDirection text_direction_hint); |
625 #if defined(OS_MACOSX) | |
626 void OnCompositorSurfaceBuffersSwapped( | |
627 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params); | |
628 #endif | |
629 bool OnSwapCompositorFrame(const IPC::Message& message); | 626 bool OnSwapCompositorFrame(const IPC::Message& message); |
630 void OnFlingingStopped(); | 627 void OnFlingingStopped(); |
631 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 628 void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
632 void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); | 629 void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); |
633 virtual void OnFocus(); | 630 virtual void OnFocus(); |
634 virtual void OnBlur(); | 631 virtual void OnBlur(); |
635 void OnSetCursor(const WebCursor& cursor); | 632 void OnSetCursor(const WebCursor& cursor); |
636 void OnSetTouchEventEmulationEnabled(bool enabled, bool allow_pinch); | 633 void OnSetTouchEventEmulationEnabled(bool enabled, bool allow_pinch); |
637 void OnTextInputStateChanged( | 634 void OnTextInputStateChanged( |
638 const ViewHostMsg_TextInputState_Params& params); | 635 const ViewHostMsg_TextInputState_Params& params); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 typedef std::map<int, | 880 typedef std::map<int, |
884 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; | 881 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; |
885 PendingSnapshotMap pending_browser_snapshots_; | 882 PendingSnapshotMap pending_browser_snapshots_; |
886 | 883 |
887 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 884 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
888 }; | 885 }; |
889 | 886 |
890 } // namespace content | 887 } // namespace content |
891 | 888 |
892 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 889 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |