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

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

Issue 2300703005: DevTools: merge devtools_http_handler into content - it is used in all the embedders anyways. (Closed)
Patch Set: for_landing! Created 4 years, 3 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
« no previous file with comments | « content/shell/browser/shell_devtools_manager_delegate.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_devtools_manager_delegate.cc
diff --git a/content/shell/browser/shell_devtools_manager_delegate.cc b/content/shell/browser/shell_devtools_manager_delegate.cc
index 957f36b239283f1a526ae2259748d473d767f760..b5854b3f7178db19e9504c5fd33fe54f0b8cd053 100644
--- a/content/shell/browser/shell_devtools_manager_delegate.cc
+++ b/content/shell/browser/shell_devtools_manager_delegate.cc
@@ -17,7 +17,6 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
-#include "components/devtools_http_handler/devtools_http_handler.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_frontend_host.h"
@@ -41,8 +40,6 @@
#include "net/socket/unix_domain_server_socket_posix.h"
#endif
-using devtools_http_handler::DevToolsHttpHandler;
-
namespace content {
namespace {
@@ -141,64 +138,31 @@ std::unique_ptr<content::DevToolsSocketFactory> CreateSocketFactory() {
#endif
}
-// ShellDevToolsDelegate ----------------------------------------------------
-
-class ShellDevToolsDelegate :
- public devtools_http_handler::DevToolsHttpHandlerDelegate {
- public:
- explicit ShellDevToolsDelegate();
- ~ShellDevToolsDelegate() override;
-
- // devtools_http_handler::DevToolsHttpHandlerDelegate implementation.
- std::string GetDiscoveryPageHTML() override;
- std::string GetFrontendResource(const std::string& path) override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ShellDevToolsDelegate);
-};
-
-ShellDevToolsDelegate::ShellDevToolsDelegate() {
-}
-
-ShellDevToolsDelegate::~ShellDevToolsDelegate() {
-}
-
-std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
-#if defined(OS_ANDROID)
- return std::string();
-#else
- return ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
-#endif
-}
-
-std::string ShellDevToolsDelegate::GetFrontendResource(
- const std::string& path) {
- return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
-}
-
-} // namespace
+} // namespace
// ShellDevToolsManagerDelegate ----------------------------------------------
// static
-DevToolsHttpHandler*
-ShellDevToolsManagerDelegate::CreateHttpHandler(
+void ShellDevToolsManagerDelegate::StartHttpHandler(
BrowserContext* browser_context) {
std::string frontend_url;
#if defined(OS_ANDROID)
frontend_url = base::StringPrintf(kFrontEndURL, GetWebKitRevision().c_str());
#endif
- return new DevToolsHttpHandler(
+ DevToolsAgentHost::StartRemoteDebuggingServer(
CreateSocketFactory(),
frontend_url,
- new ShellDevToolsDelegate(),
browser_context->GetPath(),
base::FilePath(),
std::string(),
GetShellUserAgent());
}
+// static
+void ShellDevToolsManagerDelegate::StopHttpHandler() {
+ DevToolsAgentHost::StopRemoteDebuggingServer();
+}
+
ShellDevToolsManagerDelegate::ShellDevToolsManagerDelegate(
BrowserContext* browser_context)
: browser_context_(browser_context) {
@@ -207,22 +171,6 @@ ShellDevToolsManagerDelegate::ShellDevToolsManagerDelegate(
ShellDevToolsManagerDelegate::~ShellDevToolsManagerDelegate() {
}
-base::DictionaryValue* ShellDevToolsManagerDelegate::HandleCommand(
- DevToolsAgentHost* agent_host,
- base::DictionaryValue* command_dict) {
- return nullptr;
-}
-
-std::string ShellDevToolsManagerDelegate::GetTargetType(RenderFrameHost* host) {
- return DevToolsAgentHost::kTypePage;
-}
-
-std::string ShellDevToolsManagerDelegate::GetTargetTitle(
- RenderFrameHost* host) {
- return "";
-}
-
-
scoped_refptr<DevToolsAgentHost>
ShellDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
Shell* shell = Shell::CreateNewWindow(browser_context_,
@@ -232,4 +180,18 @@ ShellDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
return DevToolsAgentHost::GetOrCreateFor(shell->web_contents());
}
+std::string ShellDevToolsManagerDelegate::GetDiscoveryPageHTML() {
+#if defined(OS_ANDROID)
+ return std::string();
+#else
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
+#endif
+}
+
+std::string ShellDevToolsManagerDelegate::GetFrontendResource(
+ const std::string& path) {
+ return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
+}
+
} // namespace content
« no previous file with comments | « content/shell/browser/shell_devtools_manager_delegate.h ('k') | content/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698