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/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 mime_type, charset, data, | 104 mime_type, charset, data, |
105 base::Owned(read_mime_type), | 105 base::Owned(read_mime_type), |
106 base::Owned(read_result), | 106 base::Owned(read_result), |
107 callback), | 107 callback), |
108 true /* task is slow */); | 108 true /* task is slow */); |
109 DCHECK(posted); | 109 DCHECK(posted); |
110 | 110 |
111 return net::ERR_IO_PENDING; | 111 return net::ERR_IO_PENDING; |
112 } | 112 } |
113 | 113 |
114 virtual void GetResponseInfo(net::HttpResponseInfo* info) { | 114 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE { |
115 *info = response_info_; | 115 *info = response_info_; |
116 } | 116 } |
117 | 117 |
118 private: | 118 private: |
119 virtual ~URLRequestResourceBundleJob() { } | 119 virtual ~URLRequestResourceBundleJob() { } |
120 | 120 |
121 void OnMimeTypeRead(std::string* out_mime_type, | 121 void OnMimeTypeRead(std::string* out_mime_type, |
122 std::string* charset, | 122 std::string* charset, |
123 std::string* data, | 123 std::string* data, |
124 std::string* read_mime_type, | 124 std::string* read_mime_type, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 *data = "<!DOCTYPE html>\n<body>\n"; | 170 *data = "<!DOCTYPE html>\n<body>\n"; |
171 for (size_t i = 0; i < extension_->background_scripts().size(); ++i) { | 171 for (size_t i = 0; i < extension_->background_scripts().size(); ++i) { |
172 *data += "<script src=\""; | 172 *data += "<script src=\""; |
173 *data += extension_->background_scripts()[i]; | 173 *data += extension_->background_scripts()[i]; |
174 *data += "\"></script>\n"; | 174 *data += "\"></script>\n"; |
175 } | 175 } |
176 | 176 |
177 return net::OK; | 177 return net::OK; |
178 } | 178 } |
179 | 179 |
180 virtual void GetResponseInfo(net::HttpResponseInfo* info) { | 180 virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE { |
181 *info = response_info_; | 181 *info = response_info_; |
182 } | 182 } |
183 | 183 |
184 private: | 184 private: |
185 virtual ~GeneratedBackgroundPageJob() {} | 185 virtual ~GeneratedBackgroundPageJob() {} |
186 | 186 |
187 scoped_refptr<const Extension> extension_; | 187 scoped_refptr<const Extension> extension_; |
188 net::HttpResponseInfo response_info_; | 188 net::HttpResponseInfo response_info_; |
189 }; | 189 }; |
190 | 190 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 send_cors_header); | 403 send_cors_header); |
404 } | 404 } |
405 | 405 |
406 } // namespace | 406 } // namespace |
407 | 407 |
408 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( | 408 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( |
409 bool is_incognito, | 409 bool is_incognito, |
410 ExtensionInfoMap* extension_info_map) { | 410 ExtensionInfoMap* extension_info_map) { |
411 return new ExtensionProtocolHandler(is_incognito, extension_info_map); | 411 return new ExtensionProtocolHandler(is_incognito, extension_info_map); |
412 } | 412 } |
OLD | NEW |