Index: src/AppInfoJsObject.cpp |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/src/AppInfoJsObject.cpp |
@@ -0,0 +1,22 @@ |
+#include <AdblockPlus/AppInfo.h> |
+ |
+#include "AppInfoJsObject.h" |
+ |
+using namespace AdblockPlus; |
+ |
+v8::Handle<v8::ObjectTemplate> AppInfoJsObject::Create(const AppInfo& appInfo) |
+{ |
+ v8::HandleScope handleScope; |
+ const v8::Handle<v8::ObjectTemplate> infoObject = v8::ObjectTemplate::New(); |
+ infoObject->Set(v8::String::New("addonID"), |
+ v8::String::New(appInfo.addonId.c_str())); |
+ infoObject->Set(v8::String::New("addonVersion"), |
+ v8::String::New(appInfo.addonVersion.c_str())); |
+ infoObject->Set(v8::String::New("addonRoot"), |
+ v8::String::New(appInfo.addonRoot.c_str())); |
+ infoObject->Set(v8::String::New("addonName"), |
+ v8::String::New(appInfo.addonName.c_str())); |
+ infoObject->Set(v8::String::New("application"), |
+ v8::String::New(appInfo.application.c_str())); |
+ return handleScope.Close(infoObject); |
+} |