Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: content/shell/browser/shell_devtools_frontend.cc

Issue 427143003: [DevTools] Move DevToolsClientHost functionality out of DevToolsFrontendHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/shell_devtools_frontend.cc
diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc
index e64685dcec5186c38d7eb6268a82601012415580..4b1aa1268710f5b3a18d826d938c103b85f99068 100644
--- a/content/shell/browser/shell_devtools_frontend.cc
+++ b/content/shell/browser/shell_devtools_frontend.cc
@@ -106,29 +106,21 @@ ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell,
: WebContentsObserver(frontend_shell->web_contents()),
frontend_shell_(frontend_shell),
agent_host_(agent_host) {
- frontend_host_.reset(
- DevToolsClientHost::CreateDevToolsFrontendHost(web_contents(), this));
+ frontend_host_.reset(DevToolsFrontendHost::Create(web_contents(), this));
+ DevToolsManager::GetInstance()->RegisterDevToolsClientHostFor(
+ agent_host_.get(), this);
}
ShellDevToolsFrontend::~ShellDevToolsFrontend() {
}
-void ShellDevToolsFrontend::RenderViewCreated(
- RenderViewHost* render_view_host) {
- DevToolsClientHost::SetupDevToolsFrontendClient(
- web_contents()->GetRenderViewHost());
- DevToolsManager* manager = DevToolsManager::GetInstance();
- manager->RegisterDevToolsClientHostFor(agent_host_.get(),
- frontend_host_.get());
-}
-
void ShellDevToolsFrontend::DocumentOnLoadCompletedInMainFrame() {
web_contents()->GetMainFrame()->ExecuteJavaScript(
base::ASCIIToUTF16("InspectorFrontendAPI.setUseSoftMenu(true);"));
}
void ShellDevToolsFrontend::WebContentsDestroyed() {
- DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get());
+ DevToolsManager::GetInstance()->ClientHostClosing(this);
delete this;
}
@@ -137,6 +129,21 @@ void ShellDevToolsFrontend::RenderProcessGone(base::TerminationStatus status) {
WebKitTestController::Get()->DevToolsProcessCrashed();
}
+bool ShellDevToolsFrontend::ShouldSetupDevToolsFrontendForUrl(const GURL& url) {
+ return true;
+}
+
+void ShellDevToolsFrontend::HandleMessageFromDevToolsFrontendToBackend(
+ const std::string& message) {
+ DevToolsManager::GetInstance()->DispatchOnInspectorBackend(
+ this, message);
+}
+
+void ShellDevToolsFrontend::DispatchOnInspectorFrontend(
+ const std::string& message) {
+ frontend_host_->DispatchOnDevToolsFrontend(message);
+}
+
void ShellDevToolsFrontend::InspectedContentsClosing() {
frontend_shell_->Close();
}

Powered by Google App Engine
This is Rietveld 408576698