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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
17 #include "base/property_bag.h" | |
18 #include "base/string16.h" | 17 #include "base/string16.h" |
19 #include "base/timer.h" | 18 #include "base/timer.h" |
20 #include "build/build_config.h" | 19 #include "build/build_config.h" |
21 #include "content/common/view_message_enums.h" | 20 #include "content/common/view_message_enums.h" |
22 #include "content/public/browser/render_widget_host.h" | 21 #include "content/public/browser/render_widget_host.h" |
23 #include "content/public/common/page_zoom.h" | 22 #include "content/public/common/page_zoom.h" |
24 #include "ui/base/ime/text_input_type.h" | 23 #include "ui/base/ime/text_input_type.h" |
25 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
26 | 25 |
27 class MockRenderWidgetHost; | 26 class MockRenderWidgetHost; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // Notification that the screen info has changed. | 123 // Notification that the screen info has changed. |
125 virtual void NotifyScreenInfoChanged(); | 124 virtual void NotifyScreenInfoChanged(); |
126 | 125 |
127 // Sets the View of this RenderWidgetHost. | 126 // Sets the View of this RenderWidgetHost. |
128 void SetView(RenderWidgetHostView* view); | 127 void SetView(RenderWidgetHostView* view); |
129 | 128 |
130 int surface_id() const { return surface_id_; } | 129 int surface_id() const { return surface_id_; } |
131 | 130 |
132 bool empty() const { return current_size_.IsEmpty(); } | 131 bool empty() const { return current_size_.IsEmpty(); } |
133 | 132 |
134 // Returns the property bag for this widget, where callers can add extra data | |
135 // they may wish to associate with it. Returns a pointer rather than a | |
136 // reference since the PropertyAccessors expect this. | |
137 const base::PropertyBag* property_bag() const { return &property_bag_; } | |
138 base::PropertyBag* property_bag() { return &property_bag_; } | |
139 | |
140 // Called when a renderer object already been created for this host, and we | 133 // Called when a renderer object already been created for this host, and we |
141 // just need to be attached to it. Used for window.open, <select> dropdown | 134 // just need to be attached to it. Used for window.open, <select> dropdown |
142 // menus, and other times when the renderer initiates creating an object. | 135 // menus, and other times when the renderer initiates creating an object. |
143 void Init(); | 136 void Init(); |
144 | 137 |
145 // Tells the renderer to die and then calls Destroy(). | 138 // Tells the renderer to die and then calls Destroy(). |
146 virtual void Shutdown(); | 139 virtual void Shutdown(); |
147 | 140 |
148 // IPC::Listener | 141 // IPC::Listener |
149 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 142 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 RenderWidgetHostDelegate* delegate_; | 607 RenderWidgetHostDelegate* delegate_; |
615 | 608 |
616 // Created during construction but initialized during Init*(). Therefore, it | 609 // Created during construction but initialized during Init*(). Therefore, it |
617 // is guaranteed never to be NULL, but its channel may be NULL if the | 610 // is guaranteed never to be NULL, but its channel may be NULL if the |
618 // renderer crashed, so you must always check that. | 611 // renderer crashed, so you must always check that. |
619 RenderProcessHost* process_; | 612 RenderProcessHost* process_; |
620 | 613 |
621 // The ID of the corresponding object in the Renderer Instance. | 614 // The ID of the corresponding object in the Renderer Instance. |
622 int routing_id_; | 615 int routing_id_; |
623 | 616 |
624 // Stores random bits of data for others to associate with this object. | |
625 base::PropertyBag property_bag_; | |
626 | |
627 // The ID of the surface corresponding to this render widget. | 617 // The ID of the surface corresponding to this render widget. |
628 int surface_id_; | 618 int surface_id_; |
629 | 619 |
630 // Indicates whether a page is loading or not. | 620 // Indicates whether a page is loading or not. |
631 bool is_loading_; | 621 bool is_loading_; |
632 | 622 |
633 // Indicates whether a page is hidden or not. | 623 // Indicates whether a page is hidden or not. |
634 bool is_hidden_; | 624 bool is_hidden_; |
635 | 625 |
636 // Indicates whether a page is fullscreen or not. | 626 // Indicates whether a page is fullscreen or not. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 scoped_ptr<SmoothScrollGesture> active_smooth_scroll_gesture_; | 780 scoped_ptr<SmoothScrollGesture> active_smooth_scroll_gesture_; |
791 | 781 |
792 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 782 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
793 | 783 |
794 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 784 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
795 }; | 785 }; |
796 | 786 |
797 } // namespace content | 787 } // namespace content |
798 | 788 |
799 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 789 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |