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/search_engines/template_url_parser.h" | 5 #include "chrome/browser/search_engines/template_url_parser.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/string_util.h" | |
14 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "chrome/browser/search_engines/search_terms_data.h" | 16 #include "chrome/browser/search_engines/search_terms_data.h" |
17 #include "chrome/browser/search_engines/template_url.h" | 17 #include "chrome/browser/search_engines/template_url.h" |
18 #include "chrome/browser/search_engines/template_url_service.h" | 18 #include "chrome/browser/search_engines/template_url_service.h" |
19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
21 #include "libxml/parser.h" | 21 #include "libxml/parser.h" |
22 #include "libxml/xmlwriter.h" | 22 #include "libxml/xmlwriter.h" |
23 #include "ui/gfx/favicon_size.h" | 23 #include "ui/gfx/favicon_size.h" |
24 | 24 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 memset(&sax_handler, 0, sizeof(sax_handler)); | 493 memset(&sax_handler, 0, sizeof(sax_handler)); |
494 sax_handler.startElement = &TemplateURLParsingContext::StartElementImpl; | 494 sax_handler.startElement = &TemplateURLParsingContext::StartElementImpl; |
495 sax_handler.endElement = &TemplateURLParsingContext::EndElementImpl; | 495 sax_handler.endElement = &TemplateURLParsingContext::EndElementImpl; |
496 sax_handler.characters = &TemplateURLParsingContext::CharactersImpl; | 496 sax_handler.characters = &TemplateURLParsingContext::CharactersImpl; |
497 int error = xmlSAXUserParseMemory(&sax_handler, &context, data, | 497 int error = xmlSAXUserParseMemory(&sax_handler, &context, data, |
498 static_cast<int>(length)); | 498 static_cast<int>(length)); |
499 xmlSubstituteEntitiesDefault(last_sub_entities_value); | 499 xmlSubstituteEntitiesDefault(last_sub_entities_value); |
500 | 500 |
501 return error ? NULL : context.GetTemplateURL(profile, show_in_default_list); | 501 return error ? NULL : context.GetTemplateURL(profile, show_in_default_list); |
502 } | 502 } |
OLD | NEW |