My only question is - why is the browser object passed to OnFileDialog NULL? I need the browser object to get the window handle to properly display an NSOpenPanel in the proper window, but can't access the browser object.
I'm doing nothing out of the ordinary that I know of.
Thanks!
- Code: Select all
/* MyHandler.h */
class MyHandler : public CefDialogHandler
...
virtual CefRefPtr<CefDialogHandler> GetDialogHandler() OVERRIDE {
return this;
}
virtual bool OnFileDialog(CefRefPtr<CefBrowser> browser,
FileDialogMode mode,
const CefString& title,
const CefString& default_file_name,
const std::vector<CefString>& accept_types,
CefRefPtr<CefFileDialogCallback> callback) OVERRIDE;
- Code: Select all
/* MyHandler.mm */
bool MyHandler::OnFileDialog(CefRefPtr<CefBrowser> browser,
FileDialogMode mode,
const CefString& title,
const CefString& default_file_name,
const std::vector<CefString>& accept_types,
CefRefPtr<CefFileDialogCallback> callback) {
/*
NSWindow *browserWindow = [browser.get()->GetHost()->GetWindowHandle() window]; // EXC_BAD_ACCESS, browser ptr_ = NULL
NSWindow *browserWindow = [browser->GetHost()->GetWindowHandle() window]; // EXC_BAD_ACCESS, browser ptr_ = NULL
*/
...