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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); | 174 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); |
175 | 175 |
176 // Callback for use with BeginSmoothScroll. | 176 // Callback for use with BeginSmoothScroll. |
177 typedef base::Callback<void()> SmoothScrollCompletionCallback; | 177 typedef base::Callback<void()> SmoothScrollCompletionCallback; |
178 | 178 |
179 // Directs the host to begin a smooth scroll. This scroll should have the same | 179 // Directs the host to begin a smooth scroll. This scroll should have the same |
180 // performance characteristics as a user-initiated scroll. Returns an ID of | 180 // performance characteristics as a user-initiated scroll. Returns an ID of |
181 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be | 181 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be |
182 // in local DIP coordinates. | 182 // in local DIP coordinates. |
183 void BeginSmoothScroll(bool scroll_down, | 183 bool BeginSmoothScroll(bool scroll_down, |
184 const SmoothScrollCompletionCallback& callback, | 184 const SmoothScrollCompletionCallback& callback, |
185 int pixels_to_scroll, | 185 int pixels_to_scroll, |
186 int mouse_event_x, | 186 int mouse_event_x, |
187 int mouse_event_y); | 187 int mouse_event_y); |
188 | 188 |
189 // Close the underlying WebWidget. | 189 // Close the underlying WebWidget. |
190 virtual void Close(); | 190 virtual void Close(); |
191 | 191 |
192 // Notifies about a compositor frame commit operation having finished. | 192 // Notifies about a compositor frame commit operation having finished. |
193 virtual void DidCommitCompositorFrame(); | 193 virtual void DidCommitCompositorFrame(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 const std::vector<WebKit::WebCompositionUnderline>& underlines, | 302 const std::vector<WebKit::WebCompositionUnderline>& underlines, |
303 int selection_start, | 303 int selection_start, |
304 int selection_end); | 304 int selection_end); |
305 virtual void OnImeConfirmComposition( | 305 virtual void OnImeConfirmComposition( |
306 const string16& text, const ui::Range& replacement_range); | 306 const string16& text, const ui::Range& replacement_range); |
307 void OnPaintAtSize(const TransportDIB::Handle& dib_id, | 307 void OnPaintAtSize(const TransportDIB::Handle& dib_id, |
308 int tag, | 308 int tag, |
309 const gfx::Size& page_size, | 309 const gfx::Size& page_size, |
310 const gfx::Size& desired_size); | 310 const gfx::Size& desired_size); |
311 void OnRepaint(const gfx::Size& size_to_paint); | 311 void OnRepaint(const gfx::Size& size_to_paint); |
312 void OnSmoothScrollCompleted(int gesture_id); | 312 void OnSmoothScrollCompleted(); |
313 void OnSetTextDirection(WebKit::WebTextDirection direction); | 313 void OnSetTextDirection(WebKit::WebTextDirection direction); |
314 void OnGetFPS(); | 314 void OnGetFPS(); |
315 void OnScreenInfoChanged(const WebKit::WebScreenInfo& screen_info); | 315 void OnScreenInfoChanged(const WebKit::WebScreenInfo& screen_info); |
316 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, | 316 void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, |
317 const gfx::Rect& window_screen_rect); | 317 const gfx::Rect& window_screen_rect); |
318 #if defined(OS_ANDROID) | 318 #if defined(OS_ANDROID) |
319 void OnImeBatchStateChanged(bool is_begin); | 319 void OnImeBatchStateChanged(bool is_begin); |
320 void OnShowImeIfNeeded(); | 320 void OnShowImeIfNeeded(); |
321 #endif | 321 #endif |
322 void OnSnapshot(const gfx::Rect& src_subrect); | 322 void OnSnapshot(const gfx::Rect& src_subrect); |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 WebKit::WebScreenInfo screen_info_; | 673 WebKit::WebScreenInfo screen_info_; |
674 | 674 |
675 // The device scale factor. This value is computed from the DPI entries in | 675 // The device scale factor. This value is computed from the DPI entries in |
676 // |screen_info_| on some platforms, and defaults to 1 on other platforms. | 676 // |screen_info_| on some platforms, and defaults to 1 on other platforms. |
677 float device_scale_factor_; | 677 float device_scale_factor_; |
678 | 678 |
679 // Specifies whether input event throttling is enabled for this widget. | 679 // Specifies whether input event throttling is enabled for this widget. |
680 bool throttle_input_events_; | 680 bool throttle_input_events_; |
681 | 681 |
682 // State associated with the BeginSmoothScroll synthetic scrolling function. | 682 // State associated with the BeginSmoothScroll synthetic scrolling function. |
683 int next_smooth_scroll_gesture_id_; | 683 SmoothScrollCompletionCallback pending_smooth_scroll_gesture_; |
684 typedef std::map<int, SmoothScrollCompletionCallback> | |
685 PendingSmoothScrollGestureMap; | |
686 PendingSmoothScrollGestureMap pending_smooth_scroll_gestures_; | |
687 | 684 |
688 // Specified whether the compositor will run in its own thread. | 685 // Specified whether the compositor will run in its own thread. |
689 bool is_threaded_compositing_enabled_; | 686 bool is_threaded_compositing_enabled_; |
690 | 687 |
691 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; | 688 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; |
692 | 689 |
693 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 690 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
694 }; | 691 }; |
695 | 692 |
696 } // namespace content | 693 } // namespace content |
697 | 694 |
698 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 695 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |