Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / parsers / metadata_parser_manager.h
blob2d5a759806442b7222d9038d67f54a06736ec0c9
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;
12 class MetadataParser;
14 namespace base {
15 class FilePath;
18 // Metadata Parser manager is used to find the correct parser for a
19 // given file. Allows parsers to register themselves.
20 class MetadataParserManager {
21 public:
22 // Creates a new MetadataParserManager.
23 MetadataParserManager();
24 ~MetadataParserManager();
26 // Gets the singleton
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);
36 private:
37 ScopedVector<MetadataParserFactory> factories_;
39 DISALLOW_COPY_AND_ASSIGN(MetadataParserManager);
42 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_