Move atom.native to $native

This commit is contained in:
Corey Johnson
2012-03-01 15:42:41 -08:00
parent e51f49f6f5
commit e874512284
12 changed files with 46 additions and 46 deletions

View File

@@ -91,12 +91,12 @@
CefRefPtr<CefV8Value> bootstrapScript = CefV8Value::CreateString("atom-bootstrap");
global->SetValue("$bootstrapScript", bootstrapScript, V8_PROPERTY_ATTRIBUTE_NONE);
CefRefPtr<NativeHandler> nativeHandler = new NativeHandler();
global->SetValue("$native", nativeHandler->m_object, V8_PROPERTY_ATTRIBUTE_NONE);
CefRefPtr<CefV8Value> atom = CefV8Value::CreateObject(NULL);
global->SetValue("atom", atom, V8_PROPERTY_ATTRIBUTE_NONE);
CefRefPtr<NativeHandler> nativeHandler = new NativeHandler();
atom->SetValue("native", nativeHandler->m_object, V8_PROPERTY_ATTRIBUTE_NONE);
CefRefPtr<CefV8Value> loadPath = CefV8Value::CreateString(PROJECT_DIR);
atom->SetValue("loadPath", loadPath, V8_PROPERTY_ATTRIBUTE_NONE);

View File

@@ -2,6 +2,7 @@
#import "include/cef.h"
#import "client_handler.h"
#import "native_handler.h"
@implementation AtomController
@@ -66,6 +67,9 @@
CefRefPtr<CefV8Value> bootstrapScript = CefV8Value::CreateString([_bootstrapScript UTF8String]);
global->SetValue("$bootstrapScript", bootstrapScript, V8_PROPERTY_ATTRIBUTE_NONE);
CefRefPtr<NativeHandler> nativeHandler = new NativeHandler();
global->SetValue("$native", nativeHandler->m_object, V8_PROPERTY_ATTRIBUTE_NONE);
if (_pathToOpen) {
CefRefPtr<CefV8Value> pathToOpen = CefV8Value::CreateString([_pathToOpen UTF8String]);
global->SetValue("$pathToOpen", pathToOpen, V8_PROPERTY_ATTRIBUTE_NONE);