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

Unified Diff: headless/lib/browser/headless_browser_impl_mac.mm

Issue 2712093002: Enable building headless_shell in MAC. This is an initial implementation with a hidden window, rath… (Closed)
Patch Set: revet chrome/BUILD.gn Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/BUILD.gn ('k') | headless/lib/browser/headless_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_browser_impl_mac.mm
diff --git a/headless/lib/browser/headless_browser_impl_mac.mm b/headless/lib/browser/headless_browser_impl_mac.mm
new file mode 100644
index 0000000000000000000000000000000000000000..e1911162d6e0b7e137cff2676e2aa8f73b329e81
--- /dev/null
+++ b/headless/lib/browser/headless_browser_impl_mac.mm
@@ -0,0 +1,27 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "headless/lib/browser/headless_browser_impl.h"
+
+#include "content/public/browser/web_contents.h"
+#include "ui/base/cocoa/base_view.h"
+
+namespace headless {
+
+void HeadlessBrowserImpl::PlatformInitialize() {}
+
+void HeadlessBrowserImpl::PlatformCreateWindow() {}
+
+void HeadlessBrowserImpl::PlatformInitializeWebContents(
+ const gfx::Size& initial_size,
+ content::WebContents* web_contents) {
+ NSView* web_view = web_contents->GetNativeView();
+ [web_view setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+
+ NSRect frame = NSMakeRect(0, 0, initial_size.width(), initial_size.height());
+ [web_view setFrame:frame];
+ return;
+}
+
+} // namespace headless
« no previous file with comments | « headless/BUILD.gn ('k') | headless/lib/browser/headless_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698