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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void WebContentsDestroyed() override { | 68 void WebContentsDestroyed() override { |
69 // If the embedder is destroyed then destroy the guest. | 69 // If the embedder is destroyed then destroy the guest. |
70 Destroy(); | 70 Destroy(); |
71 } | 71 } |
72 | 72 |
73 void DidFinishNavigation( | 73 void DidFinishNavigation( |
74 content::NavigationHandle* navigation_handle) override { | 74 content::NavigationHandle* navigation_handle) override { |
75 // If the embedder navigates to a different page then destroy the guest. | 75 // If the embedder navigates to a different page then destroy the guest. |
76 if (!navigation_handle->IsInMainFrame() || | 76 if (!navigation_handle->IsInMainFrame() || |
77 !navigation_handle->HasCommitted() || | 77 !navigation_handle->HasCommitted() || |
78 navigation_handle->IsSamePage()) { | 78 navigation_handle->IsSameDocument()) { |
79 return; | 79 return; |
80 } | 80 } |
81 | 81 |
82 Destroy(); | 82 Destroy(); |
83 } | 83 } |
84 | 84 |
85 void RenderProcessGone(base::TerminationStatus status) override { | 85 void RenderProcessGone(base::TerminationStatus status) override { |
86 if (destroyed_) | 86 if (destroyed_) |
87 return; | 87 return; |
88 // If the embedder process is destroyed, then destroy the guest. | 88 // If the embedder process is destroyed, then destroy the guest. |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 | 926 |
927 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, | 927 void GuestViewBase::UpdateGuestSize(const gfx::Size& new_size, |
928 bool due_to_auto_resize) { | 928 bool due_to_auto_resize) { |
929 if (due_to_auto_resize) | 929 if (due_to_auto_resize) |
930 GuestSizeChangedDueToAutoSize(guest_size_, new_size); | 930 GuestSizeChangedDueToAutoSize(guest_size_, new_size); |
931 DispatchOnResizeEvent(guest_size_, new_size); | 931 DispatchOnResizeEvent(guest_size_, new_size); |
932 guest_size_ = new_size; | 932 guest_size_ = new_size; |
933 } | 933 } |
934 | 934 |
935 } // namespace guest_view | 935 } // namespace guest_view |
OLD | NEW |