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

Side by Side Diff: headless/lib/browser/headless_browser_impl.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 unified diff | Download patch
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_main_parts.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "headless/lib/browser/headless_browser_impl.h" 5 #include "headless/lib/browser/headless_browser_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 void HeadlessBrowserImpl::set_browser_main_parts( 122 void HeadlessBrowserImpl::set_browser_main_parts(
123 HeadlessBrowserMainParts* browser_main_parts) { 123 HeadlessBrowserMainParts* browser_main_parts) {
124 DCHECK(!browser_main_parts_); 124 DCHECK(!browser_main_parts_);
125 browser_main_parts_ = browser_main_parts; 125 browser_main_parts_ = browser_main_parts;
126 } 126 }
127 127
128 void HeadlessBrowserImpl::RunOnStartCallback() { 128 void HeadlessBrowserImpl::RunOnStartCallback() {
129 DCHECK(aura::Env::GetInstance()); 129 DCHECK(aura::Env::GetInstance());
130 // TODO(eseckler): allow configuration of window (viewport) size by embedder.
131 const gfx::Size kDefaultSize(800, 600);
132 window_tree_host_.reset( 130 window_tree_host_.reset(
133 aura::WindowTreeHost::Create(gfx::Rect(kDefaultSize))); 131 aura::WindowTreeHost::Create(gfx::Rect(options()->window_size)));
134 window_tree_host_->InitHost(); 132 window_tree_host_->InitHost();
135 133
136 window_tree_client_.reset( 134 window_tree_client_.reset(
137 new HeadlessWindowTreeClient(window_tree_host_->window())); 135 new HeadlessWindowTreeClient(window_tree_host_->window()));
138 136
139 on_start_callback_.Run(this); 137 on_start_callback_.Run(this);
140 on_start_callback_ = base::Callback<void(HeadlessBrowser*)>(); 138 on_start_callback_ = base::Callback<void(HeadlessBrowser*)>();
141 } 139 }
142 140
143 HeadlessWebContentsImpl* HeadlessBrowserImpl::RegisterWebContents( 141 HeadlessWebContentsImpl* HeadlessBrowserImpl::RegisterWebContents(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 191
194 // Child processes should not end up here. 192 // Child processes should not end up here.
195 base::CommandLine command_line(options.argc, options.argv); 193 base::CommandLine command_line(options.argc, options.argv);
196 DCHECK(!command_line.HasSwitch(switches::kProcessType)); 194 DCHECK(!command_line.HasSwitch(switches::kProcessType));
197 #endif 195 #endif
198 return RunContentMain(std::move(options), 196 return RunContentMain(std::move(options),
199 std::move(on_browser_start_callback)); 197 std::move(on_browser_start_callback));
200 } 198 }
201 199
202 } // namespace headless 200 } // namespace headless
OLDNEW
« no previous file with comments | « no previous file | headless/lib/browser/headless_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698