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

Side by Side Diff: content/shell/shell_devtools_delegate.cc

Issue 10837177: Add a menu item to content_shell to open devtools to make it more discoverable. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix android compile, and add gtk support Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
8
9 #include "content/public/browser/devtools_http_handler.h" 7 #include "content/public/browser/devtools_http_handler.h"
10 #include "grit/shell_resources.h" 8 #include "grit/shell_resources.h"
11 #include "net/base/tcp_listen_socket.h" 9 #include "net/base/tcp_listen_socket.h"
12 #include "net/url_request/url_request_context_getter.h" 10 #include "net/url_request/url_request_context_getter.h"
13 #include "ui/base/layout.h" 11 #include "ui/base/layout.h"
14 #include "ui/base/resource/resource_bundle.h" 12 #include "ui/base/resource/resource_bundle.h"
15 13
16 namespace content { 14 namespace content {
17 15
18 ShellDevToolsDelegate::ShellDevToolsDelegate( 16 ShellDevToolsDelegate::ShellDevToolsDelegate(
19 int port,
20 net::URLRequestContextGetter* context_getter) 17 net::URLRequestContextGetter* context_getter)
21 : context_getter_(context_getter) { 18 : context_getter_(context_getter) {
22 devtools_http_handler_ = DevToolsHttpHandler::Start( 19 devtools_http_handler_ = DevToolsHttpHandler::Start(
23 new net::TCPListenSocketFactory("127.0.0.1", port), 20 new net::TCPListenSocketFactory("127.0.0.1", 0),
24 "", 21 "",
25 context_getter_, 22 context_getter_,
26 this); 23 this);
27 } 24 }
28 25
29 ShellDevToolsDelegate::~ShellDevToolsDelegate() { 26 ShellDevToolsDelegate::~ShellDevToolsDelegate() {
30 } 27 }
31 28
32 void ShellDevToolsDelegate::Stop() { 29 void ShellDevToolsDelegate::Stop() {
33 // The call below destroys this. 30 // The call below destroys this.
34 devtools_http_handler_->Stop(); 31 devtools_http_handler_->Stop();
35 } 32 }
36 33
37 std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() { 34 std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
38 return ResourceBundle::GetSharedInstance().GetRawDataResource( 35 return ResourceBundle::GetSharedInstance().GetRawDataResource(
39 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE, 36 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE,
40 ui::SCALE_FACTOR_NONE).as_string(); 37 ui::SCALE_FACTOR_NONE).as_string();
41 } 38 }
42 39
43 bool ShellDevToolsDelegate::BundlesFrontendResources() { 40 bool ShellDevToolsDelegate::BundlesFrontendResources() {
44 return true; 41 return true;
45 } 42 }
46 43
47 std::string ShellDevToolsDelegate::GetFrontendResourcesBaseURL() { 44 std::string ShellDevToolsDelegate::GetFrontendResourcesBaseURL() {
48 return ""; 45 return "";
49 } 46 }
50 47
51 } // namespace content 48 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698