summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2016-06-13 13:29:51 +0200
committerKai Koehne <kai.koehne@qt.io>2016-08-31 09:11:47 +0000
commit3cbe59e29a2702a2c184be10845b9bdd342c24d0 (patch)
treeef3b6555857028147b9b57948a15e18626e213da /src/core/web_contents_delegate_qt.cpp
parent4f3425c0d17f5f53deba78ccf6d357c1c83529f0 (diff)
Add dialog requests to qml api
Introduce qml APIs to support custom dialogs: * http and proxy authentication * javascript dialogs * file pickers * color pickers * form validation messages [ChangeLog][QtWebEngine][QML] Added ability to provide custom dialogs for HTTP and proxy authentication, JavaScript alerts, file and color picking, and form validation messages. Task-number: QTBUG-51190 Change-Id: I559ca59264750feb36ba7d3dba0bf0647509306d Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index b96452093..6e7d1cddc 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -317,8 +317,9 @@ void WebContentsDelegateQt::RunFileChooser(content::WebContents *web_contents, c
for (std::vector<base::string16>::const_iterator it = params.accept_types.begin(); it < params.accept_types.end(); ++it)
acceptedMimeTypes.append(toQt(*it));
- FilePickerController *controller = new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode), web_contents, toQt(params.default_file_name.value()), acceptedMimeTypes);
- m_viewClient->runFileChooser(controller);
+ m_filePickerController.reset(new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
+ web_contents, toQt(params.default_file_name.value()), acceptedMimeTypes));
+ m_viewClient->runFileChooser(m_filePickerController);
}
bool WebContentsDelegateQt::AddMessageToConsole(content::WebContents *source, int32_t level, const base::string16 &message, int32_t line_no, const base::string16 &source_id)