diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 19:48:37 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-09 19:48:37 +0000 |
commit | 2879092e01ea4ebb93c1b80925c81e059b24607b (patch) | |
tree | 53638b170c3c9c3146d13238d1ed20993cdb4257 /webkit | |
parent | 12a6f036f3859f88b439dba009172f5c1dd03dc9 (diff) | |
download | chromium_src-2879092e01ea4ebb93c1b80925c81e059b24607b.zip chromium_src-2879092e01ea4ebb93c1b80925c81e059b24607b.tar.gz chromium_src-2879092e01ea4ebb93c1b80925c81e059b24607b.tar.bz2 |
Changing ForwardMessageToExternalHost to postMessage and passing a proper
MessageEvent object to the onmessage handler.
Also adding support for origin and target parameters. The origin parameter is
implicit but target can be specified when calling postMessage. If no target
is specified we default to "*".
At the moment I'm only allowing target == "*" messages to pass through since
I haven't implemented support for matching more complicated patterns :)
Review URL: http://codereview.chromium.org/40128
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/webframe.h | 2 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.cc | 7 | ||||
-rw-r--r-- | webkit/glue/webframe_impl.h | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h index 4a0cf01..d35376e 100644 --- a/webkit/glue/webframe.h +++ b/webkit/glue/webframe.h @@ -47,6 +47,8 @@ class WebFrame { // TODO(fqian): Remove this method when V8 supports NP runtime. virtual void* GetFrameImplementation() = 0; + virtual NPObject* GetWindowNPObject() = 0; + // Loads the given WebRequest. virtual void LoadRequest(WebRequest* request) = 0; diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index 28ba59c..bf4fb03 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -741,6 +741,13 @@ void WebFrameImpl::GetContentAsPlainText(int max_chars, FrameContentAsPlainText(max_chars, frame_, text); } +NPObject* WebFrameImpl::GetWindowNPObject() { + if (!frame_) + return NULL; + + return frame_->script()->windowScriptNPObject(); +} + void WebFrameImpl::InvalidateArea(AreaToInvalidate area) { ASSERT(frame() && frame()->view()); #if defined(OS_WIN) diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h index 63950aa..ed7ee15 100644 --- a/webkit/glue/webframe_impl.h +++ b/webkit/glue/webframe_impl.h @@ -116,6 +116,8 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { virtual void* GetFrameImplementation() { return frame(); } + virtual NPObject* GetWindowNPObject(); + virtual void GetContentAsPlainText(int max_chars, std::wstring* text) const; virtual bool Find(const FindInPageRequest& request, bool wrap_within_frame, |