mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
remove ENABLE_VIEWS_API build flag
This commit is contained in:
@@ -61,12 +61,6 @@ module.exports = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (defines.ENABLE_VIEWS_API === 'false') {
|
||||
ignoredModules.push(
|
||||
'@electron/internal/browser/api/views/image-view.js'
|
||||
);
|
||||
}
|
||||
|
||||
const plugins = [];
|
||||
|
||||
if (onlyPrintingGraph) {
|
||||
|
||||
@@ -12,7 +12,6 @@ buildflag_header("buildflags") {
|
||||
"ENABLE_DESKTOP_CAPTURER=$enable_desktop_capturer",
|
||||
"ENABLE_RUN_AS_NODE=$enable_run_as_node",
|
||||
"ENABLE_OSR=$enable_osr",
|
||||
"ENABLE_VIEWS_API=$enable_views_api",
|
||||
"ENABLE_PDF_VIEWER=$enable_pdf_viewer",
|
||||
"ENABLE_TTS=$enable_tts",
|
||||
"ENABLE_COLOR_CHOOSER=$enable_color_chooser",
|
||||
|
||||
@@ -12,6 +12,7 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'dialog', loader: () => require('./dialog') },
|
||||
{ name: 'globalShortcut', loader: () => require('./global-shortcut') },
|
||||
{ name: 'ipcMain', loader: () => require('./ipc-main') },
|
||||
{ name: 'ImageView', loader: () => require('./views/image-view') },
|
||||
{ name: 'inAppPurchase', loader: () => require('./in-app-purchase') },
|
||||
{ name: 'Menu', loader: () => require('./menu') },
|
||||
{ name: 'MenuItem', loader: () => require('./menu-item') },
|
||||
@@ -43,9 +44,3 @@ if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
|
||||
{ name: 'desktopCapturer', loader: () => require('./desktop-capturer') }
|
||||
);
|
||||
}
|
||||
|
||||
if (BUILDFLAG(ENABLE_VIEWS_API)) {
|
||||
browserModuleList.push(
|
||||
{ name: 'ImageView', loader: () => require('./views/image-view') }
|
||||
);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,6 @@ View::~View() {
|
||||
delete view_;
|
||||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_VIEWS_API)
|
||||
void View::AddChildViewAt(gin::Handle<View> child,
|
||||
absl::optional<size_t> maybe_index) {
|
||||
CHECK(view_);
|
||||
@@ -300,7 +299,6 @@ void View::OnViewIsDeleting(views::View* observed_view) {
|
||||
DCHECK_EQ(observed_view, view_);
|
||||
view_ = nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
// static
|
||||
gin_helper::WrappableBase* View::New(gin::Arguments* args) {
|
||||
@@ -335,7 +333,6 @@ gin::Handle<View> View::Create(v8::Isolate* isolate) {
|
||||
void View::BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype) {
|
||||
prototype->SetClassName(gin::StringToV8(isolate, "View"));
|
||||
#if BUILDFLAG(ENABLE_VIEWS_API)
|
||||
gin_helper::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
|
||||
.SetMethod("addChildView", &View::AddChildViewAt)
|
||||
.SetMethod("removeChildView", &View::RemoveChildView)
|
||||
@@ -345,7 +342,6 @@ void View::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("setBackgroundColor", &View::SetBackgroundColor)
|
||||
.SetMethod("setLayout", &View::SetLayout)
|
||||
.SetMethod("setVisible", &View::SetVisible);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace electron::api
|
||||
|
||||
@@ -28,7 +28,6 @@ class View : public gin_helper::EventEmitter<View>, public views::ViewObserver {
|
||||
static void BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype);
|
||||
|
||||
#if BUILDFLAG(ENABLE_VIEWS_API)
|
||||
void AddChildViewAt(gin::Handle<View> child, absl::optional<size_t> index);
|
||||
void RemoveChildView(gin::Handle<View> child);
|
||||
|
||||
@@ -42,7 +41,6 @@ class View : public gin_helper::EventEmitter<View>, public views::ViewObserver {
|
||||
// views::ViewObserver
|
||||
void OnViewBoundsChanged(views::View* observed_view) override;
|
||||
void OnViewIsDeleting(views::View* observed_view) override;
|
||||
#endif
|
||||
|
||||
views::View* view() const { return view_; }
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@ bool IsFakeLocationProviderEnabled() {
|
||||
return BUILDFLAG(OVERRIDE_LOCATION_PROVIDER);
|
||||
}
|
||||
|
||||
bool IsViewApiEnabled() {
|
||||
return BUILDFLAG(ENABLE_VIEWS_API);
|
||||
}
|
||||
|
||||
bool IsTtsEnabled() {
|
||||
return BUILDFLAG(ENABLE_TTS);
|
||||
}
|
||||
@@ -74,7 +70,6 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
dict.SetMethod("isRunAsNodeEnabled", &IsRunAsNodeEnabled);
|
||||
dict.SetMethod("isFakeLocationProviderEnabled",
|
||||
&IsFakeLocationProviderEnabled);
|
||||
dict.SetMethod("isViewApiEnabled", &IsViewApiEnabled);
|
||||
dict.SetMethod("isTtsEnabled", &IsTtsEnabled);
|
||||
dict.SetMethod("isPrintingEnabled", &IsPrintingEnabled);
|
||||
dict.SetMethod("isPictureInPictureEnabled", &IsPictureInPictureEnabled);
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
V(electron_browser_event) \
|
||||
V(electron_browser_event_emitter) \
|
||||
V(electron_browser_global_shortcut) \
|
||||
V(electron_browser_image_view) \
|
||||
V(electron_browser_in_app_purchase) \
|
||||
V(electron_browser_menu) \
|
||||
V(electron_browser_message_port) \
|
||||
@@ -90,8 +91,6 @@
|
||||
V(electron_renderer_web_frame) \
|
||||
V(electron_utility_parent_port)
|
||||
|
||||
#define ELECTRON_VIEWS_MODULES(V) V(electron_browser_image_view)
|
||||
|
||||
#define ELECTRON_DESKTOP_CAPTURER_MODULE(V) V(electron_browser_desktop_capturer)
|
||||
|
||||
#define ELECTRON_TESTING_MODULE(V) V(electron_common_testing)
|
||||
@@ -103,9 +102,6 @@
|
||||
// implementation when calling the NODE_LINKED_MODULE_CONTEXT_AWARE.
|
||||
#define V(modname) void _register_##modname();
|
||||
ELECTRON_BUILTIN_MODULES(V)
|
||||
#if BUILDFLAG(ENABLE_VIEWS_API)
|
||||
ELECTRON_VIEWS_MODULES(V)
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_DESKTOP_CAPTURER)
|
||||
ELECTRON_DESKTOP_CAPTURER_MODULE(V)
|
||||
#endif
|
||||
@@ -353,9 +349,6 @@ NodeBindings::~NodeBindings() {
|
||||
void NodeBindings::RegisterBuiltinModules() {
|
||||
#define V(modname) _register_##modname();
|
||||
ELECTRON_BUILTIN_MODULES(V)
|
||||
#if BUILDFLAG(ENABLE_VIEWS_API)
|
||||
ELECTRON_VIEWS_MODULES(V)
|
||||
#endif
|
||||
#if BUILDFLAG(ENABLE_DESKTOP_CAPTURER)
|
||||
ELECTRON_DESKTOP_CAPTURER_MODULE(V)
|
||||
#endif
|
||||
|
||||
2
typings/internal-ambient.d.ts
vendored
2
typings/internal-ambient.d.ts
vendored
@@ -11,7 +11,6 @@ declare var isolatedApi: {
|
||||
declare const BUILDFLAG: (flag: boolean) => boolean;
|
||||
|
||||
declare const ENABLE_DESKTOP_CAPTURER: boolean;
|
||||
declare const ENABLE_VIEWS_API: boolean;
|
||||
|
||||
declare namespace NodeJS {
|
||||
interface FeaturesBinding {
|
||||
@@ -21,7 +20,6 @@ declare namespace NodeJS {
|
||||
isPDFViewerEnabled(): boolean;
|
||||
isRunAsNodeEnabled(): boolean;
|
||||
isFakeLocationProviderEnabled(): boolean;
|
||||
isViewApiEnabled(): boolean;
|
||||
isTtsEnabled(): boolean;
|
||||
isPrintingEnabled(): boolean;
|
||||
isPictureInPictureEnabled(): boolean;
|
||||
|
||||
Reference in New Issue
Block a user