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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 LoadFaviconImage(request_id); | 270 LoadFaviconImage(request_id); |
271 else | 271 else |
272 LoadDefaultImage(request_id); | 272 LoadDefaultImage(request_id); |
273 } | 273 } |
274 | 274 |
275 bool ExtensionIconSource::ParseData( | 275 bool ExtensionIconSource::ParseData( |
276 const std::string& path, | 276 const std::string& path, |
277 int request_id, | 277 int request_id, |
278 const content::URLDataSource::GotDataCallback& callback) { | 278 const content::URLDataSource::GotDataCallback& callback) { |
279 // Extract the parameters from the path by lower casing and splitting. | 279 // Extract the parameters from the path by lower casing and splitting. |
280 std::string path_lower = base::StringToLowerASCII(path); | 280 std::string path_lower = base::ToLowerASCII(path); |
281 std::vector<std::string> path_parts = base::SplitString( | 281 std::vector<std::string> path_parts = base::SplitString( |
282 path_lower, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 282 path_lower, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
283 if (path_lower.empty() || path_parts.size() < 3) | 283 if (path_lower.empty() || path_parts.size() < 3) |
284 return false; | 284 return false; |
285 | 285 |
286 std::string size_param = path_parts.at(1); | 286 std::string size_param = path_parts.at(1); |
287 std::string match_param = path_parts.at(2); | 287 std::string match_param = path_parts.at(2); |
288 match_param = match_param.substr(0, match_param.find('?')); | 288 match_param = match_param.substr(0, match_param.find('?')); |
289 | 289 |
290 int size; | 290 int size; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 std::map<int, ExtensionIconRequest*>::iterator i = | 341 std::map<int, ExtensionIconRequest*>::iterator i = |
342 request_map_.find(request_id); | 342 request_map_.find(request_id); |
343 if (i == request_map_.end()) | 343 if (i == request_map_.end()) |
344 return; | 344 return; |
345 | 345 |
346 delete i->second; | 346 delete i->second; |
347 request_map_.erase(i); | 347 request_map_.erase(i); |
348 } | 348 } |
349 | 349 |
350 } // namespace extensions | 350 } // namespace extensions |
OLD | NEW |