示例#1
0
void ClientHandler::OnContentsSizeChange(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int width, int height) {
  REQUIRE_UI_THREAD();
  if (!browser->IsPopup() && frame->IsMain()) {
    NativeWindow* window = NativeWindow::GetWindow(browser);
    if (window != NULL && window->GetAutoResize()) {
      window->Resize(width, height);
    }
  }
}
示例#2
0
Handle<Value> Window::Resize(const Arguments& args) {
  HandleScope scope;
  NativeWindow *window = ObjectWrap::Unwrap<NativeWindow>(args.This());

  int width = args[0]->Int32Value();
  int height = args[1]->Int32Value();
  window->Resize(width, height);

  return scope.Close(args.This());
}