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 <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 int surface_id() const { return surface_id_; } | 185 int surface_id() const { return surface_id_; } |
186 | 186 |
187 bool empty() const { return current_size_.IsEmpty(); } | 187 bool empty() const { return current_size_.IsEmpty(); } |
188 | 188 |
189 // Called when a renderer object already been created for this host, and we | 189 // Called when a renderer object already been created for this host, and we |
190 // just need to be attached to it. Used for window.open, <select> dropdown | 190 // just need to be attached to it. Used for window.open, <select> dropdown |
191 // menus, and other times when the renderer initiates creating an object. | 191 // menus, and other times when the renderer initiates creating an object. |
192 virtual void Init(); | 192 virtual void Init(); |
193 | 193 |
194 // Initializes a RenderWidgetHost that is attached to a RenderFrameHost. | |
195 void InitForFrame(); | |
196 | |
197 // Signal whether this RenderWidgetHost is owned by a RenderFrameHost, in | |
198 // which case it does not do self-deletion. | |
199 void set_owned_by_render_frame_host(bool owned_by_rfh) { | |
200 owned_by_render_frame_host_ = owned_by_rfh; | |
201 } | |
202 | |
203 // Called by RenderFrameHost before destroying this object. | |
204 void Cleanup(); | |
205 | |
206 // Tells the renderer to die and then calls Destroy(). | 194 // Tells the renderer to die and then calls Destroy(). |
207 virtual void Shutdown(); | 195 virtual void Shutdown(); |
208 | 196 |
209 // IPC::Listener | 197 // IPC::Listener |
210 bool OnMessageReceived(const IPC::Message& msg) override; | 198 bool OnMessageReceived(const IPC::Message& msg) override; |
211 | 199 |
212 // Sends a message to the corresponding object in the renderer. | 200 // Sends a message to the corresponding object in the renderer. |
213 bool Send(IPC::Message* msg) override; | 201 bool Send(IPC::Message* msg) override; |
214 | 202 |
215 // Indicates if the page has finished loading. | 203 // Indicates if the page has finished loading. |
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 std::list<HWND> dummy_windows_for_activation_; | 821 std::list<HWND> dummy_windows_for_activation_; |
834 #endif | 822 #endif |
835 | 823 |
836 RenderWidgetHostLatencyTracker latency_tracker_; | 824 RenderWidgetHostLatencyTracker latency_tracker_; |
837 | 825 |
838 int next_browser_snapshot_id_; | 826 int next_browser_snapshot_id_; |
839 typedef std::map<int, | 827 typedef std::map<int, |
840 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; | 828 base::Callback<void(const unsigned char*, size_t)> > PendingSnapshotMap; |
841 PendingSnapshotMap pending_browser_snapshots_; | 829 PendingSnapshotMap pending_browser_snapshots_; |
842 | 830 |
843 // Indicates whether a RenderFramehost has ownership, in which case this | |
844 // object does not self destroy. | |
845 bool owned_by_render_frame_host_; | |
846 | |
847 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 831 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
848 | 832 |
849 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 833 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
850 }; | 834 }; |
851 | 835 |
852 } // namespace content | 836 } // namespace content |
853 | 837 |
854 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 838 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |