// Copyright 2013 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 "android_webview/browser/aw_devtools_delegate.h" #include "android_webview/browser/browser_view_renderer_impl.h" #include "base/bind.h" #include "base/json/json_writer.h" #include "base/stringprintf.h" #include "base/values.h" #include "content/public/browser/android/devtools_auth.h" #include "content/public/browser/devtools_http_handler.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" #include "net/socket/unix_domain_socket_posix.h" #include "ui/base/resource/resource_bundle.h" namespace { const char kSocketNameFormat[] = "webview_devtools_remote_%d"; } namespace android_webview { AwDevToolsDelegate::AwDevToolsDelegate(content::BrowserContext* browser_context) : browser_context_(browser_context) { devtools_http_handler_ = content::DevToolsHttpHandler::Start( new net::UnixDomainSocketWithAbstractNamespaceFactory( base::StringPrintf(kSocketNameFormat, getpid()), base::Bind(&content::CanUserConnectToDevTools)), "", this); } AwDevToolsDelegate::~AwDevToolsDelegate() { } void AwDevToolsDelegate::Stop() { devtools_http_handler_->Stop(); // WARNING: |this| has now been deleted by the method above. } std::string AwDevToolsDelegate::GetDiscoveryPageHTML() { // This is a temporary way of providing the list of inspectable WebViews. // Since WebView doesn't have its own resources now, it doesn't seem // reasonable to create a dedicated .pak file just for this temporary page. const char html[] = "" "
" "Only show:
" " " "Title | " "Attached | Visible | Empty | " "Position | " "Size | " "
---|