| 
									
										
										
										
											2020-01-13 14:56:28 -08:00
										 |  |  | // Copyright (c) 2019 Slack Technologies, Inc.
 | 
					
						
							|  |  |  | // Use of this source code is governed by the MIT license that can be
 | 
					
						
							|  |  |  | // found in the LICENSE file.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "shell/common/gin_converters/extension_converter.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "extensions/common/extension.h"
 | 
					
						
							|  |  |  | #include "gin/dictionary.h"
 | 
					
						
							| 
									
										
										
										
											2020-02-23 22:30:32 -05:00
										 |  |  | #include "shell/common/gin_converters/file_path_converter.h"
 | 
					
						
							|  |  |  | #include "shell/common/gin_converters/gurl_converter.h"
 | 
					
						
							|  |  |  | #include "shell/common/gin_converters/value_converter.h"
 | 
					
						
							| 
									
										
										
										
											2020-01-13 14:56:28 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace gin { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // static
 | 
					
						
							|  |  |  | v8::Local<v8::Value> Converter<const extensions::Extension*>::ToV8( | 
					
						
							|  |  |  |     v8::Isolate* isolate, | 
					
						
							|  |  |  |     const extensions::Extension* extension) { | 
					
						
							|  |  |  |   auto dict = gin::Dictionary::CreateEmpty(isolate); | 
					
						
							|  |  |  |   dict.Set("id", extension->id()); | 
					
						
							| 
									
										
										
										
											2020-01-21 09:42:55 -08:00
										 |  |  |   dict.Set("name", extension->name()); | 
					
						
							| 
									
										
										
										
											2020-02-23 22:30:32 -05:00
										 |  |  |   dict.Set("path", extension->path()); | 
					
						
							|  |  |  |   dict.Set("url", extension->url()); | 
					
						
							| 
									
										
										
										
											2020-01-21 09:42:55 -08:00
										 |  |  |   dict.Set("version", extension->VersionString()); | 
					
						
							| 
									
										
										
										
											2023-06-02 08:38:29 -05:00
										 |  |  |   dict.Set("manifest", *extension->manifest()->value()); | 
					
						
							| 
									
										
										
										
											2020-02-23 22:30:32 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-13 14:56:28 -08:00
										 |  |  |   return gin::ConvertToV8(isolate, dict); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }  // namespace gin
 |