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

Unified Diff: headless/public/headless_browser.cc

Issue 2199773002: headless: make initial screen/window sizes configurable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix constexpr, reference to screen_size in test. Created 4 years, 4 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/public/headless_browser.h ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/headless_browser.cc
diff --git a/headless/public/headless_browser.cc b/headless/public/headless_browser.cc
index bbc644b231cf9e37499e42661f8708a51aaa6cd8..994df72d2ae7a5f19af072371e532dd930ddb1f2 100644
--- a/headless/public/headless_browser.cc
+++ b/headless/public/headless_browser.cc
@@ -13,6 +13,7 @@ namespace headless {
// Product name for building the default user agent string.
namespace {
const char kProductName[] = "HeadlessChrome";
+constexpr gfx::Size kDefaultWindowSize(800, 600);
}
Options::Options(int argc, const char** argv)
@@ -22,7 +23,8 @@ Options::Options(int argc, const char** argv)
message_pump(nullptr),
single_process_mode(false),
disable_sandbox(false),
- gl_implementation("osmesa") {}
+ gl_implementation("osmesa"),
+ window_size(kDefaultWindowSize) {}
Options::Options(Options&& options) = default;
@@ -81,6 +83,11 @@ Builder& Builder::SetGLImplementation(const std::string& gl_implementation) {
return *this;
}
+Builder& Builder::SetWindowSize(const gfx::Size& window_size) {
+ options_.window_size = window_size;
+ return *this;
+}
+
Options Builder::Build() {
return std::move(options_);
}
« no previous file with comments | « headless/public/headless_browser.h ('k') | headless/public/headless_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698