summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 16:56:00 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-10 16:56:00 +0000
commiteb040998b02d1514cb008cd141925581ad9d2433 (patch)
tree7c067f61bcd9638ebb3bb8ffa460bb0b57dab0da /content/shell
parent24096b830384fc6c73b15d12bffaee12800f2696 (diff)
downloadchromium_src-eb040998b02d1514cb008cd141925581ad9d2433.zip
chromium_src-eb040998b02d1514cb008cd141925581ad9d2433.tar.gz
chromium_src-eb040998b02d1514cb008cd141925581ad9d2433.tar.bz2
DevTools: [remote debugging] introduce json/new and json/close for creating and closing the tabs.
Review URL: https://chromiumcodereview.appspot.com/11033046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/shell_browser_main_parts.cc2
-rw-r--r--content/shell/shell_devtools_delegate.cc16
-rw-r--r--content/shell/shell_devtools_delegate.h5
-rw-r--r--content/shell/shell_devtools_delegate_android.cc8
4 files changed, 27 insertions, 4 deletions
diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc
index 25e500f..72faa6c 100644
--- a/content/shell/shell_browser_main_parts.cc
+++ b/content/shell/shell_browser_main_parts.cc
@@ -127,7 +127,7 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
}
}
#endif
- devtools_delegate_ = new ShellDevToolsDelegate(port);
+ devtools_delegate_ = new ShellDevToolsDelegate(browser_context_.get(), port);
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
Shell::CreateNewWindow(browser_context_.get(),
diff --git a/content/shell/shell_devtools_delegate.cc b/content/shell/shell_devtools_delegate.cc
index 88821ef..24a51be 100644
--- a/content/shell/shell_devtools_delegate.cc
+++ b/content/shell/shell_devtools_delegate.cc
@@ -5,6 +5,9 @@
#include "content/shell/shell_devtools_delegate.h"
#include "content/public/browser/devtools_http_handler.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/common/url_constants.h"
+#include "content/shell/shell.h"
#include "grit/shell_resources.h"
#include "net/base/tcp_listen_socket.h"
#include "net/url_request/url_request_context_getter.h"
@@ -13,7 +16,9 @@
namespace content {
-ShellDevToolsDelegate::ShellDevToolsDelegate(int port) {
+ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context,
+ int port)
+ : browser_context_(browser_context) {
devtools_http_handler_ = DevToolsHttpHandler::Start(
new net::TCPListenSocketFactory("127.0.0.1", port),
"",
@@ -46,4 +51,13 @@ std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) {
return "";
}
+RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() {
+ Shell* shell = Shell::CreateNewWindow(browser_context_,
+ GURL(chrome::kAboutBlankURL),
+ NULL,
+ MSG_ROUTING_NONE,
+ NULL);
+ return shell->web_contents()->GetRenderViewHost();
+}
+
} // namespace content
diff --git a/content/shell/shell_devtools_delegate.h b/content/shell/shell_devtools_delegate.h
index 19557c1..96c99ef 100644
--- a/content/shell/shell_devtools_delegate.h
+++ b/content/shell/shell_devtools_delegate.h
@@ -13,11 +13,12 @@
namespace content {
+class BrowserContext;
class DevToolsHttpHandler;
class ShellDevToolsDelegate : public DevToolsHttpHandlerDelegate {
public:
- explicit ShellDevToolsDelegate(int port);
+ ShellDevToolsDelegate(BrowserContext* browser_context, int port);
virtual ~ShellDevToolsDelegate();
// Stops http server.
@@ -28,12 +29,14 @@ class ShellDevToolsDelegate : public DevToolsHttpHandlerDelegate {
virtual bool BundlesFrontendResources() OVERRIDE;
virtual FilePath GetDebugFrontendDir() OVERRIDE;
virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE;
+ virtual RenderViewHost* CreateNewTarget() OVERRIDE;
DevToolsHttpHandler* devtools_http_handler() {
return devtools_http_handler_;
}
private:
+ BrowserContext* browser_context_;
DevToolsHttpHandler* devtools_http_handler_;
DISALLOW_COPY_AND_ASSIGN(ShellDevToolsDelegate);
diff --git a/content/shell/shell_devtools_delegate_android.cc b/content/shell/shell_devtools_delegate_android.cc
index 59098f9..60db1e6 100644
--- a/content/shell/shell_devtools_delegate_android.cc
+++ b/content/shell/shell_devtools_delegate_android.cc
@@ -27,7 +27,9 @@ const char kFrontEndURL[] =
namespace content {
-ShellDevToolsDelegate::ShellDevToolsDelegate(int port) {
+ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context,
+ int port)
+ : browser_context_(browser_context) {
devtools_http_handler_ = DevToolsHttpHandler::Start(
new net::UnixDomainSocketWithAbstractNamespaceFactory(
kSocketName,
@@ -62,4 +64,8 @@ std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) {
return "";
}
+RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() {
+ return NULL;
+}
+
} // namespace content