| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 content::WebContents* web_contents, | 187 content::WebContents* web_contents, |
| 188 HeadlessBrowserContextImpl* browser_context) { | 188 HeadlessBrowserContextImpl* browser_context) { |
| 189 std::unique_ptr<HeadlessWebContentsImpl> headless_web_contents = | 189 std::unique_ptr<HeadlessWebContentsImpl> headless_web_contents = |
| 190 base::WrapUnique( | 190 base::WrapUnique( |
| 191 new HeadlessWebContentsImpl(web_contents, browser_context)); | 191 new HeadlessWebContentsImpl(web_contents, browser_context)); |
| 192 | 192 |
| 193 return headless_web_contents; | 193 return headless_web_contents; |
| 194 } | 194 } |
| 195 | 195 |
| 196 void HeadlessWebContentsImpl::InitializeScreen(const gfx::Size& initial_size) { | 196 void HeadlessWebContentsImpl::InitializeScreen(const gfx::Size& initial_size) { |
| 197 static int window_id = 1; |
| 198 window_id_ = window_id++; |
| 199 window_state_ = "normal"; |
| 197 browser()->PlatformInitializeWebContents(initial_size, this); | 200 browser()->PlatformInitializeWebContents(initial_size, this); |
| 198 } | 201 } |
| 199 | 202 |
| 200 HeadlessWebContentsImpl::HeadlessWebContentsImpl( | 203 HeadlessWebContentsImpl::HeadlessWebContentsImpl( |
| 201 content::WebContents* web_contents, | 204 content::WebContents* web_contents, |
| 202 HeadlessBrowserContextImpl* browser_context) | 205 HeadlessBrowserContextImpl* browser_context) |
| 203 : content::WebContentsObserver(web_contents), | 206 : content::WebContentsObserver(web_contents), |
| 204 web_contents_delegate_( | 207 web_contents_delegate_( |
| 205 new HeadlessWebContentsImpl::Delegate(browser_context)), | 208 new HeadlessWebContentsImpl::Delegate(browser_context)), |
| 206 web_contents_(web_contents), | 209 web_contents_(web_contents), |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 HeadlessWebContents::Builder::MojoService::MojoService() {} | 406 HeadlessWebContents::Builder::MojoService::MojoService() {} |
| 404 | 407 |
| 405 HeadlessWebContents::Builder::MojoService::MojoService( | 408 HeadlessWebContents::Builder::MojoService::MojoService( |
| 406 const std::string& service_name, | 409 const std::string& service_name, |
| 407 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) | 410 const base::Callback<void(mojo::ScopedMessagePipeHandle)>& service_factory) |
| 408 : service_name(service_name), service_factory(service_factory) {} | 411 : service_name(service_name), service_factory(service_factory) {} |
| 409 | 412 |
| 410 HeadlessWebContents::Builder::MojoService::~MojoService() {} | 413 HeadlessWebContents::Builder::MojoService::~MojoService() {} |
| 411 | 414 |
| 412 } // namespace headless | 415 } // namespace headless |
| OLD | NEW |