chore: remove unused classes of views API (#22861)

* chore: remove unused views API classes

* chore: remove LayoutManager code

* chore: no more need to make View inherit from TrackabeObject

* chore: make enable_view_api default to true

* chore: enable_view_api => enable_views_api
This commit is contained in:
Cheng Zhao 2020-03-28 15:44:57 +09:00 committed by GitHub
parent d5cae424d8
commit 76ae3b7ecb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 16 additions and 948 deletions

View file

@ -23,12 +23,7 @@ View::~View() {
delete view_;
}
#if BUILDFLAG(ENABLE_VIEW_API)
void View::SetLayoutManager(gin::Handle<LayoutManager> layout_manager) {
layout_manager_.Reset(isolate(), layout_manager->GetWrapper());
view()->SetLayoutManager(layout_manager->TakeOver());
}
#if BUILDFLAG(ENABLE_VIEWS_API)
void View::AddChildView(gin::Handle<View> child) {
AddChildViewAt(child, child_views_.size());
}
@ -53,9 +48,8 @@ gin_helper::WrappableBase* View::New(gin::Arguments* args) {
void View::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype) {
prototype->SetClassName(gin::StringToV8(isolate, "View"));
#if BUILDFLAG(ENABLE_VIEW_API)
#if BUILDFLAG(ENABLE_VIEWS_API)
gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("setLayoutManager", &View::SetLayoutManager)
.SetMethod("addChildView", &View::AddChildView)
.SetMethod("addChildViewAt", &View::AddChildViewAt);
#endif