Commit f4c1193e authored by gunsch's avatar gunsch Committed by Commit bot

Chromecast: Android devtools needs remote frontend URL.

If not, this code blocks it from loading:
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/ui/webui/devtools_ui.cc&sq=package:chromium&type=cs&rcl=1411534708&l=343

R=dgozman@chromium.org,lcwu@chromium.org
BUG=400876

Review URL: https://codereview.chromium.org/607973004

Cr-Commit-Position: refs/heads/master@{#297433}
parent 4c9fc127
......@@ -101,12 +101,20 @@ CastDevToolsDelegate::~CastDevToolsDelegate() {
}
std::string CastDevToolsDelegate::GetDiscoveryPageHTML() {
#if defined(OS_ANDROID)
return std::string();
#else
return ResourceBundle::GetSharedInstance().GetRawDataResource(
IDR_CAST_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
#endif // defined(OS_ANDROID)
}
bool CastDevToolsDelegate::BundlesFrontendResources() {
#if defined(OS_ANDROID)
return false;
#else
return true;
#endif // defined(OS_ANDROID)
}
base::FilePath CastDevToolsDelegate::GetDebugFrontendDir() {
......
......@@ -29,6 +29,10 @@ namespace shell {
namespace {
#if defined(OS_ANDROID)
const char kFrontEndURL[] =
"http://chrome-devtools-frontend.appspot.com/serve_rev/%s/devtools.html";
#endif // defined(OS_ANDROID)
const int kDefaultRemoteDebuggingPort = 9222;
#if defined(OS_ANDROID)
......@@ -85,6 +89,14 @@ CreateSocketFactory(int port) {
#endif
}
std::string GetFrontendUrl() {
#if defined(OS_ANDROID)
return base::StringPrintf(kFrontEndURL, content::GetWebKitRevision().c_str());
#else
return std::string();
#endif // defined(OS_ANDROID)
}
} // namespace
RemoteDebuggingServer::RemoteDebuggingServer()
......@@ -132,7 +144,7 @@ void RemoteDebuggingServer::OnPortChanged() {
if (port_ > 0) {
devtools_http_handler_ = content::DevToolsHttpHandler::Start(
CreateSocketFactory(port_),
std::string(),
GetFrontendUrl(),
new CastDevToolsDelegate(),
base::FilePath());
LOG(INFO) << "Devtools started: port=" << port_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment