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 "components/guest_view/browser/guest_view_base.h" | 5 #include "components/guest_view/browser/guest_view_base.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 593 |
594 // Self-destruct. | 594 // Self-destruct. |
595 delete this; | 595 delete this; |
596 } | 596 } |
597 | 597 |
598 void GuestViewBase::DidNavigateMainFrame( | 598 void GuestViewBase::DidNavigateMainFrame( |
599 const content::LoadCommittedDetails& details, | 599 const content::LoadCommittedDetails& details, |
600 const content::FrameNavigateParams& params) { | 600 const content::FrameNavigateParams& params) { |
601 if (attached() && ZoomPropagatesFromEmbedderToGuest()) | 601 if (attached() && ZoomPropagatesFromEmbedderToGuest()) |
602 SetGuestZoomLevelToMatchEmbedder(); | 602 SetGuestZoomLevelToMatchEmbedder(); |
603 | |
604 // TODO(lazyboy): This breaks guest visibility in --site-per-process because | |
605 // we do not take the widget's visibility into account. We need to also | |
606 // stay hidden during "visibility:none" state. | |
607 if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { | |
608 web_contents()->WasShown(); | |
609 } | |
610 } | 603 } |
611 | 604 |
612 void GuestViewBase::ActivateContents(WebContents* web_contents) { | 605 void GuestViewBase::ActivateContents(WebContents* web_contents) { |
613 if (!attached() || !embedder_web_contents()->GetDelegate()) | 606 if (!attached() || !embedder_web_contents()->GetDelegate()) |
614 return; | 607 return; |
615 | 608 |
616 embedder_web_contents()->GetDelegate()->ActivateContents( | 609 embedder_web_contents()->GetDelegate()->ActivateContents( |
617 embedder_web_contents()); | 610 embedder_web_contents()); |
618 } | 611 } |
619 | 612 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 | 881 |
889 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, | 882 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, |
890 bool due_to_auto_resize) { | 883 bool due_to_auto_resize) { |
891 if (due_to_auto_resize) | 884 if (due_to_auto_resize) |
892 GuestSizeChangedDueToAutoSize(guest_size_, new_size); | 885 GuestSizeChangedDueToAutoSize(guest_size_, new_size); |
893 DispatchOnResizeEvent(guest_size_, new_size); | 886 DispatchOnResizeEvent(guest_size_, new_size); |
894 guest_size_ = new_size; | 887 guest_size_ = new_size; |
895 } | 888 } |
896 | 889 |
897 } // namespace guest_view | 890 } // namespace guest_view |
OLD | NEW |