| 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 "components/search_engines/template_url_parser.h" | 5 #include "components/search_engines/template_url_parser.h" |
| 6 | 6 |
| 7 #include <string.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <map> | 10 #include <map> |
| 9 #include <vector> | 11 #include <vector> |
| 10 | 12 |
| 11 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 16 #include "components/search_engines/search_terms_data.h" | 19 #include "components/search_engines/search_terms_data.h" |
| 17 #include "components/search_engines/template_url.h" | 20 #include "components/search_engines/template_url.h" |
| 18 #include "libxml/parser.h" | 21 #include "libxml/parser.h" |
| 19 #include "libxml/xmlwriter.h" | 22 #include "libxml/xmlwriter.h" |
| 20 #include "ui/gfx/favicon_size.h" | 23 #include "ui/gfx/favicon_size.h" |
| 21 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 sax_handler.startElement = &TemplateURLParsingContext::StartElementImpl; | 508 sax_handler.startElement = &TemplateURLParsingContext::StartElementImpl; |
| 506 sax_handler.endElement = &TemplateURLParsingContext::EndElementImpl; | 509 sax_handler.endElement = &TemplateURLParsingContext::EndElementImpl; |
| 507 sax_handler.characters = &TemplateURLParsingContext::CharactersImpl; | 510 sax_handler.characters = &TemplateURLParsingContext::CharactersImpl; |
| 508 int error = xmlSAXUserParseMemory(&sax_handler, &context, data, | 511 int error = xmlSAXUserParseMemory(&sax_handler, &context, data, |
| 509 static_cast<int>(length)); | 512 static_cast<int>(length)); |
| 510 xmlSubstituteEntitiesDefault(last_sub_entities_value); | 513 xmlSubstituteEntitiesDefault(last_sub_entities_value); |
| 511 | 514 |
| 512 return error ? | 515 return error ? |
| 513 NULL : context.GetTemplateURL(search_terms_data, show_in_default_list); | 516 NULL : context.GetTemplateURL(search_terms_data, show_in_default_list); |
| 514 } | 517 } |
| OLD | NEW |