Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: content/renderer/browser_plugin/browser_plugin.cc

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Fixed formatting Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/browser_plugin/browser_plugin.cc
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 3364c60142ebfe6bd019f6457b46883996a85b04..678e87e8e0230aee2fdd1c76701d48084c5c9be1 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -269,9 +269,20 @@ void BrowserPlugin::Attach(int guest_instance_id,
scoped_ptr<base::DictionaryValue> extra_params) {
CHECK(guest_instance_id != browser_plugin::kInstanceIDNone);
- // If this BrowserPlugin is already attached to a guest, then do nothing.
- if (HasGuestInstanceID())
- return;
+ // If this BrowserPlugin is already attached to a guest, then kill the guest.
+ if (HasGuestInstanceID()) {
+ if (guest_instance_id == guest_instance_id_)
+ return;
+ guest_crashed_ = false;
+ EnableCompositing(false);
+ if (compositing_helper_) {
+ compositing_helper_->OnContainerDestroy();
+ compositing_helper_ = NULL;
+ }
+ browser_plugin_manager()->RemoveBrowserPlugin(guest_instance_id_);
+ browser_plugin_manager()->Send(new BrowserPluginHostMsg_PluginDestroyed(
+ render_view_routing_id_, guest_instance_id_));
+ }
// This API may be called directly without setting the src attribute.
// In that case, we need to make sure we don't allocate another instance ID.
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | extensions/browser/api/app_runtime/app_runtime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698