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

Unified Diff: headless/app/headless_shell.cc

Issue 2642143002: [headless] Make --hide-scrollbars affect all BrowserContexts. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | headless/lib/browser/headless_browser_context_options.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/app/headless_shell.cc
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc
index 047f408a0f4762f35cac78e89c8542603f8bdf71..cd05f9796cec82027c032dfc5a6fdf020d309db9 100644
--- a/headless/app/headless_shell.cc
+++ b/headless/app/headless_shell.cc
@@ -92,13 +92,6 @@ class HeadlessShell : public HeadlessWebContents::Observer,
context_builder.SetProtocolHandlers(std::move(protocol_handlers));
}
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kHideScrollbars)) {
- context_builder.SetOverrideWebPreferencesCallback(
- base::Bind([](WebPreferences* preferences) {
- preferences->hide_scrollbars = true;
- }));
- }
browser_context_ = context_builder.Build();
browser_->SetDefaultBrowserContext(browser_context_);
@@ -518,6 +511,11 @@ int HeadlessShellMain(int argc, const char** argv) {
builder.SetWindowSize(parsed_window_size);
}
+ if (command_line.HasSwitch(switches::kHideScrollbars)) {
+ builder.SetOverrideWebPreferencesCallback(base::Bind([](
+ WebPreferences* preferences) { preferences->hide_scrollbars = true; }));
+ }
+
return HeadlessBrowserMain(
builder.Build(),
base::Bind(&HeadlessShell::OnStart, base::Unretained(&shell)));
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_context_options.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698