您的位置:首页 > 移动开发 > Android开发

Android Chromium的标题代码运行路径

2015-12-03 14:43 477 查看
在ContentViewCore.java里:

@CalledByNative
private
void setTitle(String title) {
getContentViewClient().onUpdateTitle(title);
}
这里会调用:
WebChromeClient.onReceivedTitle.

调用ContentViewCore.setTitle的C++文件是:

content_view_core_impl.cc

void ContentViewCoreImpl::SetTitle(const base::string16& title) {

Java_ContentViewCore_setTitle(env, obj.obj(), jtitle.obj());
}

在web_contents/web_contents_view_android.cc中

void WebContentsViewAndroid::SetPageTitle(const base::string16& title) {
if (content_view_core_)
content_view_core_->SetTitle(title);
}
然后调用:
WebContentsImpl::UpdateTitleForEntry() {

view_->SetPageTitle(final_title);
}
这里会接收msg:

RenderViewHostImpl::OnUpdateTitle
{
}

void RenderViewImpl::UpdateTitle
{

Send(new ViewHostMsg_UpdateTitle(routing_id_, page_id_, shortened_title,
title_direction));
}

RenderViewImpl::didReceiveTitle{
UpdateTitle();
}

void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title)
{
if (m_webFrame->client())
m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectionLeftToRight);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: