Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: headless/lib/browser/headless_browser_impl_mac.mm

Issue 2896763002: Implement window management devtools commands for headless. (Closed)
Patch Set: nit Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_window_size,
18 const gfx::Size& screen_size,
18 HeadlessWebContentsImpl* web_contents) { 19 HeadlessWebContentsImpl* web_contents) {
19 NSView* web_view = web_contents->web_contents()->GetNativeView(); 20 NSView* web_view = web_contents->web_contents()->GetNativeView();
20 [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; 21 [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
21 22
22 NSRect frame = NSMakeRect(0, 0, initial_size.width(), initial_size.height()); 23 NSRect frame = NSMakeRect(0, 0, initial_window_size.width(),
24 initial_window_size.height());
23 [web_view setFrame:frame]; 25 [web_view setFrame:frame];
24 return; 26 return;
25 } 27 }
26 28
27 } // namespace headless 29 } // namespace headless
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698