OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <Cocoa/Cocoa.h> | 5 #include <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "chrome/browser/importer/safari_importer.h" | 7 #include "chrome/browser/importer/safari_importer.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 std::vector<ProfileWriter::BookmarkEntry> bookmarks; | 100 std::vector<ProfileWriter::BookmarkEntry> bookmarks; |
101 ParseBookmarks(&bookmarks); | 101 ParseBookmarks(&bookmarks); |
102 | 102 |
103 // Write bookmarks into profile. | 103 // Write bookmarks into profile. |
104 if (!bookmarks.empty() && !cancelled()) { | 104 if (!bookmarks.empty() && !cancelled()) { |
105 const string16& first_folder_name = | 105 const string16& first_folder_name = |
106 bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_SAFARI); | 106 bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_SAFARI); |
107 int options = 0; | 107 int options = 0; |
108 if (import_to_bookmark_bar()) | 108 if (import_to_bookmark_bar()) |
109 options = ProfileWriter::IMPORT_TO_BOOKMARK_BAR; | 109 options = ProfileWriter::IMPORT_TO_BOOKMARK_BAR; |
110 bridge_->AddBookmarkEntries(bookmarks, first_folder_name, options); | 110 bridge_->AddBookmarks(bookmarks, first_folder_name, options); |
111 } | 111 } |
112 | 112 |
113 // Import favicons. | 113 // Import favicons. |
114 sql::Connection db; | 114 sql::Connection db; |
115 if (!OpenDatabase(&db)) | 115 if (!OpenDatabase(&db)) |
116 return; | 116 return; |
117 | 117 |
118 FaviconMap favicon_map; | 118 FaviconMap favicon_map; |
119 ImportFaviconURLs(&db, &favicon_map); | 119 ImportFaviconURLs(&db, &favicon_map); |
120 // Write favicons into profile. | 120 // Write favicons into profile. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 if (!last_visit_str) | 380 if (!last_visit_str) |
381 continue; | 381 continue; |
382 | 382 |
383 // Convert Safari's last visit time to Unix Epoch time. | 383 // Convert Safari's last visit time to Unix Epoch time. |
384 double seconds_since_unix_epoch = HistoryTimeToEpochTime(last_visit_str); | 384 double seconds_since_unix_epoch = HistoryTimeToEpochTime(last_visit_str); |
385 row.set_last_visit(base::Time::FromDoubleT(seconds_since_unix_epoch)); | 385 row.set_last_visit(base::Time::FromDoubleT(seconds_since_unix_epoch)); |
386 | 386 |
387 history_items->push_back(row); | 387 history_items->push_back(row); |
388 } | 388 } |
389 } | 389 } |
OLD | NEW |