OLD | NEW |
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_web_contents_impl.h" | 5 #include "headless/lib/browser/headless_web_contents_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 content::WebContents* web_contents, | 185 content::WebContents* web_contents, |
186 HeadlessBrowserContextImpl* browser_context) { | 186 HeadlessBrowserContextImpl* browser_context) { |
187 std::unique_ptr<HeadlessWebContentsImpl> headless_web_contents = | 187 std::unique_ptr<HeadlessWebContentsImpl> headless_web_contents = |
188 base::WrapUnique( | 188 base::WrapUnique( |
189 new HeadlessWebContentsImpl(web_contents, browser_context)); | 189 new HeadlessWebContentsImpl(web_contents, browser_context)); |
190 | 190 |
191 return headless_web_contents; | 191 return headless_web_contents; |
192 } | 192 } |
193 | 193 |
194 void HeadlessWebContentsImpl::InitializeScreen(const gfx::Size& initial_size) { | 194 void HeadlessWebContentsImpl::InitializeScreen(const gfx::Size& initial_size) { |
| 195 static int window_id = 1; |
| 196 window_id_ = window_id++; |
| 197 window_state_ = "normal"; |
195 browser()->PlatformInitializeWebContents(initial_size, this); | 198 browser()->PlatformInitializeWebContents(initial_size, this); |
196 } | 199 } |
197 | 200 |
198 HeadlessWebContentsImpl::HeadlessWebContentsImpl( | 201 HeadlessWebContentsImpl::HeadlessWebContentsImpl( |
199 content::WebContents* web_contents, | 202 content::WebContents* web_contents, |
200 HeadlessBrowserContextImpl* browser_context) | 203 HeadlessBrowserContextImpl* browser_context) |
201 : content::WebContentsObserver(web_contents), | 204 : content::WebContentsObserver(web_contents), |
202 web_contents_delegate_( | 205 web_contents_delegate_( |
203 new HeadlessWebContentsImpl::Delegate(browser_context)), | 206 new HeadlessWebContentsImpl::Delegate(browser_context)), |
204 web_contents_(web_contents), | 207 web_contents_(web_contents), |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 HeadlessWebContents::Builder::MojoService::MojoService() {} | 400 HeadlessWebContents::Builder::MojoService::MojoService() {} |
398 | 401 |
399 HeadlessWebContents::Builder::MojoService::MojoService( | 402 HeadlessWebContents::Builder::MojoService::MojoService( |
400 const std::string& service_name, | 403 const std::string& service_name, |
401 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) | 404 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) |
402 : service_name(service_name), service_factory(service_factory) {} | 405 : service_name(service_name), service_factory(service_factory) {} |
403 | 406 |
404 HeadlessWebContents::Builder::MojoService::~MojoService() {} | 407 HeadlessWebContents::Builder::MojoService::~MojoService() {} |
405 | 408 |
406 } // namespace headless | 409 } // namespace headless |
OLD | NEW |