mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Provide default implementations of the file chooser dialogs (open, open multiple, save) on all platforms (issue #761).
- Add a new CefBrowserHost::RunFileDialog method that displays the specified file chooser dialog and returns the results asynchronously (issue #761). - Add a new CefDialogHandler::OnFileDialog callback that allows the application to provide custom UI for file chooser dialogs (issue #761). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@862 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -336,8 +336,13 @@ bool ClientApp::OnProcessMessageReceived(
|
||||
std::make_pair(message_name.ToString(),
|
||||
browser->GetIdentifier()));
|
||||
if (it != callback_map_.end()) {
|
||||
// Keep a local reference to the objects. The callback may remove itself
|
||||
// from the callback map.
|
||||
CefRefPtr<CefV8Context> context = it->second.first;
|
||||
CefRefPtr<CefV8Value> callback = it->second.second;
|
||||
|
||||
// Enter the context.
|
||||
it->second.first->Enter();
|
||||
context->Enter();
|
||||
|
||||
CefV8ValueList arguments;
|
||||
|
||||
@ -351,15 +356,14 @@ bool ClientApp::OnProcessMessageReceived(
|
||||
arguments.push_back(args);
|
||||
|
||||
// Execute the callback.
|
||||
CefRefPtr<CefV8Value> retval =
|
||||
it->second.second->ExecuteFunction(NULL, arguments);
|
||||
CefRefPtr<CefV8Value> retval = callback->ExecuteFunction(NULL, arguments);
|
||||
if (retval.get()) {
|
||||
if (retval->IsBool())
|
||||
handled = retval->GetBoolValue();
|
||||
}
|
||||
|
||||
// Exit the context.
|
||||
it->second.first->Exit();
|
||||
context->Exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user