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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/shell_browser_main_parts.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_devtools_delegate_android.cc
diff --git a/content/shell/shell_devtools_delegate_android.cc b/content/shell/shell_devtools_delegate_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fd87fb3ab745821c70989ea4f74841187d35c229
--- /dev/null
+++ b/content/shell/shell_devtools_delegate_android.cc
@@ -0,0 +1,65 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/shell_devtools_delegate.h"
+
+#include "base/stringprintf.h"
+#include "content/public/browser/android/devtools_auth.h"
+#include "content/public/browser/devtools_http_handler.h"
+#include "grit/shell_resources.h"
+#include "net/base/unix_domain_socket_posix.h"
+#include "net/url_request/url_request_context_getter.h"
+#include "ui/base/layout.h"
+#include "ui/base/resource/resource_bundle.h"
+
+namespace {
+
+// TODO(mnaganov): This hardcoded version should be replaced with the webkit
+// revision of this build of content shell. This requires a feature addition
+// to the devtools frontend.
+const char* kFrontendVersion = "21.0.1175.0";
+const char kSocketName[] = "content_shell_devtools_remote";
+const char kFrontEndURL[] =
+ "http://chrome-devtools-frontend.appspot.com/static/%s/devtools.html";
+
+}
+
+namespace content {
+
+ShellDevToolsDelegate::ShellDevToolsDelegate(
+ int port,
+ net::URLRequestContextGetter* context_getter)
+ : context_getter_(context_getter) {
+ devtools_http_handler_ = DevToolsHttpHandler::Start(
+ new net::UnixDomainSocketWithAbstractNamespaceFactory(
+ kSocketName,
+ base::Bind(&CanUserConnectToDevTools)),
+ StringPrintf(kFrontEndURL, kFrontendVersion),
+ context_getter,
+ this);
+}
+
+ShellDevToolsDelegate::~ShellDevToolsDelegate() {
+}
+
+void ShellDevToolsDelegate::Stop() {
+ // The call below destroys this.
+ devtools_http_handler_->Stop();
+}
+
+std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_CONTENT_SHELL_DEVTOOLS_DISCOVERY_PAGE,
+ ui::SCALE_FACTOR_NONE).as_string();
+}
+
+bool ShellDevToolsDelegate::BundlesFrontendResources() {
+ return false;
+}
+
+std::string ShellDevToolsDelegate::GetFrontendResourcesBaseURL() {
+ return "";
+}
+
+} // namespace content
« 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