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

@ -6,6 +6,7 @@
#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 electron {
@ -23,21 +24,21 @@ void TextField::SetText(const base::string16& new_text) {
}
base::string16 TextField::GetText() const {
return text_field()->text();
return text_field()->GetText();
}
// static
gin_helper::WrappableBase* TextField::New(gin_helper::Arguments* args) {
// Constructor call.
auto* view = new TextField();
view->InitWith(args->isolate(), args->GetThis());
view->InitWithArgs(args);
return view;
}
// static
void TextField::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(gin_helper::StringTov8(isolate, "TextField"));
prototype->SetClassName(gin::StringToV8(isolate, "TextField"));
gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("setText", &TextField::SetText)
.SetMethod("getText", &TextField::GetText);