Chromium Code Reviews| 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> |
| 11 #include <queue> | 11 #include <queue> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <utility> | |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/callback.h" | 16 #include "base/callback.h" |
| 16 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 19 #include "base/process_util.h" | 20 #include "base/process_util.h" |
| 20 #include "base/string16.h" | 21 #include "base/string16.h" |
| 21 #include "base/time.h" | 22 #include "base/time.h" |
| 22 #include "base/timer.h" | 23 #include "base/timer.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 | 444 |
| 444 int SyntheticScrollMessageInterval() const; | 445 int SyntheticScrollMessageInterval() const; |
| 445 | 446 |
| 446 // Sets whether the overscroll controller should be enabled for this page. | 447 // Sets whether the overscroll controller should be enabled for this page. |
| 447 void SetOverscrollControllerEnabled(bool enabled); | 448 void SetOverscrollControllerEnabled(bool enabled); |
| 448 | 449 |
| 449 // Suppreses future char events until a keydown. See | 450 // Suppreses future char events until a keydown. See |
| 450 // suppress_next_char_events_. | 451 // suppress_next_char_events_. |
| 451 void SuppressNextCharEvents(); | 452 void SuppressNextCharEvents(); |
| 452 | 453 |
| 454 // Grab snapshot from renderer side. This can be used when copying from | |
| 455 // browser side might fail due to buggy drivers or other issues. | |
|
Sam Kerner (Chrome)
2013/03/18 13:49:51
Unless something changed, this should note that co
justinlin
2013/03/18 18:10:01
I mentioned when the backing store is not availabl
| |
| 456 void GetSnapshotFromRenderer( | |
| 457 const gfx::Rect& src_subrect, | |
| 458 const gfx::Size& dst_size, | |
| 459 const base::Callback<void(bool, const SkBitmap&)>& callback); | |
| 460 | |
| 453 protected: | 461 protected: |
| 454 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; | 462 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
| 455 | 463 |
| 456 // Transmits the given input event. This is an internal helper for | 464 // Transmits the given input event. This is an internal helper for |
| 457 // |ForwardInputEvent()| and should not be used directly from elsewhere. | 465 // |ForwardInputEvent()| and should not be used directly from elsewhere. |
| 458 void SendInputEvent(const WebKit::WebInputEvent& input_event, | 466 void SendInputEvent(const WebKit::WebInputEvent& input_event, |
| 459 int event_size, bool is_keyboard_shortcut); | 467 int event_size, bool is_keyboard_shortcut); |
| 460 | 468 |
| 461 // Internal implementation of the public Forward*Event() methods. | 469 // Internal implementation of the public Forward*Event() methods. |
| 462 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 470 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 void OnUnlockMouse(); | 603 void OnUnlockMouse(); |
| 596 void OnShowDisambiguationPopup(const gfx::Rect& rect, | 604 void OnShowDisambiguationPopup(const gfx::Rect& rect, |
| 597 const gfx::Size& size, | 605 const gfx::Size& size, |
| 598 const TransportDIB::Id& id); | 606 const TransportDIB::Id& id); |
| 599 #if defined(OS_WIN) | 607 #if defined(OS_WIN) |
| 600 void OnWindowlessPluginDummyWindowCreated( | 608 void OnWindowlessPluginDummyWindowCreated( |
| 601 gfx::NativeViewId dummy_activation_window); | 609 gfx::NativeViewId dummy_activation_window); |
| 602 void OnWindowlessPluginDummyWindowDestroyed( | 610 void OnWindowlessPluginDummyWindowDestroyed( |
| 603 gfx::NativeViewId dummy_activation_window); | 611 gfx::NativeViewId dummy_activation_window); |
| 604 #endif | 612 #endif |
| 613 void OnSnapshot(bool success, const SkBitmap& bitmap); | |
| 605 | 614 |
| 606 // Called (either immediately or asynchronously) after we're done with our | 615 // Called (either immediately or asynchronously) after we're done with our |
| 607 // BackingStore and can send an ACK to the renderer so it can paint onto it | 616 // BackingStore and can send an ACK to the renderer so it can paint onto it |
| 608 // again. | 617 // again. |
| 609 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, | 618 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, |
| 610 const base::TimeTicks& paint_start); | 619 const base::TimeTicks& paint_start); |
| 611 | 620 |
| 612 // Paints the given bitmap to the current backing store at the given | 621 // Paints the given bitmap to the current backing store at the given |
| 613 // location. Returns true if the passed callback was asynchronously | 622 // location. Returns true if the passed callback was asynchronously |
| 614 // scheduled in the future (and thus the caller must manually synchronously | 623 // scheduled in the future (and thus the caller must manually synchronously |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 850 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > | 859 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > |
| 851 SmoothScrollGestureMap; | 860 SmoothScrollGestureMap; |
| 852 SmoothScrollGestureMap active_smooth_scroll_gestures_; | 861 SmoothScrollGestureMap active_smooth_scroll_gestures_; |
| 853 base::TimeTicks last_smooth_scroll_gestures_tick_time_; | 862 base::TimeTicks last_smooth_scroll_gestures_tick_time_; |
| 854 bool tick_active_smooth_scroll_gestures_task_posted_; | 863 bool tick_active_smooth_scroll_gestures_task_posted_; |
| 855 | 864 |
| 856 scoped_ptr<TouchEventQueue> touch_event_queue_; | 865 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 857 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 866 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 858 scoped_ptr<OverscrollController> overscroll_controller_; | 867 scoped_ptr<OverscrollController> overscroll_controller_; |
| 859 | 868 |
| 869 typedef std::pair<gfx::Size, base::Callback<void(bool, const SkBitmap&)> > | |
| 870 PendingSnapshotInfo; | |
| 871 std::queue<PendingSnapshotInfo> pending_snapshots_; | |
| 872 | |
| 860 #if defined(OS_WIN) | 873 #if defined(OS_WIN) |
| 861 std::list<HWND> dummy_windows_for_activation_; | 874 std::list<HWND> dummy_windows_for_activation_; |
| 862 #endif | 875 #endif |
| 863 | 876 |
| 864 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 877 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 865 }; | 878 }; |
| 866 | 879 |
| 867 } // namespace content | 880 } // namespace content |
| 868 | 881 |
| 869 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 882 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |