importer_data_types.h revision 731df977c0511bca2206b5f333555b1205ff1f43
1// Copyright (c) 2010 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_DATA_TYPES_H_
6#define CHROME_BROWSER_IMPORTER_IMPORTER_DATA_TYPES_H_
7#pragma once
8
9#include <string>
10
11#include "base/basictypes.h"
12#include "base/file_path.h"
13
14// Types needed for importing data from other browsers and the Google
15// Toolbar.
16namespace importer {
17
18// An enumeration of the type of data that can be imported.
19enum ImportItem {
20  NONE           = 0,
21  HISTORY        = 1 << 0,
22  FAVORITES      = 1 << 1,
23  COOKIES        = 1 << 2,  // Not supported yet.
24  PASSWORDS      = 1 << 3,
25  SEARCH_ENGINES = 1 << 4,
26  HOME_PAGE      = 1 << 5,
27  ALL            = (1 << 6) - 1  // All the bits should be 1, hence the -1.
28};
29
30// An enumeration of the type of browsers that we support to import
31// settings and data from them.  Numbers added so that data can be
32// reliably cast to ints and passed across IPC.
33enum ProfileType {
34  NO_PROFILE_TYPE = -1,
35#if defined(OS_WIN)
36  MS_IE = 0,
37#endif
38  FIREFOX2 = 1,
39  FIREFOX3 = 2,  // Firefox 3 and later.
40#if defined(OS_MACOSX)
41  SAFARI = 3,
42#endif
43  GOOGLE_TOOLBAR5 = 4,
44  // Identifies a 'bookmarks.html' file.
45  BOOKMARKS_HTML = 5
46};
47
48// Information about a profile needed by an importer to do import work.
49struct ProfileInfo {
50  ProfileInfo();
51  ~ProfileInfo();
52
53  std::wstring description;
54  importer::ProfileType browser_type;
55  FilePath source_path;
56  FilePath app_path;
57  uint16 services_supported;  // Bitmask of ImportItem.
58};
59
60}  // namespace importer
61
62#endif  // CHROME_BROWSER_IMPORTER_IMPORTER_DATA_TYPES_H_
63
64