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