| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
 | 
					
						
							|  |  |  | // Use of this source code is governed by a BSD-style license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE-CHROMIUM file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:42:16 -04:00
										 |  |  | #ifndef BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
 | 
					
						
							|  |  |  | #define BRIGHTRAY_BROWSER_BROWSER_MAIN_PARTS_H_
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include "base/compiler_specific.h"
 | 
					
						
							|  |  |  | #include "base/memory/scoped_ptr.h"
 | 
					
						
							|  |  |  | #include "content/public/browser/browser_main_parts.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-03 08:44:58 +00:00
										 |  |  | #if defined(TOOLKIT_VIEWS)
 | 
					
						
							| 
									
										
										
										
											2014-07-04 21:41:22 +08:00
										 |  |  | namespace brightray { | 
					
						
							|  |  |  | class ViewsDelegate; | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-07-09 20:05:02 +08:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2014-07-04 21:41:22 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-09 20:05:02 +08:00
										 |  |  | #if defined(USE_AURA) && defined(USE_X11)
 | 
					
						
							| 
									
										
										
										
											2014-07-03 08:44:58 +00:00
										 |  |  | namespace wm { | 
					
						
							|  |  |  | class WMState; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | namespace brightray { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BrowserContext; | 
					
						
							| 
									
										
										
										
											2013-05-14 14:45:34 +08:00
										 |  |  | class WebUIControllerFactory; | 
					
						
							| 
									
										
										
										
											2014-07-30 11:40:17 +08:00
										 |  |  | class DevToolsDelegate; | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | class BrowserMainParts : public content::BrowserMainParts { | 
					
						
							| 
									
										
										
										
											2013-11-17 18:17:23 -05:00
										 |  |  |  public: | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  |   BrowserMainParts(); | 
					
						
							|  |  |  |   ~BrowserMainParts(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   BrowserContext* browser_context() { return browser_context_.get(); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-17 18:17:23 -05:00
										 |  |  |  protected: | 
					
						
							| 
									
										
										
										
											2014-07-03 09:18:24 +00:00
										 |  |  |   // content::BrowserMainParts:
 | 
					
						
							| 
									
										
										
										
											2014-10-23 11:10:39 +08:00
										 |  |  |   virtual void PreEarlyInitialization() override; | 
					
						
							|  |  |  |   virtual void ToolkitInitialized() override; | 
					
						
							|  |  |  |   virtual void PreMainMessageLoopStart() override; | 
					
						
							|  |  |  |   virtual void PreMainMessageLoopRun() override; | 
					
						
							|  |  |  |   virtual void PostMainMessageLoopRun() override; | 
					
						
							|  |  |  |   virtual int PreCreateThreads() override; | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-03 09:18:24 +00:00
										 |  |  |   // Subclasses should override this to provide their own BrowserContxt
 | 
					
						
							|  |  |  |   // implementation. The caller takes ownership of the returned object.
 | 
					
						
							|  |  |  |   virtual BrowserContext* CreateBrowserContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Override this to change how ProxyResolverV8 is initialized.
 | 
					
						
							|  |  |  |   virtual void InitProxyResolverV8(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-17 18:17:23 -05:00
										 |  |  |  private: | 
					
						
							| 
									
										
										
										
											2014-07-03 08:12:12 +00:00
										 |  |  | #if defined(OS_MACOSX)
 | 
					
						
							|  |  |  |   void IncreaseFileDescriptorLimit(); | 
					
						
							|  |  |  |   void InitializeMainNib(); | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  |   scoped_ptr<BrowserContext> browser_context_; | 
					
						
							| 
									
										
										
										
											2013-05-14 14:45:34 +08:00
										 |  |  |   scoped_ptr<WebUIControllerFactory> web_ui_controller_factory_; | 
					
						
							| 
									
										
										
										
											2014-07-30 11:40:17 +08:00
										 |  |  |   scoped_ptr<DevToolsDelegate> devtools_delegate_; | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-03 08:44:58 +00:00
										 |  |  | #if defined(TOOLKIT_VIEWS)
 | 
					
						
							| 
									
										
										
										
											2014-07-04 21:41:22 +08:00
										 |  |  |   scoped_ptr<ViewsDelegate> views_delegate_; | 
					
						
							| 
									
										
										
										
											2014-07-09 20:05:02 +08:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #if defined(USE_AURA) && defined(USE_X11)
 | 
					
						
							| 
									
										
										
										
											2014-07-03 08:44:58 +00:00
										 |  |  |   scoped_ptr<wm::WMState> wm_state_; | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  |   DISALLOW_COPY_AND_ASSIGN(BrowserMainParts); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-17 18:17:23 -05:00
										 |  |  | }  // namespace brightray
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:12:05 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-13 15:42:16 -04:00
										 |  |  | #endif
 |