1 // Copyright (c) 2011 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.
5 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_
6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_vector.h"
11 class MetadataParserFactory
;
18 // Metadata Parser manager is used to find the correct parser for a
19 // given file. Allows parsers to register themselves.
20 class MetadataParserManager
{
22 // Creates a new MetadataParserManager.
23 MetadataParserManager();
24 ~MetadataParserManager();
27 static MetadataParserManager
* GetInstance();
29 // Adds a new Parser to the manager, when requests come in for a parser
30 // the manager will loop through the list of parsers, and query each.
31 bool RegisterParserFactory(MetadataParserFactory
* parser
);
33 // Returns a new metadata parser for a given file.
34 MetadataParser
* GetParserForFile(const base::FilePath
& path
);
37 ScopedVector
<MetadataParserFactory
> factories_
;
39 DISALLOW_COPY_AND_ASSIGN(MetadataParserManager
);
42 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_