| 
									
										
										
										
											2017-01-17 19:53:13 +05:30
										 |  |  | // Copyright (c) 2017 GitHub, Inc.
 | 
					
						
							|  |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
 | 
					
						
							|  |  |  | #define ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-02 12:11:56 -07:00
										 |  |  | #include <memory>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-17 19:53:13 +05:30
										 |  |  | #include "base/macros.h"
 | 
					
						
							|  |  |  | #include "base/memory/singleton.h"
 | 
					
						
							| 
									
										
										
										
											2018-10-02 12:11:56 -07:00
										 |  |  | #include "content/public/browser/web_ui_controller.h"
 | 
					
						
							| 
									
										
										
										
											2017-01-17 19:53:13 +05:30
										 |  |  | #include "content/public/browser/web_ui_controller_factory.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace atom { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class AtomWebUIControllerFactory : public content::WebUIControllerFactory { | 
					
						
							|  |  |  |  public: | 
					
						
							|  |  |  |   static AtomWebUIControllerFactory* GetInstance(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   AtomWebUIControllerFactory(); | 
					
						
							| 
									
										
										
										
											2018-04-17 16:03:51 -07:00
										 |  |  |   ~AtomWebUIControllerFactory() override; | 
					
						
							| 
									
										
										
										
											2017-01-17 19:53:13 +05:30
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-18 19:28:20 +05:30
										 |  |  |   // content::WebUIControllerFactory:
 | 
					
						
							| 
									
										
										
										
											2017-01-17 19:53:13 +05:30
										 |  |  |   content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context, | 
					
						
							|  |  |  |                                       const GURL& url) const override; | 
					
						
							|  |  |  |   bool UseWebUIForURL(content::BrowserContext* browser_context, | 
					
						
							|  |  |  |                       const GURL& url) const override; | 
					
						
							|  |  |  |   bool UseWebUIBindingsForURL(content::BrowserContext* browser_context, | 
					
						
							|  |  |  |                               const GURL& url) const override; | 
					
						
							| 
									
										
										
										
											2018-10-02 12:11:56 -07:00
										 |  |  |   std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL( | 
					
						
							| 
									
										
										
										
											2017-01-17 19:53:13 +05:30
										 |  |  |       content::WebUI* web_ui, | 
					
						
							|  |  |  |       const GURL& url) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  private: | 
					
						
							|  |  |  |   friend struct base::DefaultSingletonTraits<AtomWebUIControllerFactory>; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   DISALLOW_COPY_AND_ASSIGN(AtomWebUIControllerFactory); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace atom
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif  // ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
 |