diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index d3c5931ad6da..5e32657f008a 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -161,6 +161,7 @@ void Tray::BuildPrototype(v8::Isolate* isolate, v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) .SetMethod("destroy", &Tray::Destroy, true) + .SetMethod("isDestroyed", &Tray::IsDestroyed, true) .SetMethod("setImage", &Tray::SetImage) .SetMethod("setPressedImage", &Tray::SetPressedImage) .SetMethod("setToolTip", &Tray::SetToolTip) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 1c3334e93669..066ca9cc7b65 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -604,10 +604,6 @@ void WebContents::Destroy() { } } -bool WebContents::IsAlive() const { - return web_contents() != NULL; -} - int WebContents::GetID() const { return web_contents()->GetRenderProcessHost()->GetID(); } @@ -996,7 +992,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder( if (template_.IsEmpty()) template_.Reset(isolate, mate::ObjectTemplateBuilder(isolate) .SetMethod("destroy", &WebContents::Destroy, true) - .SetMethod("isAlive", &WebContents::IsAlive, true) + .SetMethod("isDestroyed", &WebContents::IsDestroyed, true) .SetMethod("getId", &WebContents::GetID) .SetMethod("equal", &WebContents::Equal) .SetMethod("_loadURL", &WebContents::LoadURL) @@ -1066,7 +1062,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder( } bool WebContents::IsDestroyed() const { - return !IsAlive(); + return !web_contents(); } AtomBrowserContext* WebContents::GetBrowserContext() const { diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index ae231cd3c61d..568a563e2c84 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -57,7 +57,6 @@ class WebContents : public mate::TrackableObject, // mate::TrackableObject: void Destroy() override; - bool IsAlive() const; int GetID() const; bool Equal(const WebContents* web_contents) const; void LoadURL(const GURL& url, const mate::Dictionary& options); diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 61f43f9aac38..7f5b78a79780 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -284,10 +284,6 @@ void Window::Close() { window_->Close(); } -bool Window::IsClosed() { - return window_->IsClosed(); -} - void Window::Focus() { window_->Focus(true); } @@ -622,8 +618,8 @@ void Window::BuildPrototype(v8::Isolate* isolate, v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) .SetMethod("destroy", &Window::Destroy, true) + .SetMethod("isDestroyed", &Window::IsDestroyed, true) .SetMethod("close", &Window::Close) - .SetMethod("isClosed", &Window::IsClosed) .SetMethod("focus", &Window::Focus) .SetMethod("isFocused", &Window::IsFocused) .SetMethod("show", &Window::Show) diff --git a/atom/browser/api/atom_api_window.h b/atom/browser/api/atom_api_window.h index 1c582551cc93..4161584206a7 100644 --- a/atom/browser/api/atom_api_window.h +++ b/atom/browser/api/atom_api_window.h @@ -89,7 +89,6 @@ class Window : public mate::TrackableObject, // APIs for NativeWindow. void Close(); - bool IsClosed(); void Focus(); bool IsFocused(); void Show();