| 
									
										
										
										
											2015-09-05 01:44:22 +09:00
										 |  |  | // Copyright (c) 2015 GitHub, Inc.
 | 
					
						
							|  |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef ATOM_BROWSER_WEB_CONTENTS_PREFERENCES_H_
 | 
					
						
							|  |  |  | #define ATOM_BROWSER_WEB_CONTENTS_PREFERENCES_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "base/values.h"
 | 
					
						
							|  |  |  | #include "content/public/browser/web_contents_user_data.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-05 02:04:09 +09:00
										 |  |  | namespace base { | 
					
						
							|  |  |  | class CommandLine; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-05 01:44:22 +09:00
										 |  |  | namespace atom { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-05 01:52:29 +09:00
										 |  |  | // Stores and applies the preferences of WebContents.
 | 
					
						
							| 
									
										
										
										
											2015-09-05 01:44:22 +09:00
										 |  |  | class WebContentsPreferences | 
					
						
							|  |  |  |     : public content::WebContentsUserData<WebContentsPreferences> { | 
					
						
							|  |  |  |  public: | 
					
						
							| 
									
										
										
										
											2015-09-05 01:52:29 +09:00
										 |  |  |   // Get the preferences of |web_contents|.
 | 
					
						
							|  |  |  |   static WebContentsPreferences* From(content::WebContents* web_contents); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-05 02:04:09 +09:00
										 |  |  |   // Append command paramters appending to |web_contents|'s preferences.
 | 
					
						
							|  |  |  |   static void AppendExtraCommandLineSwitches( | 
					
						
							|  |  |  |       content::WebContents* web_contents, base::CommandLine* command_line); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-05 01:44:22 +09:00
										 |  |  |   WebContentsPreferences(content::WebContents* web_contents, | 
					
						
							|  |  |  |                          base::DictionaryValue&& web_preferences); | 
					
						
							|  |  |  |   ~WebContentsPreferences() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  private: | 
					
						
							|  |  |  |   friend class content::WebContentsUserData<WebContentsPreferences>; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   base::DictionaryValue web_preferences_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   DISALLOW_COPY_AND_ASSIGN(WebContentsPreferences); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace atom
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif  // ATOM_BROWSER_WEB_CONTENTS_PREFERENCES_H_
 |