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

This commit is contained in:
trop[bot] 2018-08-27 13:00:19 +09:00 committed by Cheng Zhao
parent 9237d40e09
commit ff539c1d61
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