build: fix broken Views build (#22621)

This commit is contained in:
Shelley Vohr 2020-03-10 20:03:41 +00:00 committed by GitHub
parent b607cfa220
commit 97fe4c7718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 16 deletions

View file

@ -9,9 +9,10 @@
#include "shell/browser/api/electron_api_view.h"
#include "shell/common/gin_helper/constructor.h"
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/gin_helper/object_template_builder.h"
#include "shell/common/node_includes.h"
namespace mate {
namespace gin {
template <>
struct Converter<views::BoxLayout::Orientation> {
@ -31,7 +32,7 @@ struct Converter<views::BoxLayout::Orientation> {
}
};
} // namespace mate
} // namespace gin
namespace electron {
@ -52,14 +53,14 @@ gin_helper::WrappableBase* BoxLayout::New(
gin_helper::Arguments* args,
views::BoxLayout::Orientation orientation) {
auto* layout = new BoxLayout(orientation);
layout->InitWith(args->isolate(), args->GetThis());
layout->InitWithArgs(args);
return layout;
}
// static
void BoxLayout::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(gin_helper::StringTov8(isolate, "BoxLayout"));
prototype->SetClassName(gin::StringToV8(isolate, "BoxLayout"));
gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("setFlexForView", &BoxLayout::SetFlexForView);
}