OLD | NEW |
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_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ | 5 #ifndef CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ |
6 #define CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ | 6 #define CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 } | 33 } |
34 | 34 |
35 // Importer for Safari on OS X. | 35 // Importer for Safari on OS X. |
36 class SafariImporter : public Importer { | 36 class SafariImporter : public Importer { |
37 public: | 37 public: |
38 // |library_dir| is the full path to the ~/Library directory, | 38 // |library_dir| is the full path to the ~/Library directory, |
39 // We pass it in as a parameter for testing purposes. | 39 // We pass it in as a parameter for testing purposes. |
40 explicit SafariImporter(const base::FilePath& library_dir); | 40 explicit SafariImporter(const base::FilePath& library_dir); |
41 | 41 |
42 // Importer: | 42 // Importer: |
43 virtual void StartImport(const importer::SourceProfile& source_profile, | 43 void StartImport(const importer::SourceProfile& source_profile, |
44 uint16 items, | 44 uint16 items, |
45 ImporterBridge* bridge) override; | 45 ImporterBridge* bridge) override; |
46 | 46 |
47 private: | 47 private: |
48 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, BookmarkImport); | 48 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, BookmarkImport); |
49 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, | 49 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, |
50 BookmarkImportWithEmptyBookmarksMenu); | 50 BookmarkImportWithEmptyBookmarksMenu); |
51 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, FaviconImport); | 51 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, FaviconImport); |
52 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, HistoryImport); | 52 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, HistoryImport); |
53 | 53 |
54 virtual ~SafariImporter(); | 54 ~SafariImporter() override; |
55 | 55 |
56 // Multiple URLs can share the same favicon; this is a map | 56 // Multiple URLs can share the same favicon; this is a map |
57 // of URLs -> IconIDs that we load as a temporary step before | 57 // of URLs -> IconIDs that we load as a temporary step before |
58 // actually loading the icons. | 58 // actually loading the icons. |
59 typedef std::map<int64, std::set<GURL> > FaviconMap; | 59 typedef std::map<int64, std::set<GURL> > FaviconMap; |
60 | 60 |
61 void ImportBookmarks(); | 61 void ImportBookmarks(); |
62 void ImportPasswords(); | 62 void ImportPasswords(); |
63 void ImportHistory(); | 63 void ImportHistory(); |
64 | 64 |
(...skipping 30 matching lines...) Expand all Loading... |
95 void LoadFaviconData(sql::Connection* db, | 95 void LoadFaviconData(sql::Connection* db, |
96 const FaviconMap& favicon_map, | 96 const FaviconMap& favicon_map, |
97 std::vector<ImportedFaviconUsage>* favicons); | 97 std::vector<ImportedFaviconUsage>* favicons); |
98 | 98 |
99 base::FilePath library_dir_; | 99 base::FilePath library_dir_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(SafariImporter); | 101 DISALLOW_COPY_AND_ASSIGN(SafariImporter); |
102 }; | 102 }; |
103 | 103 |
104 #endif // CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ | 104 #endif // CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ |
OLD | NEW |