This commit is contained in:
Cheng Zhao 2014-10-11 19:00:30 +08:00
Родитель 5bec155c81
Коммит 733931c7ad
2 изменённых файлов: 12 добавлений и 5 удалений

Просмотреть файл

@ -165,8 +165,9 @@ void InspectableWebContentsImpl::ShowDevTools() {
devtools_web_contents_->SetDelegate(this);
agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_.get());
content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(
agent_host_, this);
frontend_host_.reset(content::DevToolsFrontendHost::Create(
web_contents_->GetRenderViewHost(), this));
content::DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(agent_host_, this);
GURL devtools_url(kChromeUIDevToolsURL);
devtools_web_contents_->GetController().LoadURL(
@ -323,6 +324,12 @@ void InspectableWebContentsImpl::InspectedContentsClosing() {
void InspectableWebContentsImpl::ReplacedWithAnotherClient() {
}
void InspectableWebContentsImpl::AboutToNavigateRenderView(
content::RenderViewHost* render_view_host) {
frontend_host_.reset(content::DevToolsFrontendHost::Create(
render_view_host, this));
}
void InspectableWebContentsImpl::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) {
if (render_frame_host->GetParent())

Просмотреть файл

@ -102,8 +102,8 @@ class InspectableWebContentsImpl :
virtual void HandleMessageFromDevToolsFrontend(const std::string& message) override;
virtual void HandleMessageFromDevToolsFrontendToBackend(const std::string& message) override;
// content::WebContentsObserver
// content::WebContentsObserver:
virtual void AboutToNavigateRenderView(content::RenderViewHost* render_view_host) override;
virtual void DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
@ -120,10 +120,10 @@ class InspectableWebContentsImpl :
virtual void CloseContents(content::WebContents* source) OVERRIDE;
scoped_ptr<content::WebContents> web_contents_;
scoped_ptr<content::DevToolsClientHost> frontend_host_;
scoped_ptr<content::WebContents> devtools_web_contents_;
scoped_ptr<InspectableWebContentsView> view_;
scoped_refptr<content::DevToolsAgentHost> agent_host_;
scoped_ptr<content::DevToolsFrontendHost> frontend_host_;
DevToolsContentsResizingStrategy contents_resizing_strategy_;
gfx::Rect devtools_bounds_;