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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
17 #include "cc/debug/rendering_stats_instrumentation.h" | 17 #include "cc/debug/rendering_stats_instrumentation.h" |
18 #include "content/common/browser_rendering_stats.h" | 18 #include "content/common/browser_rendering_stats.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 20 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
21 #include "content/common/input/synthetic_gesture_params.h" | 21 #include "content/common/input/synthetic_gesture_params.h" |
22 #include "content/renderer/paint_aggregator.h" | 22 #include "content/renderer/paint_aggregator.h" |
23 #include "ipc/ipc_listener.h" | 23 #include "ipc/ipc_listener.h" |
24 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
25 #include "third_party/WebKit/public/platform/WebRect.h" | 25 #include "third_party/WebKit/public/platform/WebRect.h" |
26 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 26 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
27 #include "third_party/WebKit/public/web/WebPopupType.h" | 27 #include "third_party/WebKit/public/web/WebPopupType.h" |
28 #include "third_party/WebKit/public/web/WebTextDirection.h" | 28 #include "third_party/WebKit/public/web/WebTextDirection.h" |
29 #include "third_party/WebKit/public/web/WebTextInputInfo.h" | 29 #include "third_party/WebKit/public/web/WebTextInputInfo.h" |
| 30 #include "third_party/WebKit/public/web/WebTouchAction.h" |
30 #include "third_party/WebKit/public/web/WebWidget.h" | 31 #include "third_party/WebKit/public/web/WebWidget.h" |
31 #include "third_party/WebKit/public/web/WebWidgetClient.h" | 32 #include "third_party/WebKit/public/web/WebWidgetClient.h" |
32 #include "third_party/skia/include/core/SkBitmap.h" | 33 #include "third_party/skia/include/core/SkBitmap.h" |
33 #include "ui/base/ime/text_input_mode.h" | 34 #include "ui/base/ime/text_input_mode.h" |
34 #include "ui/base/ime/text_input_type.h" | 35 #include "ui/base/ime/text_input_type.h" |
35 #include "ui/gfx/native_widget_types.h" | 36 #include "ui/gfx/native_widget_types.h" |
36 #include "ui/gfx/range/range.h" | 37 #include "ui/gfx/range/range.h" |
37 #include "ui/gfx/rect.h" | 38 #include "ui/gfx/rect.h" |
38 #include "ui/gfx/vector2d.h" | 39 #include "ui/gfx/vector2d.h" |
39 #include "ui/gfx/vector2d_f.h" | 40 #include "ui/gfx/vector2d_f.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // just handled. | 530 // just handled. |
530 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {} | 531 virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {} |
531 | 532 |
532 // Check whether the WebWidget has any touch event handlers registered | 533 // Check whether the WebWidget has any touch event handlers registered |
533 // at the given point. | 534 // at the given point. |
534 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; | 535 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; |
535 | 536 |
536 // Check whether the WebWidget has any touch event handlers registered. | 537 // Check whether the WebWidget has any touch event handlers registered. |
537 virtual void hasTouchEventHandlers(bool has_handlers); | 538 virtual void hasTouchEventHandlers(bool has_handlers); |
538 | 539 |
| 540 // Tell the browser about the actions permitted for a new touch point. |
| 541 virtual void setTouchAction(blink::WebTouchAction touch_action); |
| 542 |
539 // Creates a 3D context associated with this view. | 543 // Creates a 3D context associated with this view. |
540 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( | 544 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( |
541 const blink::WebGraphicsContext3D::Attributes& attributes); | 545 const blink::WebGraphicsContext3D::Attributes& attributes); |
542 | 546 |
543 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); | 547 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); |
544 | 548 |
545 // Routing ID that allows us to communicate to the parent browser process | 549 // Routing ID that allows us to communicate to the parent browser process |
546 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. | 550 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
547 int32 routing_id_; | 551 int32 routing_id_; |
548 | 552 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 | 645 |
642 // Indicates whether we have been focused/unfocused by the browser. | 646 // Indicates whether we have been focused/unfocused by the browser. |
643 bool has_focus_; | 647 bool has_focus_; |
644 | 648 |
645 // Are we currently handling an input event? | 649 // Are we currently handling an input event? |
646 bool handling_input_event_; | 650 bool handling_input_event_; |
647 | 651 |
648 // Are we currently handling an ime event? | 652 // Are we currently handling an ime event? |
649 bool handling_ime_event_; | 653 bool handling_ime_event_; |
650 | 654 |
| 655 // Are we currently handling a touchstart event? |
| 656 bool handling_touchstart_event_; |
| 657 |
651 // True if we have requested this widget be closed. No more messages will | 658 // True if we have requested this widget be closed. No more messages will |
652 // be sent, except for a Close. | 659 // be sent, except for a Close. |
653 bool closing_; | 660 bool closing_; |
654 | 661 |
655 // Whether this RenderWidget is currently swapped out, such that the view is | 662 // Whether this RenderWidget is currently swapped out, such that the view is |
656 // being rendered by another process. If all RenderWidgets in a process are | 663 // being rendered by another process. If all RenderWidgets in a process are |
657 // swapped out, the process can exit. | 664 // swapped out, the process can exit. |
658 bool is_swapped_out_; | 665 bool is_swapped_out_; |
659 | 666 |
660 // Indicates if an input method is active in the browser process. | 667 // Indicates if an input method is active in the browser process. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 float popup_origin_scale_for_emulation_; | 789 float popup_origin_scale_for_emulation_; |
783 | 790 |
784 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; | 791 scoped_ptr<ResizingModeSelector> resizing_mode_selector_; |
785 | 792 |
786 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 793 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
787 }; | 794 }; |
788 | 795 |
789 } // namespace content | 796 } // namespace content |
790 | 797 |
791 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 798 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |