| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/web_contents/web_contents_view_child_frame.h" | 5 #include "content/browser/web_contents/web_contents_view_child_frame.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 8 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
| 9 #include "content/browser/web_contents/web_contents_impl.h" | 9 #include "content/browser/web_contents/web_contents_impl.h" |
| 10 #include "content/public/browser/web_contents_view_delegate.h" | 10 #include "content/public/browser/web_contents_view_delegate.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 gfx::NativeView WebContentsViewChildFrame::GetContentNativeView() const { | 42 gfx::NativeView WebContentsViewChildFrame::GetContentNativeView() const { |
| 43 return GetOuterView()->GetContentNativeView(); | 43 return GetOuterView()->GetContentNativeView(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 gfx::NativeWindow WebContentsViewChildFrame::GetTopLevelNativeWindow() const { | 46 gfx::NativeWindow WebContentsViewChildFrame::GetTopLevelNativeWindow() const { |
| 47 return GetOuterView()->GetTopLevelNativeWindow(); | 47 return GetOuterView()->GetTopLevelNativeWindow(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void WebContentsViewChildFrame::GetScreenInfo( |
| 51 blink::WebScreenInfo* web_screen_info) const { |
| 52 // TODO(wjmaclean): falling back to the default screen info is not what used |
| 53 // to happen in RenderWidgetHostViewChildFrame, but it seems like the right |
| 54 // thing to do. We should keep an eye on this in case the else-clause below |
| 55 // causes problems. |
| 56 if (web_contents_->GetOuterWebContents()) |
| 57 GetOuterView()->GetScreenInfo(web_screen_info); |
| 58 else |
| 59 WebContentsView::GetDefaultScreenInfo(web_screen_info); |
| 60 } |
| 61 |
| 50 void WebContentsViewChildFrame::GetContainerBounds(gfx::Rect* out) const { | 62 void WebContentsViewChildFrame::GetContainerBounds(gfx::Rect* out) const { |
| 51 RenderWidgetHostView* view = web_contents_->GetRenderWidgetHostView(); | 63 RenderWidgetHostView* view = web_contents_->GetRenderWidgetHostView(); |
| 52 if (view) | 64 if (view) |
| 53 *out = view->GetViewBounds(); | 65 *out = view->GetViewBounds(); |
| 54 else | 66 else |
| 55 *out = gfx::Rect(); | 67 *out = gfx::Rect(); |
| 56 } | 68 } |
| 57 | 69 |
| 58 void WebContentsViewChildFrame::SizeContents(const gfx::Size& size) { | 70 void WebContentsViewChildFrame::SizeContents(const gfx::Size& size) { |
| 59 // The RenderWidgetHostViewChildFrame is responsible for sizing the contents. | 71 // The RenderWidgetHostViewChildFrame is responsible for sizing the contents. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void WebContentsViewChildFrame::StartDragging( | 166 void WebContentsViewChildFrame::StartDragging( |
| 155 const DropData& drop_data, | 167 const DropData& drop_data, |
| 156 WebDragOperationsMask ops, | 168 WebDragOperationsMask ops, |
| 157 const gfx::ImageSkia& image, | 169 const gfx::ImageSkia& image, |
| 158 const gfx::Vector2d& image_offset, | 170 const gfx::Vector2d& image_offset, |
| 159 const DragEventSourceInfo& event_info) { | 171 const DragEventSourceInfo& event_info) { |
| 160 NOTREACHED(); | 172 NOTREACHED(); |
| 161 } | 173 } |
| 162 | 174 |
| 163 } // namespace content | 175 } // namespace content |
| OLD | NEW |