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/ui/webui/extensions/extension_icon_source.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 LoadFaviconImage(request_id); | 268 LoadFaviconImage(request_id); |
269 else | 269 else |
270 LoadDefaultImage(request_id); | 270 LoadDefaultImage(request_id); |
271 } | 271 } |
272 | 272 |
273 bool ExtensionIconSource::ParseData( | 273 bool ExtensionIconSource::ParseData( |
274 const std::string& path, | 274 const std::string& path, |
275 int request_id, | 275 int request_id, |
276 const content::URLDataSource::GotDataCallback& callback) { | 276 const content::URLDataSource::GotDataCallback& callback) { |
277 // Extract the parameters from the path by lower casing and splitting. | 277 // Extract the parameters from the path by lower casing and splitting. |
278 std::string path_lower = StringToLowerASCII(path); | 278 std::string path_lower = base::StringToLowerASCII(path); |
279 std::vector<std::string> path_parts; | 279 std::vector<std::string> path_parts; |
280 | 280 |
281 base::SplitString(path_lower, '/', &path_parts); | 281 base::SplitString(path_lower, '/', &path_parts); |
282 if (path_lower.empty() || path_parts.size() < 3) | 282 if (path_lower.empty() || path_parts.size() < 3) |
283 return false; | 283 return false; |
284 | 284 |
285 std::string size_param = path_parts.at(1); | 285 std::string size_param = path_parts.at(1); |
286 std::string match_param = path_parts.at(2); | 286 std::string match_param = path_parts.at(2); |
287 match_param = match_param.substr(0, match_param.find('?')); | 287 match_param = match_param.substr(0, match_param.find('?')); |
288 | 288 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 std::map<int, ExtensionIconRequest*>::iterator i = | 340 std::map<int, ExtensionIconRequest*>::iterator i = |
341 request_map_.find(request_id); | 341 request_map_.find(request_id); |
342 if (i == request_map_.end()) | 342 if (i == request_map_.end()) |
343 return; | 343 return; |
344 | 344 |
345 delete i->second; | 345 delete i->second; |
346 request_map_.erase(i); | 346 request_map_.erase(i); |
347 } | 347 } |
348 | 348 |
349 } // namespace extensions | 349 } // namespace extensions |
OLD | NEW |