Expose unique identifiers for frames and the ability to retrieve a frame's parent frame (issue #450).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@410 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-12-08 11:44:30 +00:00
parent ef64033467
commit 64f91d5d9b
9 changed files with 281 additions and 5 deletions

View File

@@ -609,6 +609,39 @@ void CefBrowserImpl::ExecuteJavaScript(CefRefPtr<CefFrame> frame,
startLine));
}
long long CefBrowserImpl::GetIdentifier(CefRefPtr<CefFrame> frame)
{
// Verify that this method is being called on the UI thread.
if (!CefThread::CurrentlyOn(CefThread::UI)) {
NOTREACHED() << "called on invalid thread";
return 0;
}
WebFrame* web_frame = UIT_GetWebFrame(frame);
if(web_frame)
return web_frame->identifier();
return 0;
}
CefRefPtr<CefFrame> CefBrowserImpl::GetParent(CefRefPtr<CefFrame> frame)
{
// Verify that this method is being called on the UI thread.
if (!CefThread::CurrentlyOn(CefThread::UI)) {
NOTREACHED() << "called on invalid thread";
return NULL;
}
WebFrame* web_frame = UIT_GetWebFrame(frame);
if(web_frame) {
if (web_frame->parent() == NULL) {
// This is the main frame.
return NULL;
}
return UIT_GetCefFrame(web_frame->parent());
}
return NULL;
}
CefString CefBrowserImpl::GetURL(CefRefPtr<CefFrame> frame)
{
// Verify that this method is being called on the UI thread.