OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_IMPORTER_IMPORTER_TYPE_H_ | |
6 #define CHROME_BROWSER_IMPORTER_IMPORTER_TYPE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "build/build_config.h" | |
11 | |
12 class Importer; | |
13 | |
14 namespace importer { | |
15 | |
16 // An enumeration of the type of importers that we support to import | |
17 // settings and data from (browsers, google toolbar and a bookmarks html file). | |
18 // NOTE: Numbers added so that data can be reliably cast to ints and passed | |
19 // across IPC. | |
20 enum ImporterType { | |
21 TYPE_UNKNOWN = -1, | |
22 #if defined(OS_WIN) | |
23 TYPE_IE = 0, | |
24 #endif | |
25 // Value 1 was the (now deleted) Firefox 2 profile importer. | |
26 TYPE_FIREFOX3 = 2, | |
27 #if defined(OS_MACOSX) | |
28 TYPE_SAFARI = 3, | |
29 #endif | |
30 // Value 4 was the (now deleted) Google Toolbar importer. | |
31 TYPE_BOOKMARKS_FILE = 5 // Identifies a 'bookmarks.html' file. | |
32 }; | |
33 | |
34 // Creates an Importer of the specified |type|. | |
35 Importer* CreateImporterByType(ImporterType type); | |
36 | |
37 // Logs to UMA that an Importer of the specified |type| was used. Uses | |
38 // |metric_postfix| to split by entry point. Note: Values passed via | |
39 // |metric_postfix| require a matching "Import.ImporterType.|metric_postfix|" | |
40 // entry in tools/metrics/histograms/histograms.xml. | |
41 void LogImporterUseToMetrics(const std::string& metric_prefix, | |
42 ImporterType type); | |
43 | |
44 } // namespace importer | |
45 | |
46 #endif // CHROME_BROWSER_IMPORTER_IMPORTER_TYPE_H_ | |
OLD | NEW |