OLD | NEW |
| (Empty) |
1 // Copyright (c) 2006-2008 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_IE_IMPORTER_H_ | |
6 #define CHROME_BROWSER_IE_IMPORTER_H_ | |
7 | |
8 #include "chrome/browser/importer.h" | |
9 | |
10 class IEImporter : public Importer { | |
11 public: | |
12 IEImporter() {} | |
13 virtual ~IEImporter() {} | |
14 | |
15 // Importer methods. | |
16 virtual void StartImport(ProfileInfo browser_info, | |
17 uint16 items, | |
18 ProfileWriter* writer, | |
19 ImporterHost* host); | |
20 | |
21 private: | |
22 FRIEND_TEST(ImporterTest, IEImporter); | |
23 | |
24 void ImportFavorites(); | |
25 void ImportHistory(); | |
26 | |
27 // Import password for IE6 stored in protected storage. | |
28 void ImportPasswordsIE6(); | |
29 | |
30 // Import password for IE7 and IE8 stored in Storage2. | |
31 void ImportPasswordsIE7(); | |
32 | |
33 virtual void ImportSearchEngines(); | |
34 | |
35 // Import the homepage setting of IE. Note: IE supports multiple home pages, | |
36 // whereas Chrome doesn't, so we import only the one defined under the | |
37 // 'Start Page' registry key. We don't import if the homepage is set to the | |
38 // machine default. | |
39 void ImportHomepage(); | |
40 | |
41 // Resolves what's the .url file actually targets. | |
42 // Returns empty string if failed. | |
43 std::wstring ResolveInternetShortcut(const std::wstring& file); | |
44 | |
45 // A struct hosts the information of IE Favorite folder. | |
46 struct FavoritesInfo { | |
47 std::wstring path; | |
48 std::wstring links_folder; | |
49 // The creation time of the user's profile folder. | |
50 Time profile_creation_time; | |
51 }; | |
52 typedef std::vector<ProfileWriter::BookmarkEntry> BookmarkVector; | |
53 | |
54 // Gets the information of Favorites folder. Returns true if successful. | |
55 bool GetFavoritesInfo(FavoritesInfo* info); | |
56 | |
57 // This function will read the files in the Favorite folder, and store | |
58 // the bookmark items in |bookmarks|. | |
59 void ParseFavoritesFolder(const FavoritesInfo& info, | |
60 BookmarkVector* bookmarks); | |
61 | |
62 // Determines which version of IE is in use. | |
63 int CurrentIEVersion() const; | |
64 | |
65 // Hosts the writer used in this importer. | |
66 ProfileWriter* writer_; | |
67 | |
68 // IE PStore subkey GUID: AutoComplete password & form data. | |
69 static const GUID kPStoreAutocompleteGUID; | |
70 | |
71 // A fake GUID for unit test. | |
72 static const GUID kUnittestGUID; | |
73 | |
74 // A struct hosts the information of AutoComplete data in PStore. | |
75 struct AutoCompleteInfo { | |
76 std::wstring key; | |
77 std::vector<std::wstring> data; | |
78 bool is_url; | |
79 }; | |
80 | |
81 // IE does not have source path. It's used in unit tests only for | |
82 // providing a fake source. | |
83 std::wstring source_path_; | |
84 | |
85 DISALLOW_EVIL_CONSTRUCTORS(IEImporter); | |
86 }; | |
87 | |
88 #endif // CHROME_BROWSER_IE_IMPORTER_H_ | |
89 | |
OLD | NEW |