| 
									
										
										
										
											2014-10-31 11:17:05 -07:00
										 |  |  | // Copyright (c) 2013 GitHub, Inc.
 | 
					
						
							| 
									
										
										
										
											2014-04-25 17:49:37 +08:00
										 |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							| 
									
										
										
										
											2013-05-02 22:54:09 +08:00
										 |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-16 08:58:59 +08:00
										 |  |  | #ifndef ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
 | 
					
						
							|  |  |  | #define ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
 | 
					
						
							| 
									
										
										
										
											2013-05-02 22:54:09 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-25 17:43:50 +11:00
										 |  |  | #include "base/observer_list_types.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 22:54:09 +08:00
										 |  |  | namespace atom { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class NativeWindow; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-25 17:43:50 +11:00
										 |  |  | class WindowListObserver : public base::CheckedObserver { | 
					
						
							| 
									
										
										
										
											2013-05-03 10:53:54 +08:00
										 |  |  |  public: | 
					
						
							| 
									
										
										
										
											2013-05-02 22:54:09 +08:00
										 |  |  |   // Called immediately after a window is added to the list.
 | 
					
						
							|  |  |  |   virtual void OnWindowAdded(NativeWindow* window) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Called immediately after a window is removed from the list.
 | 
					
						
							|  |  |  |   virtual void OnWindowRemoved(NativeWindow* window) {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 23:43:23 +08:00
										 |  |  |   // Called when a window close is cancelled by beforeunload handler.
 | 
					
						
							|  |  |  |   virtual void OnWindowCloseCancelled(NativeWindow* window) {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-02 22:54:09 +08:00
										 |  |  |   // Called immediately after all windows are closed.
 | 
					
						
							|  |  |  |   virtual void OnWindowAllClosed() {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  protected: | 
					
						
							| 
									
										
										
										
											2018-10-25 17:43:50 +11:00
										 |  |  |   ~WindowListObserver() override {} | 
					
						
							| 
									
										
										
										
											2013-05-02 22:54:09 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace atom
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-03-16 08:58:59 +08:00
										 |  |  | #endif  // ATOM_BROWSER_WINDOW_LIST_OBSERVER_H_
 |