From 8a328268763d23377bfb06f573c5942077f26645 Mon Sep 17 00:00:00 2001 From: Hari Krishna Reddy Juturu Date: Mon, 24 Apr 2017 11:49:21 -0700 Subject: [PATCH] Removing #ifdef windows for endsession methods --- atom/browser/api/atom_api_window.h | 2 +- atom/browser/native_window.cc | 2 -- atom/browser/native_window.h | 2 +- atom/browser/native_window_observer.h | 4 +++- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/browser/api/atom_api_window.h b/atom/browser/api/atom_api_window.h index 9620a6bf4af7..75f0328ba64f 100644 --- a/atom/browser/api/atom_api_window.h +++ b/atom/browser/api/atom_api_window.h @@ -63,6 +63,7 @@ class Window : public mate::TrackableObject, void WillCloseWindow(bool* prevent_default) override; void WillDestroyNativeObject() override; void OnWindowClosed() override; + void OnWindowEndSession() override; void OnWindowBlur() override; void OnWindowFocus() override; void OnWindowShow() override; @@ -92,7 +93,6 @@ class Window : public mate::TrackableObject, const base::DictionaryValue& details) override; #if defined(OS_WIN) - void Window::OnWindowEndSession() override; void OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) override; #endif diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index f97e34378aaa..9e2c11aec4ab 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -474,12 +474,10 @@ void NativeWindow::NotifyWindowClosed() { observer.OnWindowClosed(); } -#if defined(OS_WIN) void NativeWindow::NotifyWindowEndSession() { for (NativeWindowObserver& observer : observers_) observer.OnWindowEndSession(); } -#endif void NativeWindow::NotifyWindowBlur() { for (NativeWindowObserver& observer : observers_) diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index f8c75352ed93..d3f18d8fb95c 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -218,6 +218,7 @@ class NativeWindow : public base::SupportsUserData, // Public API used by platform-dependent delegates and observers to send UI // related notifications. void NotifyWindowClosed(); + void NotifyWindowEndSession(); void NotifyWindowBlur(); void NotifyWindowFocus(); void NotifyWindowShow(); @@ -244,7 +245,6 @@ class NativeWindow : public base::SupportsUserData, const base::DictionaryValue& details); #if defined(OS_WIN) - void NotifyWindowEndSession(); void NotifyWindowMessage(UINT message, WPARAM w_param, LPARAM l_param); #endif diff --git a/atom/browser/native_window_observer.h b/atom/browser/native_window_observer.h index ba99b5b0c87e..8c908dc8237a 100644 --- a/atom/browser/native_window_observer.h +++ b/atom/browser/native_window_observer.h @@ -40,6 +40,9 @@ class NativeWindowObserver { // Called when the window is closed. virtual void OnWindowClosed() {} + // Called when Windows sends WM_ENDSESSION message + virtual void OnWindowEndSession() {} + // Called when window loses focus. virtual void OnWindowBlur() {} @@ -78,7 +81,6 @@ class NativeWindowObserver { // Called when window message received #if defined(OS_WIN) - virtual void OnWindowEndSession() {} virtual void OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) {} #endif