| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ios/web/webui/shared_resources_data_source_ios.h" | 5 #include "ios/web/webui/shared_resources_data_source_ios.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "grit/webui_resources_map.h" | |
| 13 #include "ios/web/public/web_client.h" | 12 #include "ios/web/public/web_client.h" |
| 14 #include "net/base/mime_util.h" | 13 #include "net/base/mime_util.h" |
| 15 #include "ui/base/webui/web_ui_util.h" | 14 #include "ui/base/webui/web_ui_util.h" |
| 16 #include "ui/resources/grit/webui_resources.h" | 15 #include "ui/resources/grit/webui_resources.h" |
| 16 #include "ui/resources/grit/webui_resources_map.h" |
| 17 | 17 |
| 18 namespace web { | 18 namespace web { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Value duplicated from content/public/common/url_constants.h | 22 // Value duplicated from content/public/common/url_constants.h |
| 23 // TODO(stuartmorgan): Revisit how to share this in a more maintainable way. | 23 // TODO(stuartmorgan): Revisit how to share this in a more maintainable way. |
| 24 const char kWebUIResourcesHost[] = "resources"; | 24 const char kWebUIResourcesHost[] = "resources"; |
| 25 | 25 |
| 26 int PathToIDR(const std::string& path) { | 26 int PathToIDR(const std::string& path) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 std::string SharedResourcesDataSourceIOS::GetMimeType( | 69 std::string SharedResourcesDataSourceIOS::GetMimeType( |
| 70 const std::string& path) const { | 70 const std::string& path) const { |
| 71 std::string mime_type; | 71 std::string mime_type; |
| 72 net::GetMimeTypeFromFile(base::FilePath().AppendASCII(path), &mime_type); | 72 net::GetMimeTypeFromFile(base::FilePath().AppendASCII(path), &mime_type); |
| 73 return mime_type; | 73 return mime_type; |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace web | 76 } // namespace web |
| OLD | NEW |