| 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 "components/ui/zoom/zoom_controller.h" | 9 #include "components/ui/zoom/zoom_controller.h" |
| 10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 void GuestViewBase::DidAttach(int guest_proxy_routing_id) { | 317 void GuestViewBase::DidAttach(int guest_proxy_routing_id) { |
| 318 opener_lifetime_observer_.reset(); | 318 opener_lifetime_observer_.reset(); |
| 319 | 319 |
| 320 // Give the derived class an opportunity to perform some actions. | 320 // Give the derived class an opportunity to perform some actions. |
| 321 DidAttachToEmbedder(); | 321 DidAttachToEmbedder(); |
| 322 | 322 |
| 323 // Inform the associated GuestViewContainer that the contentWindow is ready. | 323 // Inform the associated GuestViewContainer that the contentWindow is ready. |
| 324 embedder_web_contents()->Send(new ExtensionMsg_GuestAttached( | 324 embedder_web_contents()->Send(new ExtensionMsg_GuestAttached( |
| 325 embedder_web_contents()->GetMainFrame()->GetRoutingID(), | |
| 326 element_instance_id_, | 325 element_instance_id_, |
| 327 guest_proxy_routing_id)); | 326 guest_proxy_routing_id)); |
| 328 | 327 |
| 329 SendQueuedEvents(); | 328 SendQueuedEvents(); |
| 330 } | 329 } |
| 331 | 330 |
| 332 void GuestViewBase::DidDetach() { | 331 void GuestViewBase::DidDetach() { |
| 333 GuestViewManager::FromBrowserContext(browser_context_)->DetachGuest( | 332 GuestViewManager::FromBrowserContext(browser_context_)->DetachGuest( |
| 334 this, element_instance_id_); | 333 this, element_instance_id_); |
| 335 StopTrackingEmbedderZoomLevel(); | 334 StopTrackingEmbedderZoomLevel(); |
| 336 owner_web_contents()->Send(new ExtensionMsg_GuestDetached( | 335 owner_web_contents()->Send(new ExtensionMsg_GuestDetached( |
| 337 owner_web_contents()->GetMainFrame()->GetRoutingID(), | |
| 338 element_instance_id_)); | 336 element_instance_id_)); |
| 339 element_instance_id_ = guestview::kInstanceIDNone; | 337 element_instance_id_ = guestview::kInstanceIDNone; |
| 340 } | 338 } |
| 341 | 339 |
| 342 void GuestViewBase::ElementSizeChanged(const gfx::Size& old_size, | 340 void GuestViewBase::ElementSizeChanged(const gfx::Size& old_size, |
| 343 const gfx::Size& new_size) { | 341 const gfx::Size& new_size) { |
| 344 element_size_ = new_size; | 342 element_size_ = new_size; |
| 345 } | 343 } |
| 346 | 344 |
| 347 WebContents* GuestViewBase::GetOwnerWebContents() const { | 345 WebContents* GuestViewBase::GetOwnerWebContents() const { |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // static | 587 // static |
| 590 void GuestViewBase::RegisterGuestViewTypes() { | 588 void GuestViewBase::RegisterGuestViewTypes() { |
| 591 AppViewGuest::Register(); | 589 AppViewGuest::Register(); |
| 592 ExtensionOptionsGuest::Register(); | 590 ExtensionOptionsGuest::Register(); |
| 593 MimeHandlerViewGuest::Register(); | 591 MimeHandlerViewGuest::Register(); |
| 594 WebViewGuest::Register(); | 592 WebViewGuest::Register(); |
| 595 WorkerFrameGuest::Register(); | 593 WorkerFrameGuest::Register(); |
| 596 } | 594 } |
| 597 | 595 |
| 598 } // namespace extensions | 596 } // namespace extensions |
| OLD | NEW |