1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/shell/shell_devtools_delegate.h"
7 #include "content/public/browser/devtools_http_handler.h"
8 #include "grit/shell_resources.h"
9 #include "net/base/tcp_listen_socket.h"
10 #include "net/url_request/url_request_context_getter.h"
11 #include "ui/base/layout.h"
12 #include "ui/base/resource/resource_bundle.h"
16 ShellDevToolsDelegate::ShellDevToolsDelegate(
18 net::URLRequestContextGetter
* context_getter
)
19 : context_getter_(context_getter
) {
20 devtools_http_handler_
= DevToolsHttpHandler::Start(
21 new net::TCPListenSocketFactory("127.0.0.1", port
),
27 ShellDevToolsDelegate::~ShellDevToolsDelegate() {
30 void ShellDevToolsDelegate::Stop() {
31 // The call below destroys this.
32 devtools_http_handler_
->Stop();
35 std::string
ShellDevToolsDelegate::GetDiscoveryPageHTML() {
36 return ResourceBundle::GetSharedInstance().GetRawDataResource(
37 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE
,
38 ui::SCALE_FACTOR_NONE
).as_string();
41 bool ShellDevToolsDelegate::BundlesFrontendResources() {
45 std::string
ShellDevToolsDelegate::GetFrontendResourcesBaseURL() {
49 } // namespace content