Add ICU message format support
[chromium-blink-merge.git] / chrome / utility / importer / ie_importer_win.h
blob1d3803437d67ad2f983ca86d94ac8714632b09a7
1 // Copyright (c) 2012 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_UTILITY_IMPORTER_IE_IMPORTER_WIN_H_
6 #define CHROME_UTILITY_IMPORTER_IE_IMPORTER_WIN_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/files/file_path.h"
13 #include "base/gtest_prod_util.h"
14 #include "base/strings/string16.h"
15 #include "chrome/utility/importer/importer.h"
16 #include "components/favicon_base/favicon_usage_data.h"
18 struct ImportedBookmarkEntry;
20 class IEImporter : public Importer {
21 public:
22 IEImporter();
24 // Importer:
25 void StartImport(const importer::SourceProfile& source_profile,
26 uint16 items,
27 ImporterBridge* bridge) override;
29 private:
30 typedef std::vector<ImportedBookmarkEntry> BookmarkVector;
32 // A struct that hosts the information of IE Favorite folder.
33 struct FavoritesInfo {
34 base::FilePath path;
35 base::string16 links_folder;
38 // IE PStore subkey GUID: AutoComplete password & form data.
39 static const GUID kPStoreAutocompleteGUID;
41 // A fake GUID for unit test.
42 static const GUID kUnittestGUID;
44 FRIEND_TEST_ALL_PREFIXES(ImporterTest, IEImporter);
46 ~IEImporter() override;
48 void ImportFavorites();
50 // Reads history information from COM interface.
51 void ImportHistory();
53 // Import password for IE6 stored in protected storage.
54 void ImportPasswordsIE6();
56 // Import password for IE7 and IE8 stored in Storage2.
57 void ImportPasswordsIE7();
59 void ImportSearchEngines();
61 // Import the homepage setting of IE. Note: IE supports multiple home pages,
62 // whereas Chrome doesn't, so we import only the one defined under the
63 // 'Start Page' registry key. We don't import if the homepage is set to the
64 // machine default.
65 void ImportHomepage();
67 // Gets the information of Favorites folder. Returns true if successful.
68 bool GetFavoritesInfo(FavoritesInfo* info);
70 // This function will read the files in the Favorites folder, and store
71 // the bookmark items in |bookmarks| and favicon information in |favicons|.
72 void ParseFavoritesFolder(const FavoritesInfo& info,
73 BookmarkVector* bookmarks,
74 favicon_base::FaviconUsageDataList* favicons);
76 // Determines which version of IE is in use.
77 int CurrentIEVersion() const;
79 // IE does not have source path. It's used in unit tests only for providing a
80 // fake source.
81 base::FilePath source_path_;
83 DISALLOW_COPY_AND_ASSIGN(IEImporter);
86 #endif // CHROME_UTILITY_IMPORTER_IE_IMPORTER_WIN_H_