Add a few more API bindings

This commit is contained in:
Cheng Zhao 2015-01-13 16:28:12 -08:00
parent 509294b228
commit 029ee9aa1e

View file

@ -9,14 +9,18 @@ namespace {
void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context, void* priv) { v8::Handle<v8::Context> context, void* priv) {
gfx::Screen* screen = gfx::Screen::GetNativeScreen(); auto screen = base::Unretained(gfx::Screen::GetNativeScreen());
mate::Dictionary dict(context->GetIsolate(), exports); mate::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("getCursorScreenPoint", dict.SetMethod("getCursorScreenPoint",
base::Bind(&gfx::Screen::GetCursorScreenPoint, base::Bind(&gfx::Screen::GetCursorScreenPoint, screen));
base::Unretained(screen)));
dict.SetMethod("getPrimaryDisplay", dict.SetMethod("getPrimaryDisplay",
base::Bind(&gfx::Screen::GetPrimaryDisplay, base::Bind(&gfx::Screen::GetPrimaryDisplay, screen));
base::Unretained(screen))); dict.SetMethod("getAllDisplays",
base::Bind(&gfx::Screen::GetAllDisplays, screen));
dict.SetMethod("getDisplayNearestPoint",
base::Bind(&gfx::Screen::GetDisplayNearestPoint, screen));
dict.SetMethod("getDisplayMatching",
base::Bind(&gfx::Screen::GetDisplayMatching, screen));
} }
} // namespace } // namespace