summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 04:13:22 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 04:13:22 +0000
commitf18826a364443bd9937dc0f6fb831f1fc40eb2b3 (patch)
tree158defab481da32e7592e4a62ba6199a0d16cbb6 /webkit/glue
parent08682a91c50c166c3b3c64f8fd3e11693a09ad3b (diff)
downloadchromium_src-f18826a364443bd9937dc0f6fb831f1fc40eb2b3.zip
chromium_src-f18826a364443bd9937dc0f6fb831f1fc40eb2b3.tar.gz
chromium_src-f18826a364443bd9937dc0f6fb831f1fc40eb2b3.tar.bz2
SSLPolicy Fix: Step 1.
Expose some more accessors on WebFrame. R=wtc BUG=8706 Review URL: http://codereview.chromium.org/48034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/webframe.h6
-rw-r--r--webkit/glue/webframe_impl.cc16
-rw-r--r--webkit/glue/webframe_impl.h2
3 files changed, 24 insertions, 0 deletions
diff --git a/webkit/glue/webframe.h b/webkit/glue/webframe.h
index ce441d6..90b1ec8 100644
--- a/webkit/glue/webframe.h
+++ b/webkit/glue/webframe.h
@@ -164,6 +164,9 @@ class WebFrame {
// frame with no parent.
virtual WebFrame* GetParent() const = 0;
+ // Returns the top-most frame in the frame hierarchy containing this frame.
+ virtual WebFrame* GetTop() 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
@@ -182,6 +185,9 @@ class WebFrame {
// unless it is AddRef'd separately by the caller.
virtual WebView* GetView() const = 0;
+ // Returns the serialization of the frame's security origin.
+ virtual std::string GetSecurityOrigin() const = 0;
+
// Fills the contents of this frame into the given string. If the text is
// longer than max_chars, it will be clipped to that length. Warning: this
// function may be slow depending on the number of characters retrieved and
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index 16a0bde8..13de844 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -688,6 +688,13 @@ WebFrame* WebFrameImpl::GetParent() const {
return NULL;
}
+WebFrame* WebFrameImpl::GetTop() const {
+ if (frame_)
+ return FromFrame(frame_->tree()->top());
+
+ return NULL;
+}
+
WebFrame* WebFrameImpl::GetChildFrame(const std::wstring& xpath) const {
// xpath string can represent a frame deep down the tree (across multiple
// frame DOMs).
@@ -754,6 +761,15 @@ WebView* WebFrameImpl::GetView() const {
return webview_impl_;
}
+std::string WebFrameImpl::GetSecurityOrigin() const {
+ if (frame_) {
+ if (frame_->document())
+ return webkit_glue::StringToStdString(
+ frame_->document()->securityOrigin()->toString());
+ }
+ return "null";
+}
+
void WebFrameImpl::BindToWindowObject(const std::wstring& name,
NPObject* object) {
assert(frame_);
diff --git a/webkit/glue/webframe_impl.h b/webkit/glue/webframe_impl.h
index f448fa3..c0b4616 100644
--- a/webkit/glue/webframe_impl.h
+++ b/webkit/glue/webframe_impl.h
@@ -105,8 +105,10 @@ class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> {
virtual void StopLoading();
virtual WebFrame* GetOpener() const;
virtual WebFrame* GetParent() const;
+ virtual WebFrame* GetTop() const;
virtual WebFrame* GetChildFrame(const std::wstring& xpath) const;
virtual WebView* GetView() const;
+ virtual std::string GetSecurityOrigin() const;
virtual bool CaptureImage(scoped_ptr<skia::BitmapPlatformDevice>* image,
bool scroll_to_zero);