| 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_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 bool GetGpuRenderingStats(GpuRenderingStats*) const; | 174 bool GetGpuRenderingStats(GpuRenderingStats*) const; |
| 175 | 175 |
| 176 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); | 176 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); |
| 177 | 177 |
| 178 // Callback for use with BeginSmoothScroll. | 178 // Callback for use with BeginSmoothScroll. |
| 179 typedef base::Callback<void()> SmoothScrollCompletionCallback; | 179 typedef base::Callback<void()> SmoothScrollCompletionCallback; |
| 180 | 180 |
| 181 // Directs the host to begin a smooth scroll. This scroll should have the same | 181 // Directs the host to begin a smooth scroll. This scroll should have the same |
| 182 // performance characteristics as a user-initiated scroll. Returns an ID of | 182 // performance characteristics as a user-initiated scroll. Returns an ID of |
| 183 // the scroll gesture. | 183 // the scroll gesture. |
| 184 void BeginSmoothScroll(bool scroll_down, | 184 bool BeginSmoothScroll(bool scroll_down, |
| 185 const SmoothScrollCompletionCallback& callback, | 185 const SmoothScrollCompletionCallback& callback, |
| 186 int pixels_to_scroll, | 186 int pixels_to_scroll, |
| 187 int mouse_event_x, | 187 int mouse_event_x, |
| 188 int mouse_event_y); | 188 int mouse_event_y); |
| 189 | 189 |
| 190 // Close the underlying WebWidget. | 190 // Close the underlying WebWidget. |
| 191 virtual void Close(); | 191 virtual void Close(); |
| 192 | 192 |
| 193 // Notifies about a compositor frame commit operation having finished. | 193 // Notifies about a compositor frame commit operation having finished. |
| 194 virtual void DidCommitCompositorFrame(); | 194 virtual void DidCommitCompositorFrame(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 292 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
| 293 int selection_start, | 293 int selection_start, |
| 294 int selection_end); | 294 int selection_end); |
| 295 virtual void OnImeConfirmComposition( | 295 virtual void OnImeConfirmComposition( |
| 296 const string16& text, const ui::Range& replacement_range); | 296 const string16& text, const ui::Range& replacement_range); |
| 297 void OnPaintAtSize(const TransportDIB::Handle& dib_id, | 297 void OnPaintAtSize(const TransportDIB::Handle& dib_id, |
| 298 int tag, | 298 int tag, |
| 299 const gfx::Size& page_size, | 299 const gfx::Size& page_size, |
| 300 const gfx::Size& desired_size); | 300 const gfx::Size& desired_size); |
| 301 void OnRepaint(const gfx::Size& size_to_paint); | 301 void OnRepaint(const gfx::Size& size_to_paint); |
| 302 void OnSmoothScrollCompleted(int gesture_id); | 302 void OnSmoothScrollCompleted(); |
| 303 void OnSetTextDirection(WebKit::WebTextDirection direction); | 303 void OnSetTextDirection(WebKit::WebTextDirection direction); |
| 304 void OnGetFPS(); | 304 void OnGetFPS(); |
| 305 void OnScreenInfoChanged(const WebKit::WebScreenInfo& screen_info); | 305 void OnScreenInfoChanged(const WebKit::WebScreenInfo& screen_info); |
| 306 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, | 306 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
| 307 const gfx::Rect& window_screen_rect); | 307 const gfx::Rect& window_screen_rect); |
| 308 | 308 |
| 309 virtual void SetDeviceScaleFactor(float device_scale_factor); | 309 virtual void SetDeviceScaleFactor(float device_scale_factor); |
| 310 | 310 |
| 311 // Override points to notify derived classes that a paint has happened. | 311 // Override points to notify derived classes that a paint has happened. |
| 312 // WillInitiatePaint happens when we're about to generate a new bitmap and | 312 // WillInitiatePaint happens when we're about to generate a new bitmap and |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 WebKit::WebScreenInfo screen_info_; | 633 WebKit::WebScreenInfo screen_info_; |
| 634 | 634 |
| 635 // The device scale factor. This value is computed from the DPI entries in | 635 // The device scale factor. This value is computed from the DPI entries in |
| 636 // |screen_info_| on some platforms, and defaults to 1 on other platforms. | 636 // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
| 637 float device_scale_factor_; | 637 float device_scale_factor_; |
| 638 | 638 |
| 639 // Specifies whether input event throttling is enabled for this widget. | 639 // Specifies whether input event throttling is enabled for this widget. |
| 640 bool throttle_input_events_; | 640 bool throttle_input_events_; |
| 641 | 641 |
| 642 // State associated with the BeginSmoothScroll synthetic scrolling function. | 642 // State associated with the BeginSmoothScroll synthetic scrolling function. |
| 643 int next_smooth_scroll_gesture_id_; | 643 SmoothScrollCompletionCallback pending_smooth_scroll_gesture_; |
| 644 typedef std::map<int, SmoothScrollCompletionCallback> | |
| 645 PendingSmoothScrollGestureMap; | |
| 646 PendingSmoothScrollGestureMap pending_smooth_scroll_gestures_; | |
| 647 | 644 |
| 648 // Specified whether the compositor will run in its own thread. | 645 // Specified whether the compositor will run in its own thread. |
| 649 bool is_threaded_compositing_enabled_; | 646 bool is_threaded_compositing_enabled_; |
| 650 | 647 |
| 651 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 648 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 652 }; | 649 }; |
| 653 | 650 |
| 654 } // namespace content | 651 } // namespace content |
| 655 | 652 |
| 656 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 653 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |