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

Unified Diff: content/shell/shell_devtools_delegate.cc

Issue 11033046: DevTools: [remote debugging] introduce json/new and json/close for creating and closing the tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments addressed Created 8 years, 2 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/shell_devtools_delegate.cc
diff --git a/content/shell/shell_devtools_delegate.cc b/content/shell/shell_devtools_delegate.cc
index 88821efb847eb8a7e0b8dac5f99435d46432b3e9..9f89fe6b15a084305a7e8f57c355fafc1fcb417d 100644
--- a/content/shell/shell_devtools_delegate.cc
+++ b/content/shell/shell_devtools_delegate.cc
@@ -5,6 +5,8 @@
#include "content/shell/shell_devtools_delegate.h"
#include "content/public/browser/devtools_http_handler.h"
+#include "content/public/browser/web_contents.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 +15,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 +50,13 @@ std::string ShellDevToolsDelegate::GetPageThumbnailData(const GURL& url) {
return "";
}
+RenderViewHost* ShellDevToolsDelegate::CreateNewTarget() {
+ Shell* shell = Shell::CreateNewWindow(browser_context_,
+ GURL("about:blank"),
jam 2012/10/05 16:19:17 nit: use kAboutBlankURL
+ NULL,
+ MSG_ROUTING_NONE,
+ NULL);
+ return shell->web_contents()->GetRenderViewHost();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698