OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "headless/lib/browser/headless_browser_impl.h" | 5 #include "headless/lib/browser/headless_browser_impl.h" |
6 | 6 |
7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
8 #include "ui/base/cocoa/base_view.h" | 8 #include "ui/base/cocoa/base_view.h" |
9 | 9 |
10 namespace headless { | 10 namespace headless { |
11 | 11 |
12 void HeadlessBrowserImpl::PlatformInitialize() {} | 12 void HeadlessBrowserImpl::PlatformInitialize() {} |
13 | 13 |
14 void HeadlessBrowserImpl::PlatformCreateWindow() {} | 14 void HeadlessBrowserImpl::PlatformCreateWindow() {} |
15 | 15 |
16 void HeadlessBrowserImpl::PlatformInitializeWebContents( | 16 void HeadlessBrowserImpl::PlatformInitializeWebContents( |
17 const gfx::Size& initial_size, | 17 const gfx::Size& initial_size, |
18 content::WebContents* web_contents) { | 18 HeadlessWebContentsImpl* web_contents) { |
19 NSView* web_view = web_contents->GetNativeView(); | 19 NSView* web_view = web_contents->web_contents()->GetNativeView(); |
20 [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; | 20 [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; |
21 | 21 |
22 NSRect frame = NSMakeRect(0, 0, initial_size.width(), initial_size.height()); | 22 NSRect frame = NSMakeRect(0, 0, initial_size.width(), initial_size.height()); |
23 [web_view setFrame:frame]; | 23 [web_view setFrame:frame]; |
24 return; | 24 return; |
25 } | 25 } |
26 | 26 |
27 } // namespace headless | 27 } // namespace headless |
OLD | NEW |