flutter_flutter/shell/common/null_platform_view.cc
Alexander Aprelev 6bacf4522e
This adds RPC call to set asset path. (#4323)
* This adds rpc call to simply set asset path.

This is needed when doing hot reload to pick up updated assets.

* Move asset_directory fetch for after view_id. Clean up return. Fix formatting.

* Add SetAssetBundlePath methods implementations for mac and ios

* Fix mac mm

* Fix formatting

* Merge and use nullptr
2018-01-04 09:48:01 -08:00

38 lines
1.1 KiB
C++

// Copyright 2017 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 "flutter/shell/common/null_platform_view.h"
#include "flutter/shell/common/null_rasterizer.h"
#include "flutter/shell/common/shell.h"
namespace shell {
NullPlatformView::NullPlatformView()
: PlatformView(std::make_unique<NullRasterizer>()), weak_factory_(this) {}
void NullPlatformView::Attach() {
CreateEngine();
}
NullPlatformView::~NullPlatformView() = default;
fxl::WeakPtr<NullPlatformView> NullPlatformView::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
bool NullPlatformView::ResourceContextMakeCurrent() {
return false;
}
// Hot-reload of the null platform view is not supported.
void NullPlatformView::RunFromSource(const std::string& assets_directory,
const std::string& main,
const std::string& packages) {}
void NullPlatformView::SetAssetBundlePath(const std::string& assets_directory) {
}
} // namespace shell