Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: chrome/browser/importer/ie_importer.h

Issue 14575004: Extract BookmarksFileImporter from Firefox2Importer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test cleanup Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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_IMPORTER_IE_IMPORTER_H_ 5 #ifndef CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_
6 #define CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_ 6 #define CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/string16.h" 14 #include "base/string16.h"
15 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h" 15 #include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h"
16 #include "chrome/browser/importer/importer.h" 16 #include "chrome/browser/importer/importer.h"
17 #include "chrome/browser/importer/profile_writer.h" 17
18 struct ImportedBookmarkEntry;
19 struct ImportedFaviconUsage;
18 20
19 class IEImporter : public Importer { 21 class IEImporter : public Importer {
20 public: 22 public:
21 IEImporter(); 23 IEImporter();
22 24
23 // Importer: 25 // Importer:
24 virtual void StartImport(const importer::SourceProfile& source_profile, 26 virtual void StartImport(const importer::SourceProfile& source_profile,
25 uint16 items, 27 uint16 items,
26 ImporterBridge* bridge) OVERRIDE; 28 ImporterBridge* bridge) OVERRIDE;
27 29
28 private: 30 private:
29 typedef std::vector<ProfileWriter::BookmarkEntry> BookmarkVector; 31 typedef std::vector<ImportedBookmarkEntry> BookmarkVector;
30 32
31 // A struct that hosts the information of IE Favorite folder. 33 // A struct that hosts the information of IE Favorite folder.
32 struct FavoritesInfo { 34 struct FavoritesInfo {
33 base::FilePath path; 35 base::FilePath path;
34 string16 links_folder; 36 string16 links_folder;
35 }; 37 };
36 38
37 // IE PStore subkey GUID: AutoComplete password & form data. 39 // IE PStore subkey GUID: AutoComplete password & form data.
38 static const GUID kPStoreAutocompleteGUID; 40 static const GUID kPStoreAutocompleteGUID;
39 41
(...skipping 24 matching lines...) Expand all
64 void ImportHomepage(); 66 void ImportHomepage();
65 67
66 // Gets the information of Favorites folder. Returns true if successful. 68 // Gets the information of Favorites folder. Returns true if successful.
67 bool GetFavoritesInfo(FavoritesInfo* info); 69 bool GetFavoritesInfo(FavoritesInfo* info);
68 70
69 // This function will read the files in the Favorites folder, and store 71 // This function will read the files in the Favorites folder, and store
70 // the bookmark items in |bookmarks| and favicon information in |favicons|. 72 // the bookmark items in |bookmarks| and favicon information in |favicons|.
71 void ParseFavoritesFolder( 73 void ParseFavoritesFolder(
72 const FavoritesInfo& info, 74 const FavoritesInfo& info,
73 BookmarkVector* bookmarks, 75 BookmarkVector* bookmarks,
74 std::vector<history::ImportedFaviconUsage>* favicons); 76 std::vector<ImportedFaviconUsage>* favicons);
75 77
76 // Determines which version of IE is in use. 78 // Determines which version of IE is in use.
77 int CurrentIEVersion() const; 79 int CurrentIEVersion() const;
78 80
79 // IE does not have source path. It's used in unit tests only for providing a 81 // IE does not have source path. It's used in unit tests only for providing a
80 // fake source. 82 // fake source.
81 base::FilePath source_path_; 83 base::FilePath source_path_;
82 84
83 // Used to override the registry for IEImporterTests if needed. 85 // Used to override the registry for IEImporterTests if needed.
84 IEImporterTestRegistryOverrider test_registry_overrider_; 86 IEImporterTestRegistryOverrider test_registry_overrider_;
85 87
86 DISALLOW_COPY_AND_ASSIGN(IEImporter); 88 DISALLOW_COPY_AND_ASSIGN(IEImporter);
87 }; 89 };
88 90
89 #endif // CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_ 91 #endif // CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698