fix: don't expose view APIs when not enabled (#14312)

This commit is contained in:
Milan Burda 2018-08-27 01:03:46 +02:00 committed by Cheng Zhao
parent 90545bda95
commit edd1eaee5c
2 changed files with 21 additions and 5 deletions

View file

@ -39,6 +39,14 @@ bool IsFakeLocationProviderEnabled() {
#endif
}
bool IsViewApiEnabled() {
#if defined(ENABLE_VIEW_API)
return true;
#else
return false;
#endif
}
void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Value> unused,
v8::Local<v8::Context> context,
@ -49,6 +57,7 @@ void Initialize(v8::Local<v8::Object> exports,
dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
dict.SetMethod("isFakeLocationProviderEnabled",
&IsFakeLocationProviderEnabled);
dict.SetMethod("isViewApiEnabled", &IsViewApiEnabled);
}
} // namespace