summaryrefslogtreecommitdiffstats
path: root/chrome/browser/parsers/metadata_parser_manager.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 23:18:12 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 23:18:12 +0000
commitfa89702052f10d610859e2d724a7262743fe7418 (patch)
tree8a3671e7dd6924bb181cdfbeec96a6f51232a38b /chrome/browser/parsers/metadata_parser_manager.h
parent0b0f60d96020eb44648869a7199520fd5b9f75e0 (diff)
downloadchromium_src-fa89702052f10d610859e2d724a7262743fe7418.zip
chromium_src-fa89702052f10d610859e2d724a7262743fe7418.tar.gz
chromium_src-fa89702052f10d610859e2d724a7262743fe7418.tar.bz2
Adding a new parsing system to the metadata url request.
BUG=none TEST=none Original review: http://codereview.chromium.org/155803 Patch by: dhg@google.com Review URL: http://codereview.chromium.org/160059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21469 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/parsers/metadata_parser_manager.h')
-rw-r--r--chrome/browser/parsers/metadata_parser_manager.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/browser/parsers/metadata_parser_manager.h b/chrome/browser/parsers/metadata_parser_manager.h
new file mode 100644
index 0000000..3249eb2
--- /dev/null
+++ b/chrome/browser/parsers/metadata_parser_manager.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_METADATA_PARSER_MANAGER_H_
+#define CHROME_BROWSER_METADATA_PARSER_MANAGER_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+
+class MetadataParserFactory;
+class FilePath;
+class MetadataParser;
+
+// Metadata Parser manager is used to find the correct parser for a
+// given file. Allows parsers to register themselves.
+class MetadataParserManager {
+ public:
+ // Creates a new MetadataParserManager.
+ MetadataParserManager();
+ ~MetadataParserManager();
+
+ // Gets the singleton
+ static MetadataParserManager* Get();
+
+ // Adds a new Parser to the manager, when requests come in for a parser
+ // the manager will loop through the list of parsers, and query each.
+ bool RegisterParserFactory(MetadataParserFactory* parser);
+
+ // Returns a new metadata parser for a given file.
+ MetadataParser* GetParserForFile(const FilePath& path);
+
+ private:
+ std::vector<MetadataParserFactory*> factories_;
+
+ DISALLOW_COPY_AND_ASSIGN(MetadataParserManager);
+};
+
+#endif // CHROME_BROWSER_METADATA_PARSER_MANAGER_H_