| 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 "content/browser/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return; | 117 return; |
| 118 // Make sure the size of this view matches the size of the WebContentsView. | 118 // Make sure the size of this view matches the size of the WebContentsView. |
| 119 // The two sizes may fall out of sync if we switch RenderWidgetHostViews, | 119 // The two sizes may fall out of sync if we switch RenderWidgetHostViews, |
| 120 // resize, and then switch page, as is the case with interstitial pages. | 120 // resize, and then switch page, as is the case with interstitial pages. |
| 121 // NOTE: |guest_| is NULL in unit tests. | 121 // NOTE: |guest_| is NULL in unit tests. |
| 122 if (guest_) { | 122 if (guest_) { |
| 123 SetSize(guest_->web_contents()->GetViewBounds().size()); | 123 SetSize(guest_->web_contents()->GetViewBounds().size()); |
| 124 // Since we were last shown, our renderer may have had a different surface | 124 // Since we were last shown, our renderer may have had a different surface |
| 125 // set (e.g. showing an interstitial), so we resend our current surface to | 125 // set (e.g. showing an interstitial), so we resend our current surface to |
| 126 // the renderer. | 126 // the renderer. |
| 127 if (local_frame_id_.is_valid()) | 127 if (local_surface_id_.is_valid()) |
| 128 SendSurfaceInfoToEmbedder(); | 128 SendSurfaceInfoToEmbedder(); |
| 129 } | 129 } |
| 130 host_->WasShown(ui::LatencyInfo()); | 130 host_->WasShown(ui::LatencyInfo()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void RenderWidgetHostViewGuest::Hide() { | 133 void RenderWidgetHostViewGuest::Hide() { |
| 134 // |guest_| is NULL during test. | 134 // |guest_| is NULL during test. |
| 135 if ((guest_ && guest_->is_in_destruction()) || host_->is_hidden()) | 135 if ((guest_ && guest_->is_in_destruction()) || host_->is_hidden()) |
| 136 return; | 136 return; |
| 137 host_->WasHidden(); | 137 host_->WasHidden(); |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 gesture_event.data.scrollUpdate.inertialPhase == | 647 gesture_event.data.scrollUpdate.inertialPhase == |
| 648 blink::WebGestureEvent::MomentumPhase) { | 648 blink::WebGestureEvent::MomentumPhase) { |
| 649 return; | 649 return; |
| 650 } | 650 } |
| 651 host_->ForwardGestureEvent(gesture_event); | 651 host_->ForwardGestureEvent(gesture_event); |
| 652 return; | 652 return; |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 | 655 |
| 656 } // namespace content | 656 } // namespace content |
| OLD | NEW |