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

Unified Diff: headless/public/headless_browser.cc

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add pak file generation. Created 4 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
Index: headless/public/headless_browser.cc
diff --git a/headless/public/headless_browser.cc b/headless/public/headless_browser.cc
index cb8a855243a2a1314c7db517e502de2cd4491d57..4a7053669a5203c1063f9afebd42ff504decff99 100644
--- a/headless/public/headless_browser.cc
+++ b/headless/public/headless_browser.cc
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "content/public/common/user_agent.h"
#include "headless/public/headless_browser.h"
+#include "net/url_request/url_request_context_getter.h"
using Options = headless::HeadlessBrowser::Options;
using Builder = headless::HeadlessBrowser::Options::Builder;
@@ -10,7 +12,11 @@ using Builder = headless::HeadlessBrowser::Options::Builder;
namespace headless {
Options::Options(int argc, const char** argv)
- : argc(argc), argv(argv), devtools_http_port(kInvalidPort) {}
+ : argc(argc),
+ argv(argv),
+ user_agent(content::BuildUserAgentFromProduct("HeadlessChrome")),
Ryan Sleevi 2016/02/22 22:01:21 This is the sort of thing that likely belongs as a
Sami 2016/02/23 20:19:08 Yep, done.
+ devtools_http_port(kInvalidPort),
+ message_pump(nullptr) {}
Options::~Options() {}
@@ -34,6 +40,11 @@ Builder& Builder::SetURLRequestContextGetter(
return *this;
}
+Builder& Builder::SetMessagePump(base::MessagePump* message_pump) {
+ options_.message_pump = message_pump;
+ return *this;
+}
+
Options Builder::Build() {
return options_;
}

Powered by Google App Engine
This is Rietveld 408576698