summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/cpp_variant.cc14
-rw-r--r--webkit/glue/cpp_variant.h7
-rw-r--r--webkit/glue/webframeloaderclient_impl.cc8
-rw-r--r--webkit/glue/webview_delegate.h4
4 files changed, 33 insertions, 0 deletions
diff --git a/webkit/glue/cpp_variant.cc b/webkit/glue/cpp_variant.cc
index a33986d..efa90e7 100644
--- a/webkit/glue/cpp_variant.cc
+++ b/webkit/glue/cpp_variant.cc
@@ -250,3 +250,17 @@ std::vector<std::wstring> CppVariant::ToStringVector() const {
return wstring_vector;
}
+bool CppVariant::Invoke(const std::string& method, const CppVariant* args,
+ uint32 arg_count, CppVariant& result) const {
+ DCHECK(isObject());
+ NPIdentifier method_name = NPN_GetStringIdentifier(method.c_str());
+ NPObject* np_object = value.objectValue;
+ if (NPN_HasMethod(NULL, np_object, method_name)) {
+ NPVariant r;
+ bool status = NPN_Invoke(NULL, np_object, method_name, args, arg_count, &r);
+ result.Set(r);
+ return status;
+ } else {
+ return false;
+ }
+}
diff --git a/webkit/glue/cpp_variant.h b/webkit/glue/cpp_variant.h
index c1eb795..f8a4c2e 100644
--- a/webkit/glue/cpp_variant.h
+++ b/webkit/glue/cpp_variant.h
@@ -98,6 +98,13 @@ class CppVariant : public NPVariant {
// for converting a JavaScript array of strings into a vector of strings.
std::vector<std::wstring> ToStringVector() const;
+ // Invoke method of the given name on an object with the supplied arguments.
+ // The first argument should be the object on which the method is to be
+ // invoked. Returns whether the method was successfully invoked. If the
+ // method was invoked successfully, any return value is stored in the
+ // CppVariant specified by result.
+ bool Invoke(const std::string& method, const CppVariant* args,
+ uint32 arg_count, CppVariant& result) const;
};
#endif // WEBKIT_GLUE_CPP_VARIANT_H__
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc
index 4303598..7ba384a 100644
--- a/webkit/glue/webframeloaderclient_impl.cc
+++ b/webkit/glue/webframeloaderclient_impl.cc
@@ -1253,7 +1253,15 @@ void WebFrameLoaderClient::transitionToCommittedFromCachedPage(WebCore::CachedPa
ASSERT_NOT_REACHED();
}
+// Called when the FrameLoader goes into a state in which a new page load
+// will occur.
void WebFrameLoaderClient::transitionToCommittedForNewPage() {
+ WebViewImpl* webview = webframe_->webview_impl();
+ WebViewDelegate* d = webview->delegate();
+ // Notify the RenderView.
+ if (d) {
+ d->TransitionToCommittedForNewPage();
+ }
makeDocumentView();
}
diff --git a/webkit/glue/webview_delegate.h b/webkit/glue/webview_delegate.h
index 6e39316..1f313b3 100644
--- a/webkit/glue/webview_delegate.h
+++ b/webkit/glue/webview_delegate.h
@@ -709,6 +709,10 @@ class WebViewDelegate : virtual public WebWidgetDelegate {
virtual void WebInspectorOpened(int num_resources) { }
+ // Called when the FrameLoader goes into a state in which a new page load
+ // will occur.
+ virtual void TransitionToCommittedForNewPage() { }
+
WebViewDelegate() { }
virtual ~WebViewDelegate() { }