mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This CL causes sky/shell to create a blink::WebView to show that sky/shell links with sky/engine. In the process, I've made it easier to be a trivial embedder of sky/engine by removing the requirement to implement blink::ServiceProvider. This CL also causes sky/shell to link with mojo/edk/system to resolve link errors with Mojo fabric (e.g., MojoClose, MojoWriteMessage, etc). To make this work properly, we'll need to initialize the EDK in a future CL. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/873923003
37 lines
880 B
C++
37 lines
880 B
C++
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "sky/shell/ui/engine.h"
|
|
|
|
#include "sky/engine/public/web/Sky.h"
|
|
#include "sky/engine/public/web/WebLocalFrame.h"
|
|
#include "sky/engine/public/web/WebView.h"
|
|
#include "sky/shell/ui/platform_impl.h"
|
|
|
|
namespace sky {
|
|
namespace shell {
|
|
|
|
Engine::Engine() : web_view_(nullptr), weak_factory_(this) {
|
|
}
|
|
|
|
Engine::~Engine() {
|
|
if (web_view_)
|
|
web_view_->close();
|
|
}
|
|
|
|
base::WeakPtr<Engine> Engine::GetWeakPtr() {
|
|
return weak_factory_.GetWeakPtr();
|
|
}
|
|
|
|
void Engine::Init() {
|
|
platform_impl_.reset(new PlatformImpl);
|
|
blink::initialize(platform_impl_.get());
|
|
|
|
web_view_ = blink::WebView::create(this);
|
|
web_view_->setMainFrame(blink::WebLocalFrame::create(this));
|
|
}
|
|
|
|
} // namespace shell
|
|
} // namespace sky
|