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 // A BrowserPluginGuest is the browser side of a browser <--> embedder | 5 // A BrowserPluginGuest is the browser side of a browser <--> embedder |
6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder | 6 // renderer channel. A BrowserPlugin (a WebPlugin) is on the embedder |
7 // renderer side of browser <--> embedder renderer communication. | 7 // renderer side of browser <--> embedder renderer communication. |
8 // | 8 // |
9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a | 9 // BrowserPluginGuest lives on the UI thread of the browser process. It has a |
10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The | 10 // helper, BrowserPluginGuestHelper, which is a RenderViewHostObserver. The |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 public WebContentsDelegate, | 68 public WebContentsDelegate, |
69 public WebContentsObserver { | 69 public WebContentsObserver { |
70 public: | 70 public: |
71 virtual ~BrowserPluginGuest(); | 71 virtual ~BrowserPluginGuest(); |
72 | 72 |
73 static BrowserPluginGuest* Create( | 73 static BrowserPluginGuest* Create( |
74 int instance_id, | 74 int instance_id, |
75 WebContentsImpl* web_contents, | 75 WebContentsImpl* web_contents, |
76 const BrowserPluginHostMsg_CreateGuest_Params& params); | 76 const BrowserPluginHostMsg_CreateGuest_Params& params); |
77 | 77 |
| 78 // Called before destroying guest to allow guest to perform any necessary |
| 79 // clean-up. |
| 80 void Destroy(); |
| 81 |
78 // Overrides factory for testing. Default (NULL) value indicates regular | 82 // Overrides factory for testing. Default (NULL) value indicates regular |
79 // (non-test) environment. | 83 // (non-test) environment. |
80 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { | 84 static void set_factory_for_testing(BrowserPluginHostFactory* factory) { |
81 content::BrowserPluginGuest::factory_ = factory; | 85 content::BrowserPluginGuest::factory_ = factory; |
82 } | 86 } |
83 | 87 |
84 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); | 88 bool OnMessageReceivedFromEmbedder(const IPC::Message& message); |
85 | 89 |
86 void Initialize(const BrowserPluginHostMsg_CreateGuest_Params& params, | 90 void Initialize(const BrowserPluginHostMsg_CreateGuest_Params& params, |
87 content::RenderViewHost* render_view_host); | 91 content::RenderViewHost* render_view_host); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 bool auto_size_enabled_; | 306 bool auto_size_enabled_; |
303 gfx::Size max_auto_size_; | 307 gfx::Size max_auto_size_; |
304 gfx::Size min_auto_size_; | 308 gfx::Size min_auto_size_; |
305 | 309 |
306 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); | 310 DISALLOW_COPY_AND_ASSIGN(BrowserPluginGuest); |
307 }; | 311 }; |
308 | 312 |
309 } // namespace content | 313 } // namespace content |
310 | 314 |
311 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ | 315 #endif // CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_GUEST_H_ |
OLD | NEW |