Chromium Code Reviews| Index: chrome/utility/importer/safari_importer.mm |
| diff --git a/chrome/browser/importer/safari_importer.mm b/chrome/utility/importer/safari_importer.mm |
| similarity index 91% |
| rename from chrome/browser/importer/safari_importer.mm |
| rename to chrome/utility/importer/safari_importer.mm |
| index 4a61298cbf5171fca9b7c0f79ac26cd29ce36b11..b62c72f6d73665f0cf534e224cff0452008401a0 100644 |
| --- a/chrome/browser/importer/safari_importer.mm |
| +++ b/chrome/utility/importer/safari_importer.mm |
| @@ -4,7 +4,7 @@ |
| #include <Cocoa/Cocoa.h> |
| -#include "chrome/browser/importer/safari_importer.h" |
| +#include "chrome/utility/importer/safari_importer.h" |
| #include <map> |
| #include <vector> |
| @@ -15,11 +15,11 @@ |
| #include "base/strings/sys_string_conversions.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "base/time/time.h" |
| -#include "chrome/browser/favicon/favicon_util.h" |
| -#include "chrome/browser/importer/importer_bridge.h" |
| #include "chrome/common/importer/imported_bookmark_entry.h" |
| #include "chrome/common/importer/imported_favicon_usage.h" |
| +#include "chrome/common/importer/importer_bridge.h" |
|
gab
2013/07/08 15:18:08
nit: alpha order
scottmg
2013/07/09 16:20:49
same
|
| #include "chrome/common/url_constants.h" |
| +#include "chrome/utility/importer/favicon_reencode.h" |
| #include "grit/generated_resources.h" |
| #include "net/base/data_url.h" |
| #include "sql/statement.h" |
| @@ -48,27 +48,6 @@ SafariImporter::SafariImporter(const base::FilePath& library_dir) |
| SafariImporter::~SafariImporter() { |
| } |
| -// static |
| -bool SafariImporter::CanImport(const base::FilePath& library_dir, |
| - uint16* services_supported) { |
| - DCHECK(services_supported); |
| - *services_supported = importer::NONE; |
| - |
| - // Import features are toggled by the following: |
| - // bookmarks import: existence of ~/Library/Safari/Bookmarks.plist file. |
| - // history import: existence of ~/Library/Safari/History.plist file. |
| - base::FilePath safari_dir = library_dir.Append("Safari"); |
| - base::FilePath bookmarks_path = safari_dir.Append("Bookmarks.plist"); |
| - base::FilePath history_path = safari_dir.Append("History.plist"); |
| - |
| - if (file_util::PathExists(bookmarks_path)) |
| - *services_supported |= importer::FAVORITES; |
| - if (file_util::PathExists(history_path)) |
| - *services_supported |= importer::HISTORY; |
| - |
| - return *services_supported != importer::NONE; |
| -} |
| - |
| void SafariImporter::StartImport(const importer::SourceProfile& source_profile, |
| uint16 items, |
| ImporterBridge* bridge) { |
| @@ -176,7 +155,7 @@ void SafariImporter::LoadFaviconData( |
| if (data.empty()) |
| continue; // Data definitely invalid. |
| - if (!FaviconUtil::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
| + if (!importer::ReencodeFavicon(&data[0], data.size(), &usage.png_data)) |
| continue; // Unable to decode. |
| usage.urls = i->second; |
| @@ -322,7 +301,7 @@ void SafariImporter::ImportHistory() { |
| ParseHistoryItems(&rows); |
| if (!rows.empty() && !cancelled()) { |
| - bridge_->SetHistoryItems(rows, history::SOURCE_SAFARI_IMPORTED); |
| + bridge_->SetHistoryItems(rows, IMPORTER_VISIT_SOURCE_SAFARI_IMPORTED); |
| } |
| } |