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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 virtual void RemoveKeyPressEventCallback( | 170 virtual void RemoveKeyPressEventCallback( |
171 const KeyPressEventCallback& callback) OVERRIDE; | 171 const KeyPressEventCallback& callback) OVERRIDE; |
172 virtual void AddMouseEventCallback( | 172 virtual void AddMouseEventCallback( |
173 const MouseEventCallback& callback) OVERRIDE; | 173 const MouseEventCallback& callback) OVERRIDE; |
174 virtual void RemoveMouseEventCallback( | 174 virtual void RemoveMouseEventCallback( |
175 const MouseEventCallback& callback) OVERRIDE; | 175 const MouseEventCallback& callback) OVERRIDE; |
176 virtual void GetWebScreenInfo(blink::WebScreenInfo* result) OVERRIDE; | 176 virtual void GetWebScreenInfo(blink::WebScreenInfo* result) OVERRIDE; |
177 virtual void GetSnapshotFromRenderer( | 177 virtual void GetSnapshotFromRenderer( |
178 const gfx::Rect& src_subrect, | 178 const gfx::Rect& src_subrect, |
179 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; | 179 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; |
| 180 virtual void GetSnapshotFromBrowser( |
| 181 const base::Callback< |
| 182 void(const unsigned char*,size_t)> callback) OVERRIDE; |
180 | 183 |
181 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; | 184 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const; |
182 | 185 |
183 // Notification that the screen info has changed. | 186 // Notification that the screen info has changed. |
184 void NotifyScreenInfoChanged(); | 187 void NotifyScreenInfoChanged(); |
185 | 188 |
186 // Invalidates the cached screen info so that next resize request | 189 // Invalidates the cached screen info so that next resize request |
187 // will carry the up to date screen info. Unlike | 190 // will carry the up to date screen info. Unlike |
188 // |NotifyScreenInfoChanged|, this doesn't send a message to the renderer. | 191 // |NotifyScreenInfoChanged|, this doesn't send a message to the renderer. |
189 void InvalidateScreenInfo(); | 192 void InvalidateScreenInfo(); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 // Returns the ID that uniquely describes this component to the latency | 545 // Returns the ID that uniquely describes this component to the latency |
543 // subsystem. | 546 // subsystem. |
544 int64 GetLatencyComponentId(); | 547 int64 GetLatencyComponentId(); |
545 | 548 |
546 static void CompositorFrameDrawn( | 549 static void CompositorFrameDrawn( |
547 const std::vector<ui::LatencyInfo>& latency_info); | 550 const std::vector<ui::LatencyInfo>& latency_info); |
548 | 551 |
549 // Don't check whether we expected a resize ack during layout tests. | 552 // Don't check whether we expected a resize ack during layout tests. |
550 static void DisableResizeAckCheckForTesting(); | 553 static void DisableResizeAckCheckForTesting(); |
551 | 554 |
| 555 // TODO(kaznacheev): Remove this method when GpuBenchmarking V8 extension is |
| 556 // retired. |
552 void WindowSnapshotAsyncCallback( | 557 void WindowSnapshotAsyncCallback( |
553 int routing_id, | 558 int routing_id, |
554 int snapshot_id, | 559 int snapshot_id, |
555 gfx::Size snapshot_size, | 560 gfx::Size snapshot_size, |
556 scoped_refptr<base::RefCountedBytes> png_data); | 561 scoped_refptr<base::RefCountedBytes> png_data); |
557 | 562 |
558 // LatencyComponents generated in the renderer must have component IDs | 563 // LatencyComponents generated in the renderer must have component IDs |
559 // provided to them by the browser process. This function adds the correct | 564 // provided to them by the browser process. This function adds the correct |
560 // component ID where necessary. | 565 // component ID where necessary. |
561 void AddLatencyInfoComponentIds(ui::LatencyInfo* latency_info); | 566 void AddLatencyInfoComponentIds(ui::LatencyInfo* latency_info); |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 758 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
754 InputEventAckState ack_result) OVERRIDE; | 759 InputEventAckState ack_result) OVERRIDE; |
755 virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) OVERRIDE; | 760 virtual void OnUnexpectedEventAck(UnexpectedEventAckType type) OVERRIDE; |
756 | 761 |
757 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); | 762 void OnSyntheticGestureCompleted(SyntheticGesture::Result result); |
758 | 763 |
759 // Called when there is a new auto resize (using a post to avoid a stack | 764 // Called when there is a new auto resize (using a post to avoid a stack |
760 // which may get in recursive loops). | 765 // which may get in recursive loops). |
761 void DelayedAutoResized(); | 766 void DelayedAutoResized(); |
762 | 767 |
| 768 // TODO(kaznacheev): Remove this method when GpuBenchmarking V8 extension is |
| 769 // retired. |
| 770 void WindowSnapshotReachedScreenUnsafe(int snapshot_id); |
| 771 |
763 void WindowSnapshotReachedScreen(int snapshot_id); | 772 void WindowSnapshotReachedScreen(int snapshot_id); |
764 | 773 |
| 774 void OnSnapshotDataReceived(int snapshot_id, |
| 775 const unsigned char* png, |
| 776 size_t size); |
| 777 |
| 778 void OnSnapshotDataReceivedAsync( |
| 779 int snapshot_id, |
| 780 scoped_refptr<base::RefCountedBytes> png_data); |
| 781 |
765 // Send a message to the renderer process to change the accessibility mode. | 782 // Send a message to the renderer process to change the accessibility mode. |
766 void SetAccessibilityMode(AccessibilityMode AccessibilityMode); | 783 void SetAccessibilityMode(AccessibilityMode AccessibilityMode); |
767 | 784 |
768 // Our delegate, which wants to know mainly about keyboard events. | 785 // Our delegate, which wants to know mainly about keyboard events. |
769 // It will remain non-NULL until DetachDelegate() is called. | 786 // It will remain non-NULL until DetachDelegate() is called. |
770 RenderWidgetHostDelegate* delegate_; | 787 RenderWidgetHostDelegate* delegate_; |
771 | 788 |
772 // Created during construction but initialized during Init*(). Therefore, it | 789 // Created during construction but initialized during Init*(). Therefore, it |
773 // is guaranteed never to be NULL, but its channel may be NULL if the | 790 // is guaranteed never to be NULL, but its channel may be NULL if the |
774 // renderer crashed, so you must always check that. | 791 // renderer crashed, so you must always check that. |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 | 949 |
933 #if defined(OS_WIN) | 950 #if defined(OS_WIN) |
934 std::list<HWND> dummy_windows_for_activation_; | 951 std::list<HWND> dummy_windows_for_activation_; |
935 #endif | 952 #endif |
936 | 953 |
937 // List of callbacks for pending snapshot requests to the renderer. | 954 // List of callbacks for pending snapshot requests to the renderer. |
938 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; | 955 std::queue<base::Callback<void(bool, const SkBitmap&)> > pending_snapshots_; |
939 | 956 |
940 int64 last_input_number_; | 957 int64 last_input_number_; |
941 | 958 |
| 959 int next_browser_snapshot_id_; |
| 960 typedef std::map<int, |
| 961 base::Callback<void(const unsigned char*, size_t)>> PendingSnapshotMap; |
| 962 PendingSnapshotMap pending_browser_snapshots_; |
| 963 |
942 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 964 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
943 }; | 965 }; |
944 | 966 |
945 } // namespace content | 967 } // namespace content |
946 | 968 |
947 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 969 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |