diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 82ba5970ed6..1ff21b694a0 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -25,6 +25,7 @@ #include "content/public/browser/host_zoom_map.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" +#include "content/public/common/user_agent.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher_response_writer.h" @@ -40,10 +41,14 @@ const double kPresetZoomFactors[] = { 0.25, 0.333, 0.5, 0.666, 0.75, 0.9, 1.0, const char kChromeUIDevToolsURL[] = "chrome-devtools://devtools/bundled/inspector.html?" + "remoteBase=%s&" "can_dock=%s&" "toolbarColor=rgba(223,223,223,1)&" "textColor=rgba(0,0,0,1)&" "experiments=true"; +const char kChromeUIDevToolsRemoteFrontendBase[] = + "https://chrome-devtools-frontend.appspot.com/"; +const char kChromeUIDevToolsRemoteFrontendPath[] = "serve_file"; const char kDevToolsBoundsPref[] = "brightray.devtools.bounds"; const char kDevToolsZoomPref[] = "brightray.devtools.zoom"; @@ -101,6 +106,14 @@ double GetNextZoomLevel(double level, bool out) { return level; } +GURL GetRemoteBaseURL() { + return GURL(base::StringPrintf( + "%s%s/%s/", + kChromeUIDevToolsRemoteFrontendBase, + kChromeUIDevToolsRemoteFrontendPath, + content::GetWebKitRevision().c_str())); +} + // ResponseWriter ------------------------------------------------------------- class ResponseWriter : public net::URLFetcherResponseWriter { @@ -241,7 +254,9 @@ void InspectableWebContentsImpl::ShowDevTools() { web_contents_->GetMainFrame(), this)); agent_host_->AttachClient(this); - GURL devtools_url(base::StringPrintf(kChromeUIDevToolsURL, can_dock_ ? "true" : "")); + GURL devtools_url(base::StringPrintf(kChromeUIDevToolsURL, + GetRemoteBaseURL().spec().c_str(), + can_dock_ ? "true" : "")); devtools_web_contents_->GetController().LoadURL( devtools_url, content::Referrer(),