OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
26 #include "ui/base/ime/text_input_type.h" | 26 #include "ui/base/ime/text_input_type.h" |
27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
28 #include "ui/gfx/rect.h" | 28 #include "ui/gfx/rect.h" |
29 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
30 #include "ui/gfx/surface/transport_dib.h" | 30 #include "ui/gfx/surface/transport_dib.h" |
31 | 31 |
32 class BackingStore; | 32 class BackingStore; |
33 struct EditCommand; | 33 struct EditCommand; |
34 class RenderProcessHost; | |
35 class RenderWidgetHostView; | 34 class RenderWidgetHostView; |
36 class TransportDIB; | 35 class TransportDIB; |
37 struct ViewHostMsg_UpdateRect_Params; | 36 struct ViewHostMsg_UpdateRect_Params; |
38 class WebCursor; | 37 class WebCursor; |
39 | 38 |
40 namespace base { | 39 namespace base { |
41 class TimeTicks; | 40 class TimeTicks; |
42 } | 41 } |
43 | 42 |
| 43 namespace content { |
| 44 class RenderProcessHost; |
| 45 } |
| 46 |
44 namespace gfx { | 47 namespace gfx { |
45 class Rect; | 48 class Rect; |
46 } | 49 } |
47 | 50 |
48 namespace ui { | 51 namespace ui { |
49 class Range; | 52 class Range; |
50 } | 53 } |
51 | 54 |
52 namespace WebKit { | 55 namespace WebKit { |
53 class WebInputEvent; | 56 class WebInputEvent; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK notification. | 140 // RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK notification. |
138 struct PaintAtSizeAckDetails { | 141 struct PaintAtSizeAckDetails { |
139 // The tag that was passed to the PaintAtSize() call that triggered this | 142 // The tag that was passed to the PaintAtSize() call that triggered this |
140 // ack. | 143 // ack. |
141 int tag; | 144 int tag; |
142 gfx::Size size; | 145 gfx::Size size; |
143 }; | 146 }; |
144 | 147 |
145 // routing_id can be MSG_ROUTING_NONE, in which case the next available | 148 // routing_id can be MSG_ROUTING_NONE, in which case the next available |
146 // routing id is taken from the RenderProcessHost. | 149 // routing id is taken from the RenderProcessHost. |
147 RenderWidgetHost(RenderProcessHost* process, int routing_id); | 150 RenderWidgetHost(content::RenderProcessHost* process, int routing_id); |
148 virtual ~RenderWidgetHost(); | 151 virtual ~RenderWidgetHost(); |
149 | 152 |
150 // Gets/Sets the View of this RenderWidgetHost. Can be NULL, e.g. if the | 153 // Gets/Sets the View of this RenderWidgetHost. Can be NULL, e.g. if the |
151 // RenderWidget is being destroyed or the render process crashed. You should | 154 // RenderWidget is being destroyed or the render process crashed. You should |
152 // never cache this pointer since it can become NULL if the renderer crashes, | 155 // never cache this pointer since it can become NULL if the renderer crashes, |
153 // instead you should always ask for it using the accessor. | 156 // instead you should always ask for it using the accessor. |
154 void SetView(RenderWidgetHostView* view); | 157 void SetView(RenderWidgetHostView* view); |
155 RenderWidgetHostView* view() const { return view_; } | 158 RenderWidgetHostView* view() const { return view_; } |
156 | 159 |
157 RenderProcessHost* process() const { return process_; } | 160 content::RenderProcessHost* process() const { return process_; } |
158 int routing_id() const { return routing_id_; } | 161 int routing_id() const { return routing_id_; } |
159 bool renderer_accessible() { return renderer_accessible_; } | 162 bool renderer_accessible() { return renderer_accessible_; } |
160 | 163 |
161 bool empty() const { return current_size_.IsEmpty(); } | 164 bool empty() const { return current_size_.IsEmpty(); } |
162 | 165 |
163 // Returns the property bag for this widget, where callers can add extra data | 166 // Returns the property bag for this widget, where callers can add extra data |
164 // they may wish to associate with it. Returns a pointer rather than a | 167 // they may wish to associate with it. Returns a pointer rather than a |
165 // reference since the PropertyAccessors expect this. | 168 // reference since the PropertyAccessors expect this. |
166 const PropertyBag* property_bag() const { return &property_bag_; } | 169 const PropertyBag* property_bag() const { return &property_bag_; } |
167 PropertyBag* property_bag() { return &property_bag_; } | 170 PropertyBag* property_bag() { return &property_bag_; } |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 // The View associated with the RenderViewHost. The lifetime of this object | 616 // The View associated with the RenderViewHost. The lifetime of this object |
614 // is associated with the lifetime of the Render process. If the Renderer | 617 // is associated with the lifetime of the Render process. If the Renderer |
615 // crashes, its View is destroyed and this pointer becomes NULL, even though | 618 // crashes, its View is destroyed and this pointer becomes NULL, even though |
616 // render_view_host_ lives on to load another URL (creating a new View while | 619 // render_view_host_ lives on to load another URL (creating a new View while |
617 // doing so). | 620 // doing so). |
618 RenderWidgetHostView* view_; | 621 RenderWidgetHostView* view_; |
619 | 622 |
620 // Created during construction but initialized during Init*(). Therefore, it | 623 // Created during construction but initialized during Init*(). Therefore, it |
621 // is guaranteed never to be NULL, but its channel may be NULL if the | 624 // is guaranteed never to be NULL, but its channel may be NULL if the |
622 // renderer crashed, so you must always check that. | 625 // renderer crashed, so you must always check that. |
623 RenderProcessHost* process_; | 626 content::RenderProcessHost* process_; |
624 | 627 |
625 // Stores random bits of data for others to associate with this object. | 628 // Stores random bits of data for others to associate with this object. |
626 PropertyBag property_bag_; | 629 PropertyBag property_bag_; |
627 | 630 |
628 // The ID of the corresponding object in the Renderer Instance. | 631 // The ID of the corresponding object in the Renderer Instance. |
629 int routing_id_; | 632 int routing_id_; |
630 | 633 |
631 // Indicates whether a page is loading or not. | 634 // Indicates whether a page is loading or not. |
632 bool is_loading_; | 635 bool is_loading_; |
633 | 636 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 gfx::Point last_scroll_offset_; | 772 gfx::Point last_scroll_offset_; |
770 | 773 |
771 bool pending_mouse_lock_request_; | 774 bool pending_mouse_lock_request_; |
772 | 775 |
773 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; | 776 base::WeakPtrFactory<RenderWidgetHost> weak_factory_; |
774 | 777 |
775 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 778 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
776 }; | 779 }; |
777 | 780 |
778 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 781 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |