| 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 is used when CopyFromBackingStore |
| 455 // fails due to the backing store not being available or, in composited mode, |
| 456 // when the accelerated surface is not available to the browser side. |
| 457 void GetSnapshotFromRenderer( |
| 458 const gfx::Rect& src_subrect, |
| 459 const gfx::Size& dst_size, |
| 460 const base::Callback<void(bool, const SkBitmap&)>& callback); |
| 461 |
| 453 protected: | 462 protected: |
| 454 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; | 463 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() OVERRIDE; |
| 455 | 464 |
| 456 // Transmits the given input event. This is an internal helper for | 465 // Transmits the given input event. This is an internal helper for |
| 457 // |ForwardInputEvent()| and should not be used directly from elsewhere. | 466 // |ForwardInputEvent()| and should not be used directly from elsewhere. |
| 458 void SendInputEvent(const WebKit::WebInputEvent& input_event, | 467 void SendInputEvent(const WebKit::WebInputEvent& input_event, |
| 459 int event_size, bool is_keyboard_shortcut); | 468 int event_size, bool is_keyboard_shortcut); |
| 460 | 469 |
| 461 // Internal implementation of the public Forward*Event() methods. | 470 // Internal implementation of the public Forward*Event() methods. |
| 462 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 471 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 void OnUnlockMouse(); | 604 void OnUnlockMouse(); |
| 596 void OnShowDisambiguationPopup(const gfx::Rect& rect, | 605 void OnShowDisambiguationPopup(const gfx::Rect& rect, |
| 597 const gfx::Size& size, | 606 const gfx::Size& size, |
| 598 const TransportDIB::Id& id); | 607 const TransportDIB::Id& id); |
| 599 #if defined(OS_WIN) | 608 #if defined(OS_WIN) |
| 600 void OnWindowlessPluginDummyWindowCreated( | 609 void OnWindowlessPluginDummyWindowCreated( |
| 601 gfx::NativeViewId dummy_activation_window); | 610 gfx::NativeViewId dummy_activation_window); |
| 602 void OnWindowlessPluginDummyWindowDestroyed( | 611 void OnWindowlessPluginDummyWindowDestroyed( |
| 603 gfx::NativeViewId dummy_activation_window); | 612 gfx::NativeViewId dummy_activation_window); |
| 604 #endif | 613 #endif |
| 614 void OnSnapshot(bool success, const SkBitmap& bitmap); |
| 605 | 615 |
| 606 // Called (either immediately or asynchronously) after we're done with our | 616 // 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 | 617 // BackingStore and can send an ACK to the renderer so it can paint onto it |
| 608 // again. | 618 // again. |
| 609 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, | 619 void DidUpdateBackingStore(const ViewHostMsg_UpdateRect_Params& params, |
| 610 const base::TimeTicks& paint_start); | 620 const base::TimeTicks& paint_start); |
| 611 | 621 |
| 612 // Paints the given bitmap to the current backing store at the given | 622 // Paints the given bitmap to the current backing store at the given |
| 613 // location. Returns true if the passed callback was asynchronously | 623 // location. Returns true if the passed callback was asynchronously |
| 614 // scheduled in the future (and thus the caller must manually synchronously | 624 // 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> > | 860 typedef std::map<int, scoped_refptr<SmoothScrollGesture> > |
| 851 SmoothScrollGestureMap; | 861 SmoothScrollGestureMap; |
| 852 SmoothScrollGestureMap active_smooth_scroll_gestures_; | 862 SmoothScrollGestureMap active_smooth_scroll_gestures_; |
| 853 base::TimeTicks last_smooth_scroll_gestures_tick_time_; | 863 base::TimeTicks last_smooth_scroll_gestures_tick_time_; |
| 854 bool tick_active_smooth_scroll_gestures_task_posted_; | 864 bool tick_active_smooth_scroll_gestures_task_posted_; |
| 855 | 865 |
| 856 scoped_ptr<TouchEventQueue> touch_event_queue_; | 866 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 857 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 867 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 858 scoped_ptr<OverscrollController> overscroll_controller_; | 868 scoped_ptr<OverscrollController> overscroll_controller_; |
| 859 | 869 |
| 870 typedef std::pair<gfx::Size, base::Callback<void(bool, const SkBitmap&)> > |
| 871 PendingSnapshotInfo; |
| 872 std::queue<PendingSnapshotInfo> pending_snapshots_; |
| 873 |
| 860 #if defined(OS_WIN) | 874 #if defined(OS_WIN) |
| 861 std::list<HWND> dummy_windows_for_activation_; | 875 std::list<HWND> dummy_windows_for_activation_; |
| 862 #endif | 876 #endif |
| 863 | 877 |
| 864 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 878 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 865 }; | 879 }; |
| 866 | 880 |
| 867 } // namespace content | 881 } // namespace content |
| 868 | 882 |
| 869 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 883 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |