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