Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 | 126 |
| 127 // Unlocks the mouse if the mouse is locked. | 127 // Unlocks the mouse if the mouse is locked. |
| 128 void UnlockMouse(); | 128 void UnlockMouse(); |
| 129 | 129 |
| 130 // Returns the parent RenderWidgetHostView or nullptr it it doesn't have one. | 130 // Returns the parent RenderWidgetHostView or nullptr it it doesn't have one. |
| 131 virtual RenderWidgetHostViewBase* GetParentRenderWidgetHostView(); | 131 virtual RenderWidgetHostViewBase* GetParentRenderWidgetHostView(); |
| 132 | 132 |
| 133 // Returns the view for the top-level frame under the same WebContents. | 133 // Returns the view for the top-level frame under the same WebContents. |
| 134 RenderWidgetHostViewBase* GetRootRenderWidgetHostView(); | 134 RenderWidgetHostViewBase* GetRootRenderWidgetHostView(); |
| 135 | 135 |
| 136 gfx::Rect viewport_intersection() const { | |
|
dcheng
2017/05/30 19:54:11
Nit: consider returning a const ref to avoid a cop
kenrb
2017/05/30 21:19:20
Done.
| |
| 137 return viewport_intersection_rect_; | |
| 138 } | |
| 139 | |
| 136 // Exposed for tests. | 140 // Exposed for tests. |
| 137 RenderWidgetHostViewBase* GetRootRenderWidgetHostViewForTesting() { | 141 RenderWidgetHostViewBase* GetRootRenderWidgetHostViewForTesting() { |
| 138 return GetRootRenderWidgetHostView(); | 142 return GetRootRenderWidgetHostView(); |
| 139 } | 143 } |
| 140 | 144 |
| 141 private: | 145 private: |
| 146 friend class MockCrossProcessFrameConnector; | |
| 147 | |
| 142 // Handlers for messages received from the parent frame. | 148 // Handlers for messages received from the parent frame. |
| 143 void OnFrameRectChanged(const gfx::Rect& frame_rect); | 149 void OnFrameRectChanged(const gfx::Rect& frame_rect); |
| 144 void OnUpdateViewportIntersection(const gfx::Rect& viewport_intersection); | 150 void OnUpdateViewportIntersection(const gfx::Rect& viewport_intersection); |
| 145 void OnVisibilityChanged(bool visible); | 151 void OnVisibilityChanged(bool visible); |
| 146 void OnSatisfySequence(const cc::SurfaceSequence& sequence); | 152 void OnSatisfySequence(const cc::SurfaceSequence& sequence); |
| 147 void OnRequireSequence(const cc::SurfaceId& id, | 153 void OnRequireSequence(const cc::SurfaceId& id, |
| 148 const cc::SurfaceSequence& sequence); | 154 const cc::SurfaceSequence& sequence); |
| 149 | 155 |
| 150 void SetRect(const gfx::Rect& frame_rect); | 156 void SetRect(const gfx::Rect& frame_rect); |
| 151 | 157 |
| 152 // The RenderFrameProxyHost that routes messages to the parent frame's | 158 // The RenderFrameProxyHost that routes messages to the parent frame's |
| 153 // renderer process. | 159 // renderer process. |
| 154 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; | 160 RenderFrameProxyHost* frame_proxy_in_parent_renderer_; |
| 155 | 161 |
| 156 // The RenderWidgetHostView for the frame. Initially NULL. | 162 // The RenderWidgetHostView for the frame. Initially NULL. |
| 157 RenderWidgetHostViewChildFrame* view_; | 163 RenderWidgetHostViewChildFrame* view_; |
| 158 | 164 |
| 159 gfx::Rect child_frame_rect_; | 165 gfx::Rect child_frame_rect_; |
| 166 gfx::Rect viewport_intersection_rect_; | |
| 160 | 167 |
| 161 bool is_scroll_bubbling_; | 168 bool is_scroll_bubbling_; |
| 162 }; | 169 }; |
| 163 | 170 |
| 164 } // namespace content | 171 } // namespace content |
| 165 | 172 |
| 166 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ | 173 #endif // CONTENT_BROWSER_FRAME_HOST_CROSS_PROCESS_FRAME_CONNECTOR_H_ |
| 167 | 174 |
| OLD | NEW |