summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webplugin.h3
-rw-r--r--webkit/glue/webplugin_impl.cc9
-rw-r--r--webkit/glue/webplugin_impl.h1
-rw-r--r--webkit/glue/webview_delegate.h8
4 files changed, 17 insertions, 4 deletions
diff --git a/webkit/glue/webplugin.h b/webkit/glue/webplugin.h
index db1969a..12bffab 100644
--- a/webkit/glue/webplugin.h
+++ b/webkit/glue/webplugin.h
@@ -119,6 +119,9 @@ class WebPlugin {
// Returns the DOM element that loaded the plugin.
virtual NPObject* GetPluginElement() = 0;
+ // Returns the WebFrame that contains this plugin.
+ virtual WebFrame* GetWebFrame() = 0;
+
// Cookies
virtual void SetCookie(const GURL& url,
const GURL& policy_url,
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index 91d66b5..7a58b57 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -447,10 +447,11 @@ std::string WebPluginImpl::GetCookies(const GURL& url, const GURL& policy_url) {
void WebPluginImpl::ShowModalHTMLDialog(const GURL& url, int width, int height,
const std::string& json_arguments,
std::string* json_retval) {
- // TODO(mpcomplete): Figure out how to call out to the RenderView and
- // implement this. Though, this is never called atm - only the out-of-process
- // version is used.
- NOTREACHED();
+ if (webframe_ && webframe_->GetView() &&
+ webframe_->GetView()->GetDelegate()) {
+ webframe_->GetView()->GetDelegate()->ShowModalHTMLDialog(
+ url, width, height, json_arguments, json_retval);
+ }
}
void WebPluginImpl::OnMissingPluginStatus(int status) {
diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h
index dd78d53..04e09cb 100644
--- a/webkit/glue/webplugin_impl.h
+++ b/webkit/glue/webplugin_impl.h
@@ -168,6 +168,7 @@ class WebPluginImpl : public WebPlugin,
NPObject* GetWindowScriptNPObject();
NPObject* GetPluginElement();
+ virtual WebFrame* GetWebFrame() { return webframe_; }
void SetCookie(const GURL& url,
const GURL& policy_url,
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index cf18ca5..5e4cc6c 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -474,6 +474,14 @@ class WebViewDelegate : virtual public WebWidgetDelegate {
// UIDelegate --------------------------------------------------------------
+ // Asks the browser to show a modal HTML dialog. The dialog is passed the
+ // given arguments as a JSON string, and returns its result as a JSON string
+ // through json_retval.
+ virtual void ShowModalHTMLDialog(const GURL& url, int width, int height,
+ const std::string& json_arguments,
+ std::string* json_retval) {
+ }
+
// Displays a JavaScript alert panel associated with the given view. Clients
// should visually indicate that this panel comes from JavaScript. The panel
// should have a single OK button.