| 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 "chrome/browser/extensions/extension_protocols.h" | 5 #include "chrome/browser/extensions/extension_protocols.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Overridden from URLRequestSimpleJob: | 169 // Overridden from URLRequestSimpleJob: |
| 170 virtual int GetData(std::string* mime_type, | 170 virtual int GetData(std::string* mime_type, |
| 171 std::string* charset, | 171 std::string* charset, |
| 172 std::string* data, | 172 std::string* data, |
| 173 const net::CompletionCallback& callback) const OVERRIDE { | 173 const net::CompletionCallback& callback) const OVERRIDE { |
| 174 *mime_type = "text/html"; | 174 *mime_type = "text/html"; |
| 175 *charset = "utf-8"; | 175 *charset = "utf-8"; |
| 176 | 176 |
| 177 *data = "<!DOCTYPE html>\n<body>\n"; | 177 *data = "<!DOCTYPE html>\n<body>\n"; |
| 178 const std::vector<std::string>& background_scripts = | 178 const std::vector<std::string>& background_scripts = |
| 179 extensions::BackgroundInfo::GetBackgroundScripts(extension_); | 179 extensions::BackgroundInfo::GetBackgroundScripts(extension_.get()); |
| 180 for (size_t i = 0; i < background_scripts.size(); ++i) { | 180 for (size_t i = 0; i < background_scripts.size(); ++i) { |
| 181 *data += "<script src=\""; | 181 *data += "<script src=\""; |
| 182 *data += background_scripts[i]; | 182 *data += background_scripts[i]; |
| 183 *data += "\"></script>\n"; | 183 *data += "\"></script>\n"; |
| 184 } | 184 } |
| 185 | 185 |
| 186 return net::OK; | 186 return net::OK; |
| 187 } | 187 } |
| 188 | 188 |
| 189 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE { | 189 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE { |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 send_cors_header); | 512 send_cors_header); |
| 513 } | 513 } |
| 514 | 514 |
| 515 } // namespace | 515 } // namespace |
| 516 | 516 |
| 517 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( | 517 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( |
| 518 bool is_incognito, | 518 bool is_incognito, |
| 519 ExtensionInfoMap* extension_info_map) { | 519 ExtensionInfoMap* extension_info_map) { |
| 520 return new ExtensionProtocolHandler(is_incognito, extension_info_map); | 520 return new ExtensionProtocolHandler(is_incognito, extension_info_map); |
| 521 } | 521 } |
| OLD | NEW |