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

Unified Diff: headless/lib/browser/headless_web_contents_impl.cc

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 side-by-side diff with in-line comments
Download patch
Index: headless/lib/browser/headless_web_contents_impl.cc
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
index 36015b66c4cf675fbb05f33f643018e63daddb68..1d0598b6737d3f3483eef8eab71801affb25d5f9 100644
--- a/headless/lib/browser/headless_web_contents_impl.cc
+++ b/headless/lib/browser/headless_web_contents_impl.cc
@@ -173,7 +173,9 @@ std::unique_ptr<HeadlessWebContentsImpl> HeadlessWebContentsImpl::Create(
}
headless_web_contents->mojo_services_ = std::move(builder->mojo_services_);
- headless_web_contents->InitializeScreen(builder->window_size_);
+ headless_web_contents->InitializeScreen(
+ builder->window_size_,
+ builder->browser_context_->options()->screen_size());
if (!headless_web_contents->OpenURL(builder->initial_url_))
return nullptr;
return headless_web_contents;
@@ -191,8 +193,11 @@ HeadlessWebContentsImpl::CreateFromWebContents(
return headless_web_contents;
}
-void HeadlessWebContentsImpl::InitializeScreen(const gfx::Size& initial_size) {
- browser()->PlatformInitializeWebContents(initial_size, this);
+void HeadlessWebContentsImpl::InitializeScreen(
+ const gfx::Size& initial_window_size,
+ const gfx::Size& screen_size) {
+ browser()->PlatformInitializeWebContents(initial_window_size, screen_size,
+ this);
}
HeadlessWebContentsImpl::HeadlessWebContentsImpl(

Powered by Google App Engine
This is Rietveld 408576698