Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: chrome/browser/template_url_parser.h

Issue 18263: Move search engines files into subdir (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/template_url_model_unittest.cc ('k') | chrome/browser/template_url_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_TEMPLATE_URL_PARSER_H__
6 #define CHROME_BROWSER_TEMPLATE_URL_PARSER_H__
7
8 #include <string>
9
10 #include "base/basictypes.h"
11
12 class TemplateURL;
13
14 // TemplateURLParser, as the name implies, handling reading of TemplateURLs
15 // from OpenSearch description documents.
16 class TemplateURLParser {
17 public:
18 class ParameterFilter {
19 public:
20 // Invoked for each parameter of the template URL while parsing. If this
21 // methods returns false, the parameter is not included.
22 virtual bool KeepParameter(const std::string& key,
23 const std::string& value) = 0;
24 };
25 // Decodes the chunk of data representing a TemplateURL. If data does
26 // not describe a valid TemplateURL false is returned. Additionally, if the
27 // URLs referenced do not point to valid http/https resources, false is
28 // returned. |parameter_filter| can be used if you want to filter out some
29 // parameters out of the URL. For example when importing from another browser
30 // we remove any parameter identifying that browser. If set to NULL, the URL
31 // is not modified.
32 //
33 // NOTE: This does not clear all values of the supplied TemplateURL; it's
34 // expected callers will supply a new TemplateURL to this method.
35 static bool Parse(const unsigned char* data,
36 size_t length,
37 ParameterFilter* parameter_filter,
38 TemplateURL* url);
39
40 private:
41 // No one should create one of these.
42 TemplateURLParser();
43
44 DISALLOW_EVIL_CONSTRUCTORS(TemplateURLParser);
45 };
46
47 #endif // CHROME_BROWSER_TEMPLATE_URL_PARSER_H__
48
OLDNEW
« no previous file with comments | « chrome/browser/template_url_model_unittest.cc ('k') | chrome/browser/template_url_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698