summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 22:56:58 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 22:56:58 +0000
commit1f70f0ca51d1c61d3a775507b2b69dcdf60e77df (patch)
tree41659daa24b3e9af8996b2782dffead89fdcc63c /webkit/glue
parent11de3e98153ad8dcb9e6628e527f7bfb2ca0a8ed (diff)
downloadchromium_src-1f70f0ca51d1c61d3a775507b2b69dcdf60e77df.zip
chromium_src-1f70f0ca51d1c61d3a775507b2b69dcdf60e77df.tar.gz
chromium_src-1f70f0ca51d1c61d3a775507b2b69dcdf60e77df.tar.bz2
Send port-closed notification when a frame with ports unloads.
Also add onLoad and onUnload chrome Event to our bindings, so we can add listeners to these events without needing a DOM. These don't hook into the window "unload" event, so we no longer prevent Chrome's sudden termination of tabs on shutdown. BUG=12686 TEST=no Review URL: http://codereview.chromium.org/125280 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/webframe.h7
-rw-r--r--webkit/glue/webframe_impl.cc14
-rw-r--r--webkit/glue/webframe_impl.h2
3 files changed, 23 insertions, 0 deletions
diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h
index 1789bfb..faa98bd 100644
--- a/webkit/glue/webframe.h
+++ b/webkit/glue/webframe.h
@@ -191,6 +191,13 @@ class WebFrame {
// Returns the top-most frame in the frame hierarchy containing this frame.
virtual WebFrame* GetTop() const = 0;
+ // Returns the first child frame of this frame, or NULL if it has no children.
+ virtual WebFrame* GetFirstChild() const = 0;
+
+ // Returns the next sibling frame of this frame, or NULL if there are no more
+ // siblings.
+ virtual WebFrame* GetNextSibling() const = 0;
+
// Returns the child frame with the given xpath.
// The document of this frame is used as the context node.
// The xpath may need a recursive traversal if non-trivial
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 24d1e4b..c8c50ef 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -683,6 +683,20 @@ WebFrame* WebFrameImpl::GetTop() const {
return NULL;
}
+WebFrame* WebFrameImpl::GetFirstChild() const {
+ if (frame_ && frame_->tree()->firstChild())
+ return FromFrame(frame_->tree()->firstChild());
+
+ return NULL;
+}
+
+WebFrame* WebFrameImpl::GetNextSibling() const {
+ if (frame_ && frame_->tree()->nextSibling())
+ return FromFrame(frame_->tree()->nextSibling());
+
+ return NULL;
+}
+
WebFrame* WebFrameImpl::GetChildFrame(const std::wstring& xpath) const {
// xpath string can represent a frame deep down the tree (across multiple
// frame DOMs).
diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h
index 6db3aa0..5ddfdea 100644
--- a/webkit/glue/webframe_impl.h
+++ b/webkit/glue/webframe_impl.h
@@ -106,6 +106,8 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> {
virtual WebFrame* GetOpener() const;
virtual WebFrame* GetParent() const;
virtual WebFrame* GetTop() const;
+ virtual WebFrame* GetFirstChild() const;
+ virtual WebFrame* GetNextSibling() const;
virtual WebFrame* GetChildFrame(const std::wstring& xpath) const;
virtual WebView* GetView() const;
virtual void GetForms(std::vector<WebKit::WebForm>* forms) const;