summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authordgozman <dgozman@chromium.org>2014-09-01 05:18:10 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-01 12:28:51 +0000
commit05a779da69456df3c948a916b9c4d781879a3608 (patch)
treee5ca974b87907542adddd7cc89127e0aaa74a1e4 /chromecast
parentb3f4f911f40180c4bf2fdcab3c801d38d367d048 (diff)
downloadchromium_src-05a779da69456df3c948a916b9c4d781879a3608.zip
chromium_src-05a779da69456df3c948a916b9c4d781879a3608.tar.gz
chromium_src-05a779da69456df3c948a916b9c4d781879a3608.tar.bz2
Chromecast devtools delegate fixes.
This patch makes chromecast always bundle the frontend, and exposes all content targets via remote debugging. BUG=none Review URL: https://codereview.chromium.org/517493003 Cr-Commit-Position: refs/heads/master@{#292865}
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/shell/browser/devtools/cast_dev_tools_delegate.cc44
-rw-r--r--chromecast/shell/browser/devtools/remote_debugging_server.cc14
2 files changed, 13 insertions, 45 deletions
diff --git a/chromecast/shell/browser/devtools/cast_dev_tools_delegate.cc b/chromecast/shell/browser/devtools/cast_dev_tools_delegate.cc
index fa61a30..a3da54e 100644
--- a/chromecast/shell/browser/devtools/cast_dev_tools_delegate.cc
+++ b/chromecast/shell/browser/devtools/cast_dev_tools_delegate.cc
@@ -24,6 +24,7 @@ namespace {
const char kTargetTypePage[] = "page";
const char kTargetTypeServiceWorker[] = "service_worker";
+const char kTargetTypeSharedWorker[] = "worker";
const char kTargetTypeOther[] = "other";
class Target : public content::DevToolsTarget {
@@ -38,6 +39,8 @@ class Target : public content::DevToolsTarget {
return kTargetTypePage;
case content::DevToolsAgentHost::TYPE_SERVICE_WORKER:
return kTargetTypeServiceWorker;
+ case content::DevToolsAgentHost::TYPE_SHARED_WORKER:
+ return kTargetTypeSharedWorker;
default:
break;
}
@@ -47,7 +50,9 @@ class Target : public content::DevToolsTarget {
return agent_host_->GetTitle();
}
virtual std::string GetDescription() const OVERRIDE { return std::string(); }
- virtual GURL GetURL() const OVERRIDE { return url_; }
+ virtual GURL GetURL() const OVERRIDE {
+ return agent_host_->GetURL();
+ }
virtual GURL GetFaviconURL() const OVERRIDE { return favicon_url_; }
virtual base::TimeTicks GetLastActivityTime() const OVERRIDE {
return last_activity_time_;
@@ -59,14 +64,15 @@ class Target : public content::DevToolsTarget {
const OVERRIDE {
return agent_host_;
}
- virtual bool Activate() const OVERRIDE;
- virtual bool Close() const OVERRIDE;
+ virtual bool Activate() const OVERRIDE {
+ return agent_host_->Activate();
+ }
+ virtual bool Close() const OVERRIDE {
+ return agent_host_->Close();
+ }
private:
scoped_refptr<content::DevToolsAgentHost> agent_host_;
- std::string id_;
- std::string title_;
- GURL url_;
GURL favicon_url_;
base::TimeTicks last_activity_time_;
@@ -84,22 +90,6 @@ Target::Target(scoped_refptr<content::DevToolsAgentHost> agent_host)
}
}
-bool Target::Activate() const {
- content::WebContents* web_contents = agent_host_->GetWebContents();
- if (!web_contents)
- return false;
- web_contents->GetDelegate()->ActivateContents(web_contents);
- return true;
-}
-
-bool Target::Close() const {
- content::WebContents* web_contents = agent_host_->GetWebContents();
- if (!web_contents)
- return false;
- web_contents->GetRenderViewHost()->ClosePage();
- return true;
-}
-
} // namespace
CastDevToolsDelegate::CastDevToolsDelegate() {
@@ -109,22 +99,12 @@ 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)
- // Since Android remote debugging connects over a Unix domain socket, Chrome
- // will not load the same homepage.
- return false;
-#else
return true;
-#endif // defined(OS_ANDROID)
}
base::FilePath CastDevToolsDelegate::GetDebugFrontendDir() {
diff --git a/chromecast/shell/browser/devtools/remote_debugging_server.cc b/chromecast/shell/browser/devtools/remote_debugging_server.cc
index 57214f1..f34af1e 100644
--- a/chromecast/shell/browser/devtools/remote_debugging_server.cc
+++ b/chromecast/shell/browser/devtools/remote_debugging_server.cc
@@ -29,10 +29,6 @@ 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)
@@ -89,14 +85,6 @@ 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()
@@ -144,7 +132,7 @@ void RemoteDebuggingServer::OnPortChanged() {
if (port_ > 0) {
devtools_http_handler_ = content::DevToolsHttpHandler::Start(
CreateSocketFactory(port_),
- GetFrontendUrl(),
+ std::string(),
new CastDevToolsDelegate(),
base::FilePath());
LOG(INFO) << "Devtools started: port=" << port_;