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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 int acc_obj_id, gfx::Point point) OVERRIDE; | 185 int acc_obj_id, gfx::Point point) OVERRIDE; |
186 virtual void AccessibilitySetTextSelection( | 186 virtual void AccessibilitySetTextSelection( |
187 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; | 187 int acc_obj_id, int start_offset, int end_offset) OVERRIDE; |
188 virtual bool AccessibilityViewHasFocus() const OVERRIDE; | 188 virtual bool AccessibilityViewHasFocus() const OVERRIDE; |
189 virtual gfx::Rect AccessibilityGetViewBounds() const OVERRIDE; | 189 virtual gfx::Rect AccessibilityGetViewBounds() const OVERRIDE; |
190 virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) | 190 virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) |
191 const OVERRIDE; | 191 const OVERRIDE; |
192 virtual void AccessibilityHitTest(const gfx::Point& point) OVERRIDE; | 192 virtual void AccessibilityHitTest(const gfx::Point& point) OVERRIDE; |
193 virtual void AccessibilityFatalError() OVERRIDE; | 193 virtual void AccessibilityFatalError() OVERRIDE; |
194 | 194 |
| 195 // Forces redraw in the renderer and when the update reaches the browser |
| 196 // grabs snapshot from the compositor. Returns PNG-encoded snapshot. |
| 197 void GetSnapshotFromBrowser( |
| 198 const base::Callback<void(const unsigned char*,size_t)> callback); |
| 199 |
195 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; | 200 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; |
196 | 201 |
197 // Notification that the screen info has changed. | 202 // Notification that the screen info has changed. |
198 void NotifyScreenInfoChanged(); | 203 void NotifyScreenInfoChanged(); |
199 | 204 |
200 // Invalidates the cached screen info so that next resize request | 205 // Invalidates the cached screen info so that next resize request |
201 // will carry the up to date screen info. Unlike | 206 // will carry the up to date screen info. Unlike |
202 // |NotifyScreenInfoChanged|, this doesn't send a message to the renderer. | 207 // |NotifyScreenInfoChanged|, this doesn't send a message to the renderer. |
203 void InvalidateScreenInfo(); | 208 void InvalidateScreenInfo(); |
204 | 209 |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 691 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
687 InputEventAckState ack_result) OVERRIDE; | 692 InputEventAckState ack_result) OVERRIDE; |
688 virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) OVERRIDE; | 693 virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) OVERRIDE; |
689 | 694 |
690 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); | 695 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); |
691 | 696 |
692 // Called when there is a new auto resize (using a post to avoid a stack | 697 // Called when there is a new auto resize (using a post to avoid a stack |
693 // which may get in recursive loops). | 698 // which may get in recursive loops). |
694 void DelayedAutoResized(); | 699 void DelayedAutoResized(); |
695 | 700 |
| 701 void WindowOldSnapshotReachedScreen(int snapshot_id); |
| 702 |
696 void WindowSnapshotReachedScreen(int snapshot_id); | 703 void WindowSnapshotReachedScreen(int snapshot_id); |
697 | 704 |
| 705 void OnSnapshotDataReceived(int snapshot_id, |
| 706 const unsigned char* png, |
| 707 size_t size); |
| 708 |
| 709 void OnSnapshotDataReceivedAsync( |
| 710 int snapshot_id, |
| 711 scoped_refptr<base::RefCountedBytes> png_data); |
| 712 |
698 // Send a message to the renderer process to change the accessibility mode. | 713 // Send a message to the renderer process to change the accessibility mode. |
699 void SetAccessibilityMode(AccessibilityMode AccessibilityMode); | 714 void SetAccessibilityMode(AccessibilityMode AccessibilityMode); |
700 | 715 |
701 // Our delegate, which wants to know mainly about keyboard events. | 716 // Our delegate, which wants to know mainly about keyboard events. |
702 // It will remain non-NULL until DetachDelegate() is called. | 717 // It will remain non-NULL until DetachDelegate() is called. |
703 RenderWidgetHostDelegate* delegate_; | 718 RenderWidgetHostDelegate* delegate_; |
704 | 719 |
705 // Created during construction but initialized during Init*(). Therefore, it | 720 // Created during construction but initialized during Init*(). Therefore, it |
706 // is guaranteed never to be NULL, but its channel may be NULL if the | 721 // is guaranteed never to be NULL, but its channel may be NULL if the |
707 // renderer crashed, so you must always check that. | 722 // renderer crashed, so you must always check that. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 scoped_ptr<InputRouter> input_router_; | 870 scoped_ptr<InputRouter> input_router_; |
856 | 871 |
857 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 872 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
858 | 873 |
859 #if defined(OS_WIN) | 874 #if defined(OS_WIN) |
860 std::list<HWND> dummy_windows_for_activation_; | 875 std::list<HWND> dummy_windows_for_activation_; |
861 #endif | 876 #endif |
862 | 877 |
863 int64 last_input_number_; | 878 int64 last_input_number_; |
864 | 879 |
| 880 int next_browser_snapshot_id_; |
| 881 typedef std::map<int, |
| 882 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; |
| 883 PendingSnapshotMap pending_browser_snapshots_; |
| 884 |
865 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 885 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
866 }; | 886 }; |
867 | 887 |
868 } // namespace content | 888 } // namespace content |
869 | 889 |
870 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 890 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |