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

Unified Diff: headless/lib/browser/headless_web_contents_impl.cc

Issue 2669693002: Minimize headless code that refers to aura. (Closed)
Patch Set: Remove GetTopWindowContainingPoint Created 3 years, 10 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 | « headless/lib/browser/headless_web_contents_impl.h ('k') | headless/lib/browser/headless_window_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/browser/headless_web_contents_impl.cc
diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
index 094979fa542b9c04ba0132e7c86be578332a3c01..6320a12f45ea585bc693fe7c3b6a64059b505bee 100644
--- a/headless/lib/browser/headless_web_contents_impl.cc
+++ b/headless/lib/browser/headless_web_contents_impl.cc
@@ -21,7 +21,6 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/bindings_policy.h"
@@ -31,7 +30,6 @@
#include "headless/lib/browser/headless_browser_main_parts.h"
#include "headless/lib/browser/headless_devtools_client_impl.h"
#include "services/service_manager/public/cpp/interface_registry.h"
-#include "ui/aura/window.h"
namespace headless {
@@ -106,8 +104,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
// static
std::unique_ptr<HeadlessWebContentsImpl> HeadlessWebContentsImpl::Create(
- HeadlessWebContents::Builder* builder,
- aura::Window* parent_window) {
+ HeadlessWebContents::Builder* builder) {
content::WebContents::CreateParams create_params(builder->browser_context_,
nullptr);
create_params.initial_size = builder->window_size_;
@@ -118,7 +115,7 @@ std::unique_ptr<HeadlessWebContentsImpl> HeadlessWebContentsImpl::Create(
builder->browser_context_));
headless_web_contents->mojo_services_ = std::move(builder->mojo_services_);
- headless_web_contents->InitializeScreen(parent_window, builder->window_size_);
+ headless_web_contents->InitializeScreen(builder->window_size_);
if (!headless_web_contents->OpenURL(builder->initial_url_))
return nullptr;
return headless_web_contents;
@@ -136,18 +133,8 @@ HeadlessWebContentsImpl::CreateFromWebContents(
return headless_web_contents;
}
-void HeadlessWebContentsImpl::InitializeScreen(aura::Window* parent_window,
- const gfx::Size& initial_size) {
- aura::Window* contents = web_contents_->GetNativeView();
- DCHECK(!parent_window->Contains(contents));
- parent_window->AddChild(contents);
- contents->Show();
-
- contents->SetBounds(gfx::Rect(initial_size));
- content::RenderWidgetHostView* host_view =
- web_contents_->GetRenderWidgetHostView();
- if (host_view)
- host_view->SetSize(initial_size);
+void HeadlessWebContentsImpl::InitializeScreen(const gfx::Size& initial_size) {
+ browser()->PlatformSetWebContents(initial_size, web_contents_.get());
}
HeadlessWebContentsImpl::HeadlessWebContentsImpl(
« no previous file with comments | « headless/lib/browser/headless_web_contents_impl.h ('k') | headless/lib/browser/headless_window_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698