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

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

Issue 10832112: Simplify devtools code on android and enable devtools for android content_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Pavel's comments 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
« no previous file with comments | « content/shell/shell_browser_main_parts.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "content/shell/shell_devtools_delegate.h"
6
7 #include "base/stringprintf.h"
8 #include "content/public/browser/android/devtools_auth.h"
9 #include "content/public/browser/devtools_http_handler.h"
10 #include "grit/shell_resources.h"
11 #include "net/base/unix_domain_socket_posix.h"
12 #include "net/url_request/url_request_context_getter.h"
13 #include "ui/base/layout.h"
14 #include "ui/base/resource/resource_bundle.h"
15
16 namespace {
17
18 // TODO(mnaganov): This hardcoded version should be replaced with the webkit
19 // revision of this build of content shell. This requires a feature addition
20 // to the devtools frontend.
21 const char* kFrontendVersion = "21.0.1175.0";
22 const char kSocketName[] = "content_shell_devtools_remote";
23 const char kFrontEndURL[] =
24 "http://chrome-devtools-frontend.appspot.com/static/%s/devtools.html";
25
26 }
27
28 namespace content {
29
30 ShellDevToolsDelegate::ShellDevToolsDelegate(
31 int port,
32 net::URLRequestContextGetter* context_getter)
33 : context_getter_(context_getter) {
34 devtools_http_handler_ = DevToolsHttpHandler::Start(
35 new net::UnixDomainSocketWithAbstractNamespaceFactory(
36 kSocketName,
37 base::Bind(&CanUserConnectToDevTools)),
38 StringPrintf(kFrontEndURL, kFrontendVersion),
39 context_getter,
40 this);
41 }
42
43 ShellDevToolsDelegate::~ShellDevToolsDelegate() {
44 }
45
46 void ShellDevToolsDelegate::Stop() {
47 // The call below destroys this.
48 devtools_http_handler_->Stop();
49 }
50
51 std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
52 return ResourceBundle::GetSharedInstance().GetRawDataResource(
53 IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE,
54 ui::SCALE_FACTOR_NONE).as_string();
55 }
56
57 bool ShellDevToolsDelegate::BundlesFrontendResources() {
58 return false;
59 }
60
61 std::string ShellDevToolsDelegate::GetFrontendResourcesBaseURL() {
62 return "";
63 }
64
65 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell_browser_main_parts.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698