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 26 matching lines...) Expand all Loading... |
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 virtual void StartImport(const importer::SourceProfile& source_profile, |
44 uint16 items, | 44 uint16 items, |
45 ImporterBridge* bridge) OVERRIDE; | 45 ImporterBridge* bridge) OVERRIDE; |
46 | 46 |
47 // Does this user account have a Safari Profile and if so, what items | |
48 // are supported? | |
49 // in: library_dir - ~/Library or a standin for testing purposes. | |
50 // out: services_supported - the service supported for import. | |
51 // Returns true if we can import the Safari profile. | |
52 static bool CanImport(const base::FilePath& library_dir, | |
53 uint16* services_supported); | |
54 | |
55 private: | 47 private: |
56 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, BookmarkImport); | 48 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, BookmarkImport); |
57 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, FaviconImport); | 49 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, FaviconImport); |
58 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, HistoryImport); | 50 FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, HistoryImport); |
59 | 51 |
60 virtual ~SafariImporter(); | 52 virtual ~SafariImporter(); |
61 | 53 |
62 // Multiple URLs can share the same favicon; this is a map | 54 // Multiple URLs can share the same favicon; this is a map |
63 // of URLs -> IconIDs that we load as a temporary step before | 55 // of URLs -> IconIDs that we load as a temporary step before |
64 // actually loading the icons. | 56 // actually loading the icons. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 void LoadFaviconData(sql::Connection* db, | 93 void LoadFaviconData(sql::Connection* db, |
102 const FaviconMap& favicon_map, | 94 const FaviconMap& favicon_map, |
103 std::vector<ImportedFaviconUsage>* favicons); | 95 std::vector<ImportedFaviconUsage>* favicons); |
104 | 96 |
105 base::FilePath library_dir_; | 97 base::FilePath library_dir_; |
106 | 98 |
107 DISALLOW_COPY_AND_ASSIGN(SafariImporter); | 99 DISALLOW_COPY_AND_ASSIGN(SafariImporter); |
108 }; | 100 }; |
109 | 101 |
110 #endif // CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ | 102 #endif // CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_ |
OLD | NEW |