Removing #ifdef windows for endsession methods
authorHari Krishna Reddy Juturu <jhreddy@microsoft.com>
Mon, 24 Apr 2017 18:49:21 +0000 (11:49 -0700)
committerHari Krishna Reddy Juturu <jhreddy@microsoft.com>
Mon, 24 Apr 2017 18:49:21 +0000 (11:49 -0700)
atom/browser/api/atom_api_window.h
atom/browser/native_window.cc
atom/browser/native_window.h
atom/browser/native_window_observer.h

index 9620a6bf4af7188a1bb6269644f06d21894ca72d..75f0328ba64fdd103e02ad30ff4c6ffe9e838f92 100644 (file)
@@ -63,6 +63,7 @@ class Window : public mate::TrackableObject<Window>,
   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<Window>,
                             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
 
index f97e34378aaa3b238ee2688518679fe7bc8d4dbb..9e2c11aec4ab7ba1d8f492f0767c0a0a6ce7e625 100644 (file)
@@ -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_)
index f8c75352ed93f53b96faeac1fe03ec6696d1fd7a..d3f18d8fb95c09dafcba949dffe7500e184cb540 100644 (file)
@@ -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
 
index ba99b5b0c87ecfed08ee5bddc9067ac52e3485c5..8c908dc8237a82e8b6496fecef54d3da9afbbcff 100644 (file)
@@ -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