OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_ |
6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_ | 6 #define CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 | 10 |
11 class MetadataParserFactory; | 11 class MetadataParserFactory; |
| 12 class MetadataParser; |
| 13 |
| 14 namespace base { |
12 class FilePath; | 15 class FilePath; |
13 class MetadataParser; | 16 } |
14 | 17 |
15 // Metadata Parser manager is used to find the correct parser for a | 18 // Metadata Parser manager is used to find the correct parser for a |
16 // given file. Allows parsers to register themselves. | 19 // given file. Allows parsers to register themselves. |
17 class MetadataParserManager { | 20 class MetadataParserManager { |
18 public: | 21 public: |
19 // Creates a new MetadataParserManager. | 22 // Creates a new MetadataParserManager. |
20 MetadataParserManager(); | 23 MetadataParserManager(); |
21 ~MetadataParserManager(); | 24 ~MetadataParserManager(); |
22 | 25 |
23 // Gets the singleton | 26 // Gets the singleton |
24 static MetadataParserManager* GetInstance(); | 27 static MetadataParserManager* GetInstance(); |
25 | 28 |
26 // Adds a new Parser to the manager, when requests come in for a parser | 29 // Adds a new Parser to the manager, when requests come in for a parser |
27 // the manager will loop through the list of parsers, and query each. | 30 // the manager will loop through the list of parsers, and query each. |
28 bool RegisterParserFactory(MetadataParserFactory* parser); | 31 bool RegisterParserFactory(MetadataParserFactory* parser); |
29 | 32 |
30 // Returns a new metadata parser for a given file. | 33 // Returns a new metadata parser for a given file. |
31 MetadataParser* GetParserForFile(const FilePath& path); | 34 MetadataParser* GetParserForFile(const base::FilePath& path); |
32 | 35 |
33 private: | 36 private: |
34 ScopedVector<MetadataParserFactory> factories_; | 37 ScopedVector<MetadataParserFactory> factories_; |
35 | 38 |
36 DISALLOW_COPY_AND_ASSIGN(MetadataParserManager); | 39 DISALLOW_COPY_AND_ASSIGN(MetadataParserManager); |
37 }; | 40 }; |
38 | 41 |
39 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_ | 42 #endif // CHROME_BROWSER_PARSERS_METADATA_PARSER_MANAGER_H_ |
OLD | NEW |