| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 explicit EmbedderWebContentsObserver(GuestViewBase* guest) | 62 explicit EmbedderWebContentsObserver(GuestViewBase* guest) |
| 63 : WebContentsObserver(guest->embedder_web_contents()), | 63 : WebContentsObserver(guest->embedder_web_contents()), |
| 64 destroyed_(false), | 64 destroyed_(false), |
| 65 guest_(guest) { | 65 guest_(guest) { |
| 66 } | 66 } |
| 67 | 67 |
| 68 virtual ~EmbedderWebContentsObserver() { | 68 virtual ~EmbedderWebContentsObserver() { |
| 69 } | 69 } |
| 70 | 70 |
| 71 // WebContentsObserver implementation. | 71 // WebContentsObserver implementation. |
| 72 virtual void WebContentsDestroyed() OVERRIDE { | 72 virtual void WebContentsDestroyed() override { |
| 73 // If the embedder is destroyed then destroy the guest. | 73 // If the embedder is destroyed then destroy the guest. |
| 74 Destroy(); | 74 Destroy(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 virtual void AboutToNavigateRenderView( | 77 virtual void AboutToNavigateRenderView( |
| 78 content::RenderViewHost* render_view_host) OVERRIDE { | 78 content::RenderViewHost* render_view_host) override { |
| 79 // If the embedder navigates then destroy the guest. | 79 // If the embedder navigates then destroy the guest. |
| 80 Destroy(); | 80 Destroy(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE { | 83 virtual void RenderProcessGone(base::TerminationStatus status) override { |
| 84 // If the embedder crashes, then destroy the guest. | 84 // If the embedder crashes, then destroy the guest. |
| 85 Destroy(); | 85 Destroy(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 bool destroyed_; | 89 bool destroyed_; |
| 90 GuestViewBase* guest_; | 90 GuestViewBase* guest_; |
| 91 | 91 |
| 92 void Destroy() { | 92 void Destroy() { |
| 93 if (destroyed_) | 93 if (destroyed_) |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 504 |
| 505 // static | 505 // static |
| 506 void GuestViewBase::RegisterGuestViewTypes() { | 506 void GuestViewBase::RegisterGuestViewTypes() { |
| 507 AppViewGuest::Register(); | 507 AppViewGuest::Register(); |
| 508 ExtensionOptionsGuest::Register(); | 508 ExtensionOptionsGuest::Register(); |
| 509 MimeHandlerViewGuest::Register(); | 509 MimeHandlerViewGuest::Register(); |
| 510 WebViewGuest::Register(); | 510 WebViewGuest::Register(); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace extensions | 513 } // namespace extensions |
| OLD | NEW |