| 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_browser_context_impl.h" | 5 #include "headless/lib/browser/headless_browser_context_impl.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 return *this; | 382 return *this; |
| 383 } | 383 } |
| 384 | 384 |
| 385 HeadlessBrowserContext::Builder& | 385 HeadlessBrowserContext::Builder& |
| 386 HeadlessBrowserContext::Builder::SetIncognitoMode(bool incognito_mode) { | 386 HeadlessBrowserContext::Builder::SetIncognitoMode(bool incognito_mode) { |
| 387 options_->incognito_mode_ = incognito_mode; | 387 options_->incognito_mode_ = incognito_mode; |
| 388 return *this; | 388 return *this; |
| 389 } | 389 } |
| 390 | 390 |
| 391 HeadlessBrowserContext::Builder& | 391 HeadlessBrowserContext::Builder& |
| 392 HeadlessBrowserContext::Builder::AddJsMojoBindings( | |
| 393 const std::string& mojom_name, | |
| 394 const std::string& js_bindings) { | |
| 395 mojo_bindings_.emplace_back(mojom_name, js_bindings); | |
| 396 return *this; | |
| 397 } | |
| 398 | |
| 399 HeadlessBrowserContext::Builder& | |
| 400 HeadlessBrowserContext::Builder::AddTabSocketMojoBindings() { | 392 HeadlessBrowserContext::Builder::AddTabSocketMojoBindings() { |
| 401 std::string js_bindings = | 393 std::string js_bindings = |
| 402 ui::ResourceBundle::GetSharedInstance() | 394 ui::ResourceBundle::GetSharedInstance() |
| 403 .GetRawDataResource(IDR_HEADLESS_TAB_SOCKET_MOJOM_JS) | 395 .GetRawDataResource(IDR_HEADLESS_TAB_SOCKET_MOJOM_JS) |
| 404 .as_string(); | 396 .as_string(); |
| 405 mojo_bindings_.emplace_back("headless/lib/tab_socket.mojom", js_bindings); | 397 mojo_bindings_.emplace_back("headless/lib/tab_socket.mojom", js_bindings); |
| 406 return *this; | 398 return *this; |
| 407 } | 399 } |
| 408 | 400 |
| 409 HeadlessBrowserContext::Builder& | 401 HeadlessBrowserContext::Builder& |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings() {} | 443 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings() {} |
| 452 | 444 |
| 453 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings( | 445 HeadlessBrowserContext::Builder::MojoBindings::MojoBindings( |
| 454 const std::string& mojom_name, | 446 const std::string& mojom_name, |
| 455 const std::string& js_bindings) | 447 const std::string& js_bindings) |
| 456 : mojom_name(mojom_name), js_bindings(js_bindings) {} | 448 : mojom_name(mojom_name), js_bindings(js_bindings) {} |
| 457 | 449 |
| 458 HeadlessBrowserContext::Builder::MojoBindings::~MojoBindings() {} | 450 HeadlessBrowserContext::Builder::MojoBindings::~MojoBindings() {} |
| 459 | 451 |
| 460 } // namespace headless | 452 } // namespace headless |
| OLD | NEW |