OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/shell_devtools_delegate.h" | 5 #include "content/shell/shell_devtools_delegate.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "content/public/browser/devtools_http_handler.h" | 9 #include "content/public/browser/devtools_http_handler.h" |
10 #include "grit/shell_resources.h" | 10 #include "grit/shell_resources.h" |
11 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
| 12 #include "ui/base/layout.h" |
12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 | 16 |
16 ShellDevToolsDelegate::ShellDevToolsDelegate( | 17 ShellDevToolsDelegate::ShellDevToolsDelegate( |
17 int port, | 18 int port, |
18 net::URLRequestContextGetter* context_getter) | 19 net::URLRequestContextGetter* context_getter) |
19 : context_getter_(context_getter) { | 20 : context_getter_(context_getter) { |
20 devtools_http_handler_ = DevToolsHttpHandler::Start( | 21 devtools_http_handler_ = DevToolsHttpHandler::Start( |
21 "127.0.0.1", | 22 "127.0.0.1", |
22 port, | 23 port, |
23 "", | 24 "", |
24 context_getter_, | 25 context_getter_, |
25 this); | 26 this); |
26 } | 27 } |
27 | 28 |
28 ShellDevToolsDelegate::~ShellDevToolsDelegate() { | 29 ShellDevToolsDelegate::~ShellDevToolsDelegate() { |
29 } | 30 } |
30 | 31 |
31 void ShellDevToolsDelegate::Stop() { | 32 void ShellDevToolsDelegate::Stop() { |
32 // The call below destroys this. | 33 // The call below destroys this. |
33 devtools_http_handler_->Stop(); | 34 devtools_http_handler_->Stop(); |
34 } | 35 } |
35 | 36 |
36 std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() { | 37 std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() { |
37 return ResourceBundle::GetSharedInstance().GetRawDataResource( | 38 return ResourceBundle::GetSharedInstance().GetRawDataResource( |
38 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string(); | 39 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE, |
| 40 ui::SCALE_FACTOR_NONE).as_string(); |
39 } | 41 } |
40 | 42 |
41 bool ShellDevToolsDelegate::BundlesFrontendResources() { | 43 bool ShellDevToolsDelegate::BundlesFrontendResources() { |
42 return true; | 44 return true; |
43 } | 45 } |
44 | 46 |
45 std::string ShellDevToolsDelegate::GetFrontendResourcesBaseURL() { | 47 std::string ShellDevToolsDelegate::GetFrontendResourcesBaseURL() { |
46 return ""; | 48 return ""; |
47 } | 49 } |
48 | 50 |
49 } // namespace content | 51 } // namespace content |
OLD | NEW |