Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 Destroy(); | 84 Destroy(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 bool destroyed_; | 88 bool destroyed_; |
| 89 GuestViewBase* guest_; | 89 GuestViewBase* guest_; |
| 90 | 90 |
| 91 void Destroy() { | 91 void Destroy() { |
| 92 if (destroyed_) | 92 if (destroyed_) |
| 93 return; | 93 return; |
| 94 guest_->EmbedderWillBeDestroyed(); | |
| 95 | |
| 94 destroyed_ = true; | 96 destroyed_ = true; |
| 95 guest_->embedder_web_contents_ = NULL; | 97 guest_->embedder_web_contents_ = NULL; |
|
Fady Samuel
2014/10/22 21:20:53
Super nit: move guest_->EmbedderWillBeDestroyed()
guohui
2014/10/23 13:40:52
Done.
| |
| 96 guest_->EmbedderDestroyed(); | |
| 97 guest_->Destroy(); | 98 guest_->Destroy(); |
| 98 } | 99 } |
| 99 | 100 |
| 100 DISALLOW_COPY_AND_ASSIGN(EmbedderLifetimeObserver); | 101 DISALLOW_COPY_AND_ASSIGN(EmbedderLifetimeObserver); |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 GuestViewBase::GuestViewBase(content::BrowserContext* browser_context, | 104 GuestViewBase::GuestViewBase(content::BrowserContext* browser_context, |
| 104 int guest_instance_id) | 105 int guest_instance_id) |
| 105 : embedder_web_contents_(NULL), | 106 : embedder_web_contents_(NULL), |
| 106 embedder_render_process_id_(0), | 107 embedder_render_process_id_(0), |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 493 | 494 |
| 494 // static | 495 // static |
| 495 void GuestViewBase::RegisterGuestViewTypes() { | 496 void GuestViewBase::RegisterGuestViewTypes() { |
| 496 AppViewGuest::Register(); | 497 AppViewGuest::Register(); |
| 497 ExtensionOptionsGuest::Register(); | 498 ExtensionOptionsGuest::Register(); |
| 498 MimeHandlerViewGuest::Register(); | 499 MimeHandlerViewGuest::Register(); |
| 499 WebViewGuest::Register(); | 500 WebViewGuest::Register(); |
| 500 } | 501 } |
| 501 | 502 |
| 502 } // namespace extensions | 503 } // namespace extensions |
| OLD | NEW |