OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/devtools/devtools_http_handler_impl.h" | 5 #include "content/browser/devtools/devtools_http_handler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 return; | 341 return; |
342 } | 342 } |
343 | 343 |
344 std::string filename = PathWithoutParams(info.path.substr(10)); | 344 std::string filename = PathWithoutParams(info.path.substr(10)); |
345 std::string mime_type = GetMimeType(filename); | 345 std::string mime_type = GetMimeType(filename); |
346 | 346 |
347 base::FilePath frontend_dir = delegate_->GetDebugFrontendDir(); | 347 base::FilePath frontend_dir = delegate_->GetDebugFrontendDir(); |
348 if (!frontend_dir.empty()) { | 348 if (!frontend_dir.empty()) { |
349 base::FilePath path = frontend_dir.AppendASCII(filename); | 349 base::FilePath path = frontend_dir.AppendASCII(filename); |
350 std::string data; | 350 std::string data; |
351 file_util::ReadFileToString(path, &data); | 351 base::ReadFileToString(path, &data); |
352 server_->Send200(connection_id, data, mime_type); | 352 server_->Send200(connection_id, data, mime_type); |
353 return; | 353 return; |
354 } | 354 } |
355 if (delegate_->BundlesFrontendResources()) { | 355 if (delegate_->BundlesFrontendResources()) { |
356 int resource_id = DevToolsHttpHandler::GetFrontendResourceId(filename); | 356 int resource_id = DevToolsHttpHandler::GetFrontendResourceId(filename); |
357 if (resource_id != -1) { | 357 if (resource_id != -1) { |
358 base::StringPiece data = GetContentClient()->GetDataResource( | 358 base::StringPiece data = GetContentClient()->GetDataResource( |
359 resource_id, ui::SCALE_FACTOR_NONE); | 359 resource_id, ui::SCALE_FACTOR_NONE); |
360 server_->Send200(connection_id, data.as_string(), mime_type); | 360 server_->Send200(connection_id, data.as_string(), mime_type); |
361 return; | 361 return; |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 host.c_str(), | 862 host.c_str(), |
863 kPageUrlPrefix, | 863 kPageUrlPrefix, |
864 id.c_str())); | 864 id.c_str())); |
865 std::string devtools_frontend_url = GetFrontendURLInternal( | 865 std::string devtools_frontend_url = GetFrontendURLInternal( |
866 id.c_str(), | 866 id.c_str(), |
867 host); | 867 host); |
868 dictionary->SetString(kTargetDevtoolsFrontendUrlField, devtools_frontend_url); | 868 dictionary->SetString(kTargetDevtoolsFrontendUrlField, devtools_frontend_url); |
869 } | 869 } |
870 | 870 |
871 } // namespace content | 871 } // namespace content |
OLD | NEW |