| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "extensions/browser/guest_view/guest_view_base.h" | 5 #include "extensions/browser/guest_view/guest_view_base.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 ~EmbedderLifetimeObserver() override {} | 68 ~EmbedderLifetimeObserver() override {} |
| 69 | 69 |
| 70 // WebContentsObserver implementation. | 70 // WebContentsObserver implementation. |
| 71 void WebContentsDestroyed() override { | 71 void WebContentsDestroyed() override { |
| 72 // If the embedder is destroyed then destroy the guest. | 72 // If the embedder is destroyed then destroy the guest. |
| 73 Destroy(); | 73 Destroy(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void AboutToNavigateRenderView( | 76 void AboutToNavigateRenderView( |
| 77 content::RenderViewHost* render_view_host) override { | 77 content::RenderViewHost* render_view_host) override { |
| 78 if (destroyed_) |
| 79 return; |
| 80 |
| 81 guest_->WillDetachFromEmbedder(); |
| 78 // If the embedder navigates then destroy the guest. | 82 // If the embedder navigates then destroy the guest. |
| 79 Destroy(); | 83 Destroy(); |
| 80 } | 84 } |
| 81 | 85 |
| 82 void RenderProcessGone(base::TerminationStatus status) override { | 86 void RenderProcessGone(base::TerminationStatus status) override { |
| 83 // If the embedder crashes, then destroy the guest. | 87 // If the embedder crashes, then destroy the guest. |
| 84 Destroy(); | 88 Destroy(); |
| 85 } | 89 } |
| 86 | 90 |
| 87 private: | 91 private: |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 497 |
| 494 // static | 498 // static |
| 495 void GuestViewBase::RegisterGuestViewTypes() { | 499 void GuestViewBase::RegisterGuestViewTypes() { |
| 496 AppViewGuest::Register(); | 500 AppViewGuest::Register(); |
| 497 ExtensionOptionsGuest::Register(); | 501 ExtensionOptionsGuest::Register(); |
| 498 MimeHandlerViewGuest::Register(); | 502 MimeHandlerViewGuest::Register(); |
| 499 WebViewGuest::Register(); | 503 WebViewGuest::Register(); |
| 500 } | 504 } |
| 501 | 505 |
| 502 } // namespace extensions | 506 } // namespace extensions |
| OLD | NEW |