build: fix broken Views build (#22621)
This commit is contained in:
parent
b607cfa220
commit
97fe4c7718
6 changed files with 20 additions and 16 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ gin_helper::WrappableBase* Button::New(gin_helper::Arguments* args) {
|
|||
// static
|
||||
void Button::BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype) {
|
||||
prototype->SetClassName(gin_helper::StringTov8(isolate, "Button"));
|
||||
prototype->SetClassName(gin::StringToV8(isolate, "Button"));
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include "base/strings/utf_string_conversions.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 electron {
|
||||
|
@ -29,7 +30,7 @@ void LabelButton::SetText(const base::string16& text) {
|
|||
}
|
||||
|
||||
bool LabelButton::IsDefault() const {
|
||||
return label_button()->is_default();
|
||||
return label_button()->GetIsDefault();
|
||||
}
|
||||
|
||||
void LabelButton::SetIsDefault(bool is_default) {
|
||||
|
@ -41,14 +42,14 @@ gin_helper::WrappableBase* LabelButton::New(gin_helper::Arguments* args,
|
|||
const std::string& text) {
|
||||
// Constructor call.
|
||||
auto* view = new LabelButton(text);
|
||||
view->InitWith(args->isolate(), args->GetThis());
|
||||
view->InitWithArgs(args);
|
||||
return view;
|
||||
}
|
||||
|
||||
// static
|
||||
void LabelButton::BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype) {
|
||||
prototype->SetClassName(gin_helper::StringTov8(isolate, "LabelButton"));
|
||||
prototype->SetClassName(gin::StringToV8(isolate, "LabelButton"));
|
||||
gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
|
||||
.SetMethod("getText", &LabelButton::GetText)
|
||||
.SetMethod("setText", &LabelButton::SetText)
|
||||
|
|
|
@ -14,7 +14,8 @@ namespace electron {
|
|||
namespace api {
|
||||
|
||||
MdTextButton::MdTextButton(const std::string& text)
|
||||
: LabelButton(views::MdTextButton::Create(this, base::UTF8ToUTF16(text))) {}
|
||||
: LabelButton(
|
||||
views::MdTextButton::Create(this, base::UTF8ToUTF16(text)).get()) {}
|
||||
|
||||
MdTextButton::~MdTextButton() {}
|
||||
|
||||
|
@ -23,14 +24,14 @@ gin_helper::WrappableBase* MdTextButton::New(gin_helper::Arguments* args,
|
|||
const std::string& text) {
|
||||
// Constructor call.
|
||||
auto* view = new MdTextButton(text);
|
||||
view->InitWith(args->isolate(), args->GetThis());
|
||||
view->InitWithArgs(args);
|
||||
return view;
|
||||
}
|
||||
|
||||
// static
|
||||
void MdTextButton::BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype) {
|
||||
prototype->SetClassName(gin_helper::StringTov8(isolate, "MdTextButton"));
|
||||
prototype->SetClassName(gin::StringToV8(isolate, "MdTextButton"));
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
|
@ -26,14 +26,14 @@ void ResizeArea::OnResize(int resize_amount, bool done_resizing) {
|
|||
gin_helper::WrappableBase* ResizeArea::New(gin_helper::Arguments* args) {
|
||||
// Constructor call.
|
||||
auto* view = new ResizeArea();
|
||||
view->InitWith(args->isolate(), args->GetThis());
|
||||
view->InitWithArgs(args);
|
||||
return view;
|
||||
}
|
||||
|
||||
// static
|
||||
void ResizeArea::BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype) {
|
||||
prototype->SetClassName(gin_helper::StringTov8(isolate, "ResizeArea"));
|
||||
prototype->SetClassName(gin::StringToV8(isolate, "ResizeArea"));
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue