summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--android_webview/tools/third_party_files_whitelist.txt28
-rw-r--r--chrome/browser/DEPS3
-rw-r--r--chrome/browser/bookmarks/DEPS7
-rw-r--r--chrome/browser/bookmarks/bookmark_html_writer_unittest.cc (renamed from chrome/browser/importer/bookmark_html_writer_unittest.cc)2
-rw-r--r--chrome/browser/extensions/api/bookmarks/bookmarks_api.cc2
-rw-r--r--chrome/browser/first_run/first_run.cc2
-rw-r--r--chrome/browser/importer/external_process_importer_client.cc2
-rw-r--r--chrome/browser/importer/external_process_importer_host.cc2
-rw-r--r--chrome/browser/importer/firefox_importer_browsertest.cc1
-rw-r--r--chrome/browser/importer/firefox_proxy_settings.cc2
-rw-r--r--chrome/browser/importer/ie_importer_browsertest_win.cc9
-rw-r--r--chrome/browser/importer/importer_list.cc6
-rw-r--r--chrome/browser/importer/importer_uma.cc (renamed from chrome/browser/importer/importer_creator.cc)41
-rw-r--r--chrome/browser/importer/importer_uma.h (renamed from chrome/browser/importer/importer_creator.h)13
-rw-r--r--chrome/browser/importer/in_process_importer_bridge.h2
-rw-r--r--chrome/browser/ui/webui/options/import_data_handler.cc2
-rw-r--r--chrome/chrome.gyp47
-rw-r--r--chrome/chrome_browser.gypi52
-rw-r--r--chrome/chrome_common.gypi11
-rw-r--r--chrome/chrome_tests_unit.gypi20
-rw-r--r--chrome/common/importer/firefox_importer_utils.cc (renamed from chrome/browser/importer/firefox_importer_utils.cc)2
-rw-r--r--chrome/common/importer/firefox_importer_utils.h (renamed from chrome/browser/importer/firefox_importer_utils.h)9
-rw-r--r--chrome/common/importer/firefox_importer_utils_linux.cc (renamed from chrome/browser/importer/firefox_importer_utils_linux.cc)2
-rw-r--r--chrome/common/importer/firefox_importer_utils_mac.mm (renamed from chrome/browser/importer/firefox_importer_utils_mac.mm)2
-rw-r--r--chrome/common/importer/firefox_importer_utils_win.cc (renamed from chrome/browser/importer/firefox_importer_utils_win.cc)2
-rw-r--r--chrome/common/importer/ie_importer_test_registry_overrider_win.cc (renamed from chrome/browser/importer/ie_importer_test_registry_overrider_win.cc)2
-rw-r--r--chrome/common/importer/ie_importer_test_registry_overrider_win.h (renamed from chrome/browser/importer/ie_importer_test_registry_overrider_win.h)6
-rw-r--r--chrome/common/importer/ie_importer_utils_win.cc (renamed from chrome/browser/importer/ie_importer_utils_win.cc)4
-rw-r--r--chrome/common/importer/ie_importer_utils_win.h (renamed from chrome/browser/importer/ie_importer_utils_win.h)6
-rw-r--r--chrome/common/importer/importer_bridge.cc (renamed from chrome/browser/importer/importer_bridge.cc)2
-rw-r--r--chrome/common/importer/importer_bridge.h (renamed from chrome/browser/importer/importer_bridge.h)7
-rw-r--r--chrome/common/importer/pstore_declarations.h (renamed from chrome/browser/importer/pstore_declarations.h)6
-rw-r--r--chrome/utility/DEPS10
-rw-r--r--chrome/utility/importer/OWNERS12
-rw-r--r--chrome/utility/importer/bookmark_html_reader.cc (renamed from chrome/browser/importer/bookmark_html_reader.cc)9
-rw-r--r--chrome/utility/importer/bookmark_html_reader.h (renamed from chrome/browser/importer/bookmark_html_reader.h)6
-rw-r--r--chrome/utility/importer/bookmark_html_reader_unittest.cc (renamed from chrome/browser/importer/bookmark_html_reader_unittest.cc)2
-rw-r--r--chrome/utility/importer/bookmarks_file_importer.cc (renamed from chrome/browser/importer/bookmarks_file_importer.cc)8
-rw-r--r--chrome/utility/importer/bookmarks_file_importer.h (renamed from chrome/browser/importer/bookmarks_file_importer.h)8
-rw-r--r--chrome/utility/importer/external_process_importer_bridge.cc (renamed from chrome/browser/importer/external_process_importer_bridge.cc)6
-rw-r--r--chrome/utility/importer/external_process_importer_bridge.h (renamed from chrome/browser/importer/external_process_importer_bridge.h)8
-rw-r--r--chrome/utility/importer/favicon_reencode.cc (renamed from chrome/browser/importer/reencode_favicon.cc)11
-rw-r--r--chrome/utility/importer/favicon_reencode.h (renamed from chrome/browser/importer/reencode_favicon.h)15
-rw-r--r--chrome/utility/importer/firefox3_importer.cc (renamed from chrome/browser/importer/firefox3_importer.cc)19
-rw-r--r--chrome/utility/importer/firefox3_importer.h (renamed from chrome/browser/importer/firefox3_importer.h)8
-rw-r--r--chrome/utility/importer/firefox_importer_unittest.cc (renamed from chrome/browser/importer/firefox_importer_unittest.cc)7
-rw-r--r--chrome/utility/importer/firefox_importer_unittest_messages_internal.h (renamed from chrome/browser/importer/firefox_importer_unittest_messages_internal.h)0
-rw-r--r--chrome/utility/importer/firefox_importer_unittest_utils.h (renamed from chrome/browser/importer/firefox_importer_unittest_utils.h)8
-rw-r--r--chrome/utility/importer/firefox_importer_unittest_utils_mac.cc (renamed from chrome/browser/importer/firefox_importer_unittest_utils_mac.cc)8
-rw-r--r--chrome/utility/importer/firefox_importer_utils_unittest.cc (renamed from chrome/browser/importer/firefox_importer_utils_unittest.cc)2
-rw-r--r--chrome/utility/importer/ie_importer_win.cc (renamed from chrome/browser/importer/ie_importer.cc)15
-rw-r--r--chrome/utility/importer/ie_importer_win.h (renamed from chrome/browser/importer/ie_importer.h)174
-rw-r--r--chrome/utility/importer/importer.cc (renamed from chrome/browser/importer/importer.cc)4
-rw-r--r--chrome/utility/importer/importer.h (renamed from chrome/browser/importer/importer.h)6
-rw-r--r--chrome/utility/importer/importer_creator.cc44
-rw-r--r--chrome/utility/importer/importer_creator.h19
-rw-r--r--chrome/utility/importer/nss_decryptor.cc (renamed from chrome/browser/importer/nss_decryptor.cc)2
-rw-r--r--chrome/utility/importer/nss_decryptor.h (renamed from chrome/browser/importer/nss_decryptor.h)14
-rw-r--r--chrome/utility/importer/nss_decryptor_mac.h (renamed from chrome/browser/importer/nss_decryptor_mac.h)6
-rw-r--r--chrome/utility/importer/nss_decryptor_mac.mm (renamed from chrome/browser/importer/nss_decryptor_mac.mm)4
-rw-r--r--chrome/utility/importer/nss_decryptor_null.h (renamed from chrome/browser/importer/nss_decryptor_null.h)10
-rw-r--r--chrome/utility/importer/nss_decryptor_system_nss.cc (renamed from chrome/browser/importer/nss_decryptor_system_nss.cc)2
-rw-r--r--chrome/utility/importer/nss_decryptor_system_nss.h (renamed from chrome/browser/importer/nss_decryptor_system_nss.h)6
-rw-r--r--chrome/utility/importer/nss_decryptor_win.cc (renamed from chrome/browser/importer/nss_decryptor_win.cc)2
-rw-r--r--chrome/utility/importer/nss_decryptor_win.h (renamed from chrome/browser/importer/nss_decryptor_win.h)6
-rw-r--r--chrome/utility/importer/safari_importer.h (renamed from chrome/browser/importer/safari_importer.h)27
-rw-r--r--chrome/utility/importer/safari_importer.mm (renamed from chrome/browser/importer/safari_importer.mm)8
-rw-r--r--chrome/utility/importer/safari_importer_unittest.mm (renamed from chrome/browser/importer/safari_importer_unittest.mm)5
-rw-r--r--chrome/utility/profile_import_handler.cc6
-rw-r--r--components/webdata/encryptor/ie7_password_unittest_win.cc (renamed from chrome/browser/importer/ie_importer_unittest_win.cc)2
-rwxr-xr-xtools/sort-headers.py2
71 files changed, 427 insertions, 388 deletions
diff --git a/android_webview/tools/third_party_files_whitelist.txt b/android_webview/tools/third_party_files_whitelist.txt
index 3c7cc0a..bc5ad88 100644
--- a/android_webview/tools/third_party_files_whitelist.txt
+++ b/android_webview/tools/third_party_files_whitelist.txt
@@ -20,8 +20,6 @@ base/md5.cc
# license. This third-party code is taken from Mozilla, the license for which
# we already pick up from third_party/npapi/.
chrome/browser/download/download_extensions.cc
-# String 'copyright' used in code.
-chrome/browser/importer/firefox_importer_utils.cc
# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
# license. Not used on Android.
chrome/browser/importer/firefox_profile_lock.cc
@@ -34,18 +32,6 @@ chrome/browser/importer/firefox_profile_lock_posix.cc
# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
# license. Not used on Android.
chrome/browser/importer/firefox_profile_lock_win.cc
-# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
-# license. Not used on Android.
-chrome/browser/importer/nss_decryptor.cc
-# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
-# license. Not used on Android.
-chrome/browser/importer/nss_decryptor_mac.h
-# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
-# license. Not used on Android.
-chrome/browser/importer/nss_decryptor_system_nss.cc
-# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
-# license. Not used on Android.
-chrome/browser/importer/nss_decryptor_win.h
# Credits notice for ChromeOS.
chrome/browser/resources/chromeos/about_os_credits.html
# String 'copyright' used in code.
@@ -60,6 +46,20 @@ chrome/browser/resources/file_manager/js/media/mediaplayer_scripts.js
chrome/browser/resources/file_manager/js/media/video_player_scripts.js
# String 'copyright' used in code.
chrome/browser/resources/file_manager/js/photo/photo_import_scripts.js
+# String 'copyright' used in code.
+chrome/common/importer/firefox_importer_utils.cc
+# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
+# license. Not used on Android.
+chrome/utility/importer/nss_decryptor.cc
+# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
+# license. Not used on Android.
+chrome/utility/importer/nss_decryptor_mac.h
+# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
+# license. Not used on Android.
+chrome/utility/importer/nss_decryptor_system_nss.cc
+# Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2
+# license. Not used on Android.
+chrome/utility/importer/nss_decryptor_win.h
# Copyright Google Inc; no license. Example code only.
chrome_frame/cfinstall/examples/jquery.html
# Copyright Google Inc; no license. Example code only.
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index 4fa3b42..8f55962 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -73,6 +73,9 @@ include_rules = [
"+chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h",
"+chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h",
+ # Should not be using utility process code. http://crbug.com/254672
+ "!chrome/utility",
+
# Other libraries.
"+chrome/third_party/mozilla_security_manager",
"+libxml", # For search engine definition parsing.
diff --git a/chrome/browser/bookmarks/DEPS b/chrome/browser/bookmarks/DEPS
index 1c5eb86..261233b 100644
--- a/chrome/browser/bookmarks/DEPS
+++ b/chrome/browser/bookmarks/DEPS
@@ -22,3 +22,10 @@ include_rules = [
# Do not add to the list of temporarily-allowed dependencies above,
# and please do not introduce more #includes of these files.
]
+
+specific_include_rules = {
+ # For unit tests, it's fine to include utility process code.
+ '.*test\.cc': [
+ "+chrome/utility/importer/bookmark_html_reader.h",
+ ],
+}
diff --git a/chrome/browser/importer/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
index 37beb81..b9c7bed 100644
--- a/chrome/browser/importer/bookmark_html_writer_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc
@@ -18,11 +18,11 @@
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
-#include "chrome/browser/importer/bookmark_html_reader.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "chrome/utility/importer/bookmark_html_reader.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
index 0eea851..592fced 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
@@ -32,7 +32,7 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extensions_quota_service.h"
#include "chrome/browser/importer/external_process_importer_host.h"
-#include "chrome/browser/importer/importer_creator.h"
+#include "chrome/browser/importer/importer_uma.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index df29d21..9cb785b 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -24,9 +24,9 @@
#include "chrome/browser/first_run/first_run_internal.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/importer/external_process_importer_host.h"
-#include "chrome/browser/importer/importer_creator.h"
#include "chrome/browser/importer/importer_list.h"
#include "chrome/browser/importer/importer_progress_observer.h"
+#include "chrome/browser/importer/importer_uma.h"
#include "chrome/browser/importer/profile_writer.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/search_engines/template_url_service.h"
diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc
index 3813b92..7861c9c 100644
--- a/chrome/browser/importer/external_process_importer_client.cc
+++ b/chrome/browser/importer/external_process_importer_client.cc
@@ -8,8 +8,8 @@
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/importer/external_process_importer_host.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
#include "chrome/browser/importer/in_process_importer_bridge.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/profile_import_process_messages.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/importer/external_process_importer_host.cc b/chrome/browser/importer/external_process_importer_host.cc
index 1d2692c..2615d00 100644
--- a/chrome/browser/importer/external_process_importer_host.cc
+++ b/chrome/browser/importer/external_process_importer_host.cc
@@ -10,8 +10,6 @@
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/importer/external_process_importer_client.h"
#include "chrome/browser/importer/firefox_profile_lock.h"
-#include "chrome/browser/importer/importer.h"
-#include "chrome/browser/importer/importer_creator.h"
#include "chrome/browser/importer/importer_lock_dialog.h"
#include "chrome/browser/importer/importer_progress_observer.h"
#include "chrome/browser/importer/in_process_importer_bridge.h"
diff --git a/chrome/browser/importer/firefox_importer_browsertest.cc b/chrome/browser/importer/firefox_importer_browsertest.cc
index 70aa30a4..0290ba2 100644
--- a/chrome/browser/importer/firefox_importer_browsertest.cc
+++ b/chrome/browser/importer/firefox_importer_browsertest.cc
@@ -12,7 +12,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/importer/external_process_importer_host.h"
-#include "chrome/browser/importer/firefox_importer_unittest_utils.h"
#include "chrome/browser/importer/importer_progress_observer.h"
#include "chrome/browser/importer/importer_unittest_utils.h"
#include "chrome/browser/search_engines/template_url.h"
diff --git a/chrome/browser/importer/firefox_proxy_settings.cc b/chrome/browser/importer/firefox_proxy_settings.cc
index 75d5735..58aa4f36 100644
--- a/chrome/browser/importer/firefox_proxy_settings.cc
+++ b/chrome/browser/importer/firefox_proxy_settings.cc
@@ -8,7 +8,7 @@
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "base/values.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "net/proxy/proxy_config.h"
namespace {
diff --git a/chrome/browser/importer/ie_importer_browsertest_win.cc b/chrome/browser/importer/ie_importer_browsertest_win.cc
index a076308..79d849f 100644
--- a/chrome/browser/importer/ie_importer_browsertest_win.cc
+++ b/chrome/browser/importer/ie_importer_browsertest_win.cc
@@ -29,19 +29,18 @@
#include "base/win/scoped_propvariant.h"
#include "base/win/windows_version.h"
#include "chrome/browser/importer/external_process_importer_host.h"
-#include "chrome/browser/importer/ie_importer.h"
-#include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h"
-#include "chrome/browser/importer/ie_importer_utils_win.h"
-#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/importer_progress_observer.h"
#include "chrome/browser/importer/importer_unittest_utils.h"
-#include "chrome/browser/importer/pstore_declarations.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/importer/ie_importer_test_registry_overrider_win.h"
+#include "chrome/common/importer/ie_importer_utils_win.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_bridge.h"
#include "chrome/common/importer/importer_data_types.h"
+#include "chrome/common/importer/pstore_declarations.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/testing_profile.h"
#include "components/webdata/encryptor/ie7_password.h"
diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc
index 7c9df71..0339ee1 100644
--- a/chrome/browser/importer/importer_list.cc
+++ b/chrome/browser/importer/importer_list.cc
@@ -5,10 +5,10 @@
#include "chrome/browser/importer/importer_list.h"
#include "base/bind.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
-#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/importer_list_observer.h"
#include "chrome/browser/shell_integration.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/importer_bridge.h"
#include "chrome/common/importer/importer_data_types.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -17,7 +17,7 @@
#include <CoreFoundation/CoreFoundation.h>
#include "base/mac/foundation_util.h"
-#include "chrome/browser/importer/safari_importer.h"
+#include "chrome/utility/importer/safari_importer.h"
#endif
using content::BrowserThread;
diff --git a/chrome/browser/importer/importer_creator.cc b/chrome/browser/importer/importer_uma.cc
index 7127ed2..4e62217 100644
--- a/chrome/browser/importer/importer_creator.cc
+++ b/chrome/browser/importer/importer_uma.cc
@@ -2,22 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/importer_creator.h"
-
-#include "base/logging.h"
-#include "base/metrics/histogram.h"
-#include "chrome/browser/importer/bookmarks_file_importer.h"
-#include "chrome/browser/importer/firefox3_importer.h"
-
-#if defined(OS_WIN)
-#include "chrome/browser/importer/ie_importer.h"
-#endif
-
-#if defined(OS_MACOSX)
-#include <CoreFoundation/CoreFoundation.h>
-#include "base/mac/foundation_util.h"
-#include "chrome/browser/importer/safari_importer.h"
-#endif
+#include "build/build_config.h"
+#include "chrome/browser/importer/importer_uma.h"
namespace importer {
@@ -42,31 +28,8 @@ enum ImporterTypeMetrics {
IMPORTER_METRICS_SIZE
};
-
} // namespace
-Importer* CreateImporterByType(ImporterType type) {
- switch (type) {
-#if defined(OS_WIN)
- case TYPE_IE:
- return new IEImporter();
-#endif
- case TYPE_BOOKMARKS_FILE:
- return new BookmarksFileImporter();
- case TYPE_FIREFOX3:
- return new Firefox3Importer();
-#if defined(OS_MACOSX)
- case TYPE_SAFARI:
- return new SafariImporter(base::mac::GetUserLibraryPath());
-#endif
- default:
- NOTREACHED();
- return NULL;
- }
- NOTREACHED();
- return NULL;
-}
-
void LogImporterUseToMetrics(const std::string& metric_postfix,
ImporterType type) {
ImporterTypeMetrics metrics_type = IMPORTER_METRICS_UNKNOWN;
diff --git a/chrome/browser/importer/importer_creator.h b/chrome/browser/importer/importer_uma.h
index b3b7465..c71e6c9 100644
--- a/chrome/browser/importer/importer_creator.h
+++ b/chrome/browser/importer/importer_uma.h
@@ -2,20 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_IMPORTER_CREATOR_H_
-#define CHROME_BROWSER_IMPORTER_IMPORTER_CREATOR_H_
+#ifndef CHROME_BROWSER_IMPORTER_IMPORTER_UMA_H_
+#define CHROME_BROWSER_IMPORTER_IMPORTER_UMA_H_
#include <string>
-
+#include "base/metrics/histogram.h"
#include "chrome/common/importer/importer_type.h"
-class Importer;
-
namespace importer {
-// Creates an Importer of the specified |type|.
-Importer* CreateImporterByType(ImporterType type);
-
// Logs to UMA that an Importer of the specified |type| was used. Uses
// |metric_postfix| to split by entry point. Note: Values passed via
// |metric_postfix| require a matching "Import.ImporterType.|metric_postfix|"
@@ -25,4 +20,4 @@ void LogImporterUseToMetrics(const std::string& metric_prefix,
} // namespace importer
-#endif // CHROME_BROWSER_IMPORTER_IMPORTER_CREATOR_H_
+#endif // CHROME_BROWSER_IMPORTER_IMPORTER_UMA_H_
diff --git a/chrome/browser/importer/in_process_importer_bridge.h b/chrome/browser/importer/in_process_importer_bridge.h
index ff61567..664592b 100644
--- a/chrome/browser/importer/in_process_importer_bridge.h
+++ b/chrome/browser/importer/in_process_importer_bridge.h
@@ -12,8 +12,8 @@
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
-#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/profile_writer.h"
+#include "chrome/common/importer/importer_bridge.h"
class GURL;
struct ImportedBookmarkEntry;
diff --git a/chrome/browser/ui/webui/options/import_data_handler.cc b/chrome/browser/ui/webui/options/import_data_handler.cc
index ccb0165..b456d25 100644
--- a/chrome/browser/ui/webui/options/import_data_handler.cc
+++ b/chrome/browser/ui/webui/options/import_data_handler.cc
@@ -18,8 +18,8 @@
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/importer/external_process_importer_host.h"
-#include "chrome/browser/importer/importer_creator.h"
#include "chrome/browser/importer/importer_list.h"
+#include "chrome/browser/importer/importer_uma.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
#include "content/public/browser/web_ui.h"
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index fd8a886..6f14c50 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -300,6 +300,33 @@
'utility/chrome_content_utility_client.h',
'utility/extensions/unpacker.cc',
'utility/extensions/unpacker.h',
+ 'utility/importer/bookmark_html_reader.cc',
+ 'utility/importer/bookmark_html_reader.h',
+ 'utility/importer/bookmarks_file_importer.cc',
+ 'utility/importer/bookmarks_file_importer.h',
+ 'utility/importer/external_process_importer_bridge.cc',
+ 'utility/importer/external_process_importer_bridge.h',
+ 'utility/importer/favicon_reencode.cc',
+ 'utility/importer/favicon_reencode.h',
+ 'utility/importer/firefox3_importer.cc',
+ 'utility/importer/firefox3_importer.h',
+ 'utility/importer/firefox_importer_unittest_messages_internal.h',
+ 'utility/importer/firefox_importer_unittest_utils.h',
+ 'utility/importer/firefox_importer_unittest_utils_mac.cc',
+ 'utility/importer/ie_importer_win.cc',
+ 'utility/importer/ie_importer_win.h',
+ 'utility/importer/importer.cc',
+ 'utility/importer/importer.h',
+ 'utility/importer/importer_creator.cc',
+ 'utility/importer/importer_creator.h',
+ 'utility/importer/nss_decryptor.cc',
+ 'utility/importer/nss_decryptor.h',
+ 'utility/importer/nss_decryptor_mac.h',
+ 'utility/importer/nss_decryptor_mac.mm',
+ 'utility/importer/nss_decryptor_win.cc',
+ 'utility/importer/nss_decryptor_win.h',
+ 'utility/importer/safari_importer.h',
+ 'utility/importer/safari_importer.mm',
'utility/itunes_pref_parser_win.cc',
'utility/itunes_pref_parser_win.h',
'utility/profile_import_handler.cc',
@@ -309,6 +336,7 @@
],
'include_dirs': [
'..',
+ '<(grit_out_dir)',
],
'conditions': [
['toolkit_uses_gtk == 1', {
@@ -328,9 +356,24 @@
'utility/media_galleries/pmp_column_reader.h',
],
}],
- ['OS=="android"', {
+ ['use_openssl==1', {
'sources!': [
- 'utility/profile_import_handler.cc',
+ 'utility/importer/nss_decryptor.cc',
+ ]
+ }],
+ ['OS!="win" and OS!="mac" and use_openssl==0', {
+ 'dependencies': [
+ '../crypto/crypto.gyp:crypto',
+ ],
+ 'sources': [
+ 'utility/importer/nss_decryptor_system_nss.cc',
+ 'utility/importer/nss_decryptor_system_nss.h',
+ ],
+ }],
+ ['OS=="android"', {
+ 'sources/': [
+ ['exclude', '^utility/importer/'],
+ ['exclude', '^utility/profile_import_handler\.cc'],
],
}],
['enable_mdns == 1', {
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index e1cd866..fd97650 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -240,8 +240,6 @@
'browser/bookmarks/bookmark_codec.h',
'browser/bookmarks/bookmark_expanded_state_tracker.cc',
'browser/bookmarks/bookmark_expanded_state_tracker.h',
- 'browser/importer/bookmark_html_reader.cc',
- 'browser/importer/bookmark_html_reader.h',
'browser/bookmarks/bookmark_html_writer.cc',
'browser/bookmarks/bookmark_html_writer.h',
'browser/bookmarks/bookmark_index.cc',
@@ -832,60 +830,27 @@
'browser/idle_win.cc',
'browser/image_decoder.cc',
'browser/image_decoder.h',
- 'browser/importer/bookmarks_file_importer.cc',
- 'browser/importer/bookmarks_file_importer.h',
- 'browser/importer/external_process_importer_bridge.cc',
- 'browser/importer/external_process_importer_bridge.h',
'browser/importer/external_process_importer_client.cc',
'browser/importer/external_process_importer_client.h',
'browser/importer/external_process_importer_host.cc',
'browser/importer/external_process_importer_host.h',
- 'browser/importer/reencode_favicon.cc',
- 'browser/importer/reencode_favicon.h',
- 'browser/importer/firefox3_importer.cc',
- 'browser/importer/firefox3_importer.h',
- 'browser/importer/firefox_importer_utils.cc',
- 'browser/importer/firefox_importer_utils.h',
- 'browser/importer/firefox_importer_utils_linux.cc',
- 'browser/importer/firefox_importer_utils_mac.mm',
- 'browser/importer/firefox_importer_utils_win.cc',
'browser/importer/firefox_profile_lock.cc',
'browser/importer/firefox_profile_lock.h',
'browser/importer/firefox_profile_lock_posix.cc',
'browser/importer/firefox_profile_lock_win.cc',
'browser/importer/firefox_proxy_settings.cc',
'browser/importer/firefox_proxy_settings.h',
- 'browser/importer/ie_importer.cc',
- 'browser/importer/ie_importer.h',
- 'browser/importer/ie_importer_test_registry_overrider_win.cc',
- 'browser/importer/ie_importer_test_registry_overrider_win.h',
- 'browser/importer/ie_importer_utils_win.cc',
- 'browser/importer/ie_importer_utils_win.h',
- 'browser/importer/importer.cc',
- 'browser/importer/importer.h',
- 'browser/importer/importer_bridge.cc',
- 'browser/importer/importer_bridge.h',
- 'browser/importer/importer_creator.cc',
- 'browser/importer/importer_creator.h',
'browser/importer/importer_list.cc',
'browser/importer/importer_list.h',
'browser/importer/importer_list_observer.h',
'browser/importer/importer_lock_dialog.h',
'browser/importer/importer_progress_observer.h',
+ 'browser/importer/importer_uma.cc',
+ 'browser/importer/importer_uma.h',
'browser/importer/in_process_importer_bridge.cc',
'browser/importer/in_process_importer_bridge.h',
- 'browser/importer/nss_decryptor.cc',
- 'browser/importer/nss_decryptor.h',
- 'browser/importer/nss_decryptor_mac.h',
- 'browser/importer/nss_decryptor_mac.mm',
- 'browser/importer/nss_decryptor_system_nss.cc',
- 'browser/importer/nss_decryptor_system_nss.h',
- 'browser/importer/nss_decryptor_win.cc',
- 'browser/importer/nss_decryptor_win.h',
'browser/importer/profile_writer.cc',
'browser/importer/profile_writer.h',
- 'browser/importer/safari_importer.h',
- 'browser/importer/safari_importer.mm',
'browser/infobars/confirm_infobar_delegate.cc',
'browser/infobars/confirm_infobar_delegate.h',
'browser/infobars/infobar.cc',
@@ -2932,7 +2897,6 @@
'sources!': [
# Bookmark export/import are handled via the BookmarkColumns
# ContentProvider.
- 'browser/importer/bookmark_html_reader.cc',
'browser/bookmarks/bookmark_html_writer.cc',
'browser/ssl/ssl_add_certificate.cc',
@@ -3022,8 +2986,6 @@
'sources!': [
'browser/automation/automation_provider_list_generic.cc',
'browser/first_run/upgrade_util.cc',
- 'browser/importer/nss_decryptor_system_nss.cc',
- 'browser/importer/nss_decryptor_system_nss.h',
'browser/jankometer.cc',
'browser/lifetime/application_lifetime_stub.cc',
'browser/password_manager/login_database_posix.cc',
@@ -3087,8 +3049,6 @@
'sources!': [
'browser/first_run/first_run_dialog.h',
'browser/history/history_publisher_none.cc',
- 'browser/importer/nss_decryptor_system_nss.cc',
- 'browser/importer/nss_decryptor_system_nss.h',
'browser/lifetime/application_lifetime_stub.cc',
'browser/profiles/profile_shortcut_manager_stub.cc',
'browser/user_data_dir_extractor.cc',
@@ -3105,7 +3065,6 @@
# Exclude files that should be excluded for all non-Windows platforms.
['exclude', '^browser/first_run/try_chrome_dialog_view.cc'],
['exclude', '^browser/first_run/try_chrome_dialog_view.h'],
- ['exclude', '^browser/importer/ie_importer.cc'],
# Exclude all of hang_monitor.
['exclude', '^browser/hang_monitor/'],
@@ -3157,13 +3116,6 @@
'browser/plugins/plugins_resource_service.h',
],
}],
- [ 'use_openssl==1', {
- 'sources!': [
- 'browser/importer/nss_decryptor.cc',
- 'browser/importer/nss_decryptor_system_nss.cc',
- 'browser/importer/nss_decryptor_system_nss.h',
- ]
- }],
['enable_app_list==1', {
'dependencies': [
'../ui/app_list/app_list.gyp:app_list',
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index ef36aa4..fc4bf01 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -333,10 +333,21 @@
'common/external_ipc_fuzzer.h',
'common/icon_with_badge_image_source.cc',
'common/icon_with_badge_image_source.h',
+ 'common/importer/firefox_importer_utils.cc',
+ 'common/importer/firefox_importer_utils.h',
+ 'common/importer/firefox_importer_utils_linux.cc',
+ 'common/importer/firefox_importer_utils_mac.mm',
+ 'common/importer/firefox_importer_utils_win.cc',
+ 'common/importer/ie_importer_test_registry_overrider_win.cc',
+ 'common/importer/ie_importer_test_registry_overrider_win.h',
+ 'common/importer/ie_importer_utils_win.cc',
+ 'common/importer/ie_importer_utils_win.h',
'common/importer/imported_bookmark_entry.cc',
'common/importer/imported_bookmark_entry.h',
'common/importer/imported_favicon_usage.cc',
'common/importer/imported_favicon_usage.h',
+ 'common/importer/importer_bridge.cc',
+ 'common/importer/importer_bridge.h',
'common/importer/importer_data_types.cc',
'common/importer/importer_data_types.h',
'common/importer/importer_type.h',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 746b8dc..a140541 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -532,6 +532,7 @@
'browser/background/background_mode_manager_unittest.cc',
'browser/bookmarks/bookmark_codec_unittest.cc',
'browser/bookmarks/bookmark_expanded_state_tracker_unittest.cc',
+ 'browser/bookmarks/bookmark_html_writer_unittest.cc',
'browser/bookmarks/bookmark_index_unittest.cc',
'browser/bookmarks/bookmark_model_test_utils.cc',
'browser/bookmarks/bookmark_model_test_utils.h',
@@ -923,18 +924,9 @@
'browser/history/visit_database_unittest.cc',
'browser/history/visit_filter_unittest.cc',
'browser/history/visit_tracker_unittest.cc',
- 'browser/importer/bookmark_html_reader_unittest.cc',
- 'browser/importer/bookmark_html_writer_unittest.cc',
- 'browser/importer/firefox_importer_unittest.cc',
- 'browser/importer/firefox_importer_unittest_messages_internal.h',
- 'browser/importer/firefox_importer_unittest_utils.h',
- 'browser/importer/firefox_importer_unittest_utils_mac.cc',
- 'browser/importer/firefox_importer_utils_unittest.cc',
'browser/importer/firefox_profile_lock_unittest.cc',
'browser/importer/firefox_proxy_settings_unittest.cc',
- 'browser/importer/ie_importer_unittest_win.cc',
'browser/importer/profile_writer_unittest.cc',
- 'browser/importer/safari_importer_unittest.mm',
'browser/internal_auth_unittest.cc',
'browser/invalidation/invalidation_service_android_unittest.cc',
'browser/invalidation/invalidation_service_test_template.cc',
@@ -1794,6 +1786,10 @@
'test/logging/win/mof_data_parser_unittest.cc',
'tools/convert_dict/convert_dict_unittest.cc',
'utility/extensions/unpacker_unittest.cc',
+ 'utility/importer/bookmark_html_reader_unittest.cc',
+ 'utility/importer/firefox_importer_unittest.cc',
+ 'utility/importer/firefox_importer_utils_unittest.cc',
+ 'utility/importer/safari_importer_unittest.mm',
# Duplicate these tests here because PathService has more items in
# unit_tests than in base_unittests.
@@ -1854,6 +1850,7 @@
'../components/webdata/common/web_database_migration_unittest.cc',
'../components/webdata/common/web_data_service_test_util.cc',
'../components/webdata/common/web_data_service_test_util.h',
+ '../components/webdata/encryptor/ie7_password_unittest_win.cc',
# TODO(joi): Move the google_apis tests to a separate
# google_apis_unittests executable.
@@ -2375,8 +2372,7 @@
'sources!': [
# Bookmark export/import are handled via the BookmarkColumns
# ContentProvider.
- 'browser/importer/bookmark_html_reader_unittest.cc',
- 'browser/importer/bookmark_html_writer_unittest.cc',
+ 'browser/bookmarks/bookmark_html_writer_unittest.cc',
'browser/shell_integration_unittest.cc',
@@ -2456,7 +2452,6 @@
['exclude', '^browser/chrome_to_mobile'],
['exclude', '^browser/diagnostics/'],
['exclude', '^browser/first_run/'],
- ['exclude', '^browser/importer/'],
['exclude', '^browser/lifetime/'],
['exclude', '^browser/media_galleries/'],
['exclude', '^browser/profile_resetter/'],
@@ -2481,6 +2476,7 @@
['exclude', '^browser/service/'],
['exclude', '^common/service_'],
['exclude', '^service/'],
+ ['exclude', '^utility/importer/'],
],
'conditions': [
['gtest_target_type == "shared_library"', {
diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/common/importer/firefox_importer_utils.cc
index 782e1fa..7d1a355 100644
--- a/chrome/browser/importer/firefox_importer_utils.cc
+++ b/chrome/common/importer/firefox_importer_utils.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include <algorithm>
#include <map>
diff --git a/chrome/browser/importer/firefox_importer_utils.h b/chrome/common/importer/firefox_importer_utils.h
index 5446ddf..757270e 100644
--- a/chrome/browser/importer/firefox_importer_utils.h
+++ b/chrome/common/importer/firefox_importer_utils.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
-#define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
+#ifndef CHROME_COMMON_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
+#define CHROME_COMMON_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
#include <string>
#include <vector>
@@ -85,7 +85,8 @@ bool IsDefaultHomepage(const GURL& homepage, const base::FilePath& app_path);
// |prefs| is not filled).
// Note: for strings, only valid UTF-8 string values are supported. If a
// key/pair is not valid UTF-8, it is ignored and will not appear in |prefs|.
-bool ParsePrefFile(const base::FilePath& pref_file, base::DictionaryValue* prefs);
+bool ParsePrefFile(const base::FilePath& pref_file,
+ base::DictionaryValue* prefs);
// Parses the value of a particular firefox preference from a string that is the
// contents of the prefs file.
@@ -98,4 +99,4 @@ std::string GetPrefsJsValue(const std::string& prefs,
// the function assumes it's Firefox.
string16 GetFirefoxImporterName(const base::FilePath& app_path);
-#endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
+#endif // CHROME_COMMON_IMPORTER_FIREFOX_IMPORTER_UTILS_H_
diff --git a/chrome/browser/importer/firefox_importer_utils_linux.cc b/chrome/common/importer/firefox_importer_utils_linux.cc
index 0162d05..51868d5 100644
--- a/chrome/browser/importer/firefox_importer_utils_linux.cc
+++ b/chrome/common/importer/firefox_importer_utils_linux.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "base/file_util.h"
diff --git a/chrome/browser/importer/firefox_importer_utils_mac.mm b/chrome/common/importer/firefox_importer_utils_mac.mm
index 10171fd..65202bb 100644
--- a/chrome/browser/importer/firefox_importer_utils_mac.mm
+++ b/chrome/common/importer/firefox_importer_utils_mac.mm
@@ -5,7 +5,7 @@
#include <Cocoa/Cocoa.h>
#include <sys/param.h>
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "base/file_util.h"
#include "base/mac/foundation_util.h"
diff --git a/chrome/browser/importer/firefox_importer_utils_win.cc b/chrome/common/importer/firefox_importer_utils_win.cc
index 638deb2..0f0b57f 100644
--- a/chrome/browser/importer/firefox_importer_utils_win.cc
+++ b/chrome/common/importer/firefox_importer_utils_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include <shlobj.h>
diff --git a/chrome/browser/importer/ie_importer_test_registry_overrider_win.cc b/chrome/common/importer/ie_importer_test_registry_overrider_win.cc
index 7d1dcf4..615b324 100644
--- a/chrome/browser/importer/ie_importer_test_registry_overrider_win.cc
+++ b/chrome/common/importer/ie_importer_test_registry_overrider_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h"
+#include "chrome/common/importer/ie_importer_test_registry_overrider_win.h"
#include <windows.h>
diff --git a/chrome/browser/importer/ie_importer_test_registry_overrider_win.h b/chrome/common/importer/ie_importer_test_registry_overrider_win.h
index 11b4674..de86e7e 100644
--- a/chrome/browser/importer/ie_importer_test_registry_overrider_win.h
+++ b/chrome/common/importer/ie_importer_test_registry_overrider_win.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_IE_IMPORTER_TEST_REGISTRY_OVERRIDER_WIN_H_
-#define CHROME_BROWSER_IMPORTER_IE_IMPORTER_TEST_REGISTRY_OVERRIDER_WIN_H_
+#ifndef CHROME_COMMON_IMPORTER_IE_IMPORTER_TEST_REGISTRY_OVERRIDER_WIN_H_
+#define CHROME_COMMON_IMPORTER_IE_IMPORTER_TEST_REGISTRY_OVERRIDER_WIN_H_
#include "base/basictypes.h"
#include "base/strings/string16.h"
@@ -31,4 +31,4 @@ class IEImporterTestRegistryOverrider {
DISALLOW_COPY_AND_ASSIGN(IEImporterTestRegistryOverrider);
};
-#endif // CHROME_BROWSER_IMPORTER_IE_IMPORTER_TEST_REGISTRY_OVERRIDER_WIN_H_
+#endif // CHROME_COMMON_IMPORTER_IE_IMPORTER_TEST_REGISTRY_OVERRIDER_WIN_H_
diff --git a/chrome/browser/importer/ie_importer_utils_win.cc b/chrome/common/importer/ie_importer_utils_win.cc
index 8a77323c..5eabd3e 100644
--- a/chrome/browser/importer/ie_importer_utils_win.cc
+++ b/chrome/common/importer/ie_importer_utils_win.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/ie_importer_utils_win.h"
+#include "chrome/common/importer/ie_importer_utils_win.h"
-#include "chrome/browser/importer/ie_importer_test_registry_overrider_win.h"
+#include "chrome/common/importer/ie_importer_test_registry_overrider_win.h"
namespace {
diff --git a/chrome/browser/importer/ie_importer_utils_win.h b/chrome/common/importer/ie_importer_utils_win.h
index 8096cc8..0269115 100644
--- a/chrome/browser/importer/ie_importer_utils_win.h
+++ b/chrome/common/importer/ie_importer_utils_win.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_IE_IMPORTER_UTILS_WIN_H_
-#define CHROME_BROWSER_IMPORTER_IE_IMPORTER_UTILS_WIN_H_
+#ifndef CHROME_COMMON_IMPORTER_IE_IMPORTER_UTILS_WIN_H_
+#define CHROME_COMMON_IMPORTER_IE_IMPORTER_UTILS_WIN_H_
#include "base/strings/string16.h"
@@ -23,4 +23,4 @@ base::string16 GetIESettingsKey();
} // namespace importer
-#endif // CHROME_BROWSER_IMPORTER_IE_IMPORTER_UTILS_WIN_H_
+#endif // CHROME_COMMON_IMPORTER_IE_IMPORTER_UTILS_WIN_H_
diff --git a/chrome/browser/importer/importer_bridge.cc b/chrome/common/importer/importer_bridge.cc
index 7910c6a..15b7f74 100644
--- a/chrome/browser/importer/importer_bridge.cc
+++ b/chrome/common/importer/importer_bridge.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/importer_bridge.h"
+#include "chrome/common/importer/importer_bridge.h"
ImporterBridge::ImporterBridge() {}
diff --git a/chrome/browser/importer/importer_bridge.h b/chrome/common/importer/importer_bridge.h
index 335eb3c..94a89c2 100644
--- a/chrome/browser/importer/importer_bridge.h
+++ b/chrome/common/importer/importer_bridge.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_
-#define CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_
+#ifndef CHROME_COMMON_IMPORTER_IMPORTER_BRIDGE_H_
+#define CHROME_COMMON_IMPORTER_IMPORTER_BRIDGE_H_
#include <string>
#include <vector>
@@ -12,7 +12,6 @@
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
-#include "chrome/browser/history/history_types.h"
#include "chrome/common/importer/importer_data_types.h"
#include "chrome/common/importer/importer_url_row.h"
@@ -92,4 +91,4 @@ class ImporterBridge : public base::RefCountedThreadSafe<ImporterBridge> {
DISALLOW_COPY_AND_ASSIGN(ImporterBridge);
};
-#endif // CHROME_BROWSER_IMPORTER_IMPORTER_BRIDGE_H_
+#endif // CHROME_COMMON_IMPORTER_IMPORTER_BRIDGE_H_
diff --git a/chrome/browser/importer/pstore_declarations.h b/chrome/common/importer/pstore_declarations.h
index 805e549..e06ab6c 100644
--- a/chrome/browser/importer/pstore_declarations.h
+++ b/chrome/common/importer/pstore_declarations.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_PSTORE_DECLARATIONS_H_
-#define CHROME_BROWSER_IMPORTER_PSTORE_DECLARATIONS_H_
+#ifndef CHROME_COMMON_IMPORTER_PSTORE_DECLARATIONS_H_
+#define CHROME_COMMON_IMPORTER_PSTORE_DECLARATIONS_H_
#ifdef __PSTORE_H__
#error Should not include pstore.h and this file simultaneously.
@@ -179,4 +179,4 @@ interface IPStore : public IUnknown
IEnumPStoreItems __RPC_FAR *__RPC_FAR *ppenum) = 0;
};
-#endif // CHROME_BROWSER_IMPORTER_PSTORE_DECLARATIONS_H_
+#endif // CHROME_COMMON_IMPORTER_PSTORE_DECLARATIONS_H_
diff --git a/chrome/utility/DEPS b/chrome/utility/DEPS
index 6d96547..deea898 100644
--- a/chrome/utility/DEPS
+++ b/chrome/utility/DEPS
@@ -1,10 +1,10 @@
include_rules = [
- # For out of process profile import. This code needs to be factored out to
- # chrome/common.
- "+chrome/browser/importer",
- "+chrome/common/local_discovery",
- "+grit",
"+content/public/child",
"+content/public/utility",
"+webkit/glue",
+
+ # For generated headers.
+ "+grit",
+
+ "+skia/ext",
]
diff --git a/chrome/utility/importer/OWNERS b/chrome/utility/importer/OWNERS
new file mode 100644
index 0000000..66d2678
--- /dev/null
+++ b/chrome/utility/importer/OWNERS
@@ -0,0 +1,12 @@
+gab@chromium.org
+isherman@chromium.org
+mirandac@chromium.org
+
+# For security review of IPC message files.
+per-file *_messages*.h=set noparent
+per-file *_messages*.h=cdn@chromium.org
+per-file *_messages*.h=cevans@chromium.org
+per-file *_messages*.h=inferno@chromium.org
+per-file *_messages*.h=jschuh@chromium.org
+per-file *_messages*.h=palmer@chromium.org
+per-file *_messages*.h=tsepez@chromium.org
diff --git a/chrome/browser/importer/bookmark_html_reader.cc b/chrome/utility/importer/bookmark_html_reader.cc
index 9f41ae7..5d34d7b 100644
--- a/chrome/browser/importer/bookmark_html_reader.cc
+++ b/chrome/utility/importer/bookmark_html_reader.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/bookmark_html_reader.h"
+#include "chrome/utility/importer/bookmark_html_reader.h"
#include "base/callback.h"
#include "base/file_util.h"
@@ -11,9 +11,9 @@
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
-#include "chrome/browser/importer/reencode_favicon.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/utility/importer/favicon_reencode.h"
#include "content/public/common/url_constants.h"
#include "net/base/data_url.h"
#include "net/base/escape.h"
@@ -67,8 +67,9 @@ void DataURLToFaviconUsage(
return;
ImportedFaviconUsage usage;
- if (!ReencodeFavicon(reinterpret_cast<const uint8*>(&data[0]),
- data.size(), &usage.png_data))
+ if (!importer::ReencodeFavicon(
+ reinterpret_cast<const unsigned char*>(&data[0]),
+ data.size(), &usage.png_data))
return; // Unable to decode.
// We need to make up a URL for the favicon. We use a version of the page's
diff --git a/chrome/browser/importer/bookmark_html_reader.h b/chrome/utility/importer/bookmark_html_reader.h
index 5d34ab2..274c9a2 100644
--- a/chrome/browser/importer/bookmark_html_reader.h
+++ b/chrome/utility/importer/bookmark_html_reader.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_BOOKMARK_HTML_READER_H_
-#define CHROME_BROWSER_IMPORTER_BOOKMARK_HTML_READER_H_
+#ifndef CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_
+#define CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_
#include <string>
#include <vector>
@@ -94,4 +94,4 @@ bool ParseMinimumBookmarkFromLine(const std::string& line,
} // namespace bookmark_html_reader
-#endif // CHROME_BROWSER_IMPORTER_BOOKMARK_HTML_READER_H_
+#endif // CHROME_UTILITY_IMPORTER_BOOKMARK_HTML_READER_H_
diff --git a/chrome/browser/importer/bookmark_html_reader_unittest.cc b/chrome/utility/importer/bookmark_html_reader_unittest.cc
index 8374a12..72f42cf 100644
--- a/chrome/browser/importer/bookmark_html_reader_unittest.cc
+++ b/chrome/utility/importer/bookmark_html_reader_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/bookmark_html_reader.h"
+#include "chrome/utility/importer/bookmark_html_reader.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
diff --git a/chrome/browser/importer/bookmarks_file_importer.cc b/chrome/utility/importer/bookmarks_file_importer.cc
index 3a1c871..335bc9c 100644
--- a/chrome/browser/importer/bookmarks_file_importer.cc
+++ b/chrome/utility/importer/bookmarks_file_importer.cc
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/bookmarks_file_importer.h"
+#include "chrome/utility/importer/bookmarks_file_importer.h"
#include "base/bind.h"
-#include "chrome/browser/importer/bookmark_html_reader.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
-#include "chrome/browser/importer/importer_bridge.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_bridge.h"
#include "chrome/common/importer/importer_data_types.h"
+#include "chrome/utility/importer/bookmark_html_reader.h"
#include "grit/generated_resources.h"
namespace {
diff --git a/chrome/browser/importer/bookmarks_file_importer.h b/chrome/utility/importer/bookmarks_file_importer.h
index 46156d3..d2913ff 100644
--- a/chrome/browser/importer/bookmarks_file_importer.h
+++ b/chrome/utility/importer/bookmarks_file_importer.h
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_BOOKMARKS_FILE_IMPORTER_H_
-#define CHROME_BROWSER_IMPORTER_BOOKMARKS_FILE_IMPORTER_H_
+#ifndef CHROME_UTILITY_IMPORTER_BOOKMARKS_FILE_IMPORTER_H_
+#define CHROME_UTILITY_IMPORTER_BOOKMARKS_FILE_IMPORTER_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "chrome/browser/importer/importer.h"
+#include "chrome/utility/importer/importer.h"
// Importer for bookmarks files.
class BookmarksFileImporter : public Importer {
@@ -24,4 +24,4 @@ class BookmarksFileImporter : public Importer {
DISALLOW_COPY_AND_ASSIGN(BookmarksFileImporter);
};
-#endif // CHROME_BROWSER_IMPORTER_BOOKMARKS_FILE_IMPORTER_H_
+#endif // CHROME_UTILITY_IMPORTER_BOOKMARKS_FILE_IMPORTER_H_
diff --git a/chrome/browser/importer/external_process_importer_bridge.cc b/chrome/utility/importer/external_process_importer_bridge.cc
index 661491f..c0200fd 100644
--- a/chrome/browser/importer/external_process_importer_bridge.cc
+++ b/chrome/utility/importer/external_process_importer_bridge.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/external_process_importer_bridge.h"
+#include "chrome/utility/importer/external_process_importer_bridge.h"
#include "base/bind.h"
#include "base/logging.h"
@@ -17,10 +17,6 @@
#include "content/public/common/password_form.h"
#include "ipc/ipc_sender.h"
-#if defined(OS_WIN)
-#include "components/webdata/encryptor/ie7_password.h"
-#endif
-
namespace {
// Rather than sending all import items over IPC at once we chunk them into
diff --git a/chrome/browser/importer/external_process_importer_bridge.h b/chrome/utility/importer/external_process_importer_bridge.h
index 54031bd..badf248 100644
--- a/chrome/browser/importer/external_process_importer_bridge.h
+++ b/chrome/utility/importer/external_process_importer_bridge.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
-#define CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
+#ifndef CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
+#define CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
#include <string>
#include <vector>
@@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/importer/importer_bridge.h"
+#include "chrome/common/importer/importer_bridge.h"
class GURL;
struct ImportedBookmarkEntry;
@@ -98,4 +98,4 @@ class ExternalProcessImporterBridge : public ImporterBridge {
DISALLOW_COPY_AND_ASSIGN(ExternalProcessImporterBridge);
};
-#endif // CHROME_BROWSER_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
+#endif // CHROME_UTILITY_IMPORTER_EXTERNAL_PROCESS_IMPORTER_BRIDGE_H_
diff --git a/chrome/browser/importer/reencode_favicon.cc b/chrome/utility/importer/favicon_reencode.cc
index cbf26153..3743937 100644
--- a/chrome/browser/importer/reencode_favicon.cc
+++ b/chrome/utility/importer/favicon_reencode.cc
@@ -2,18 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/reencode_favicon.h"
+#include "chrome/utility/importer/favicon_reencode.h"
#include "content/public/child/image_decoder_utils.h"
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/favicon_size.h"
-#include "ui/gfx/size.h"
-bool ReencodeFavicon(const uint8* src_data,
+namespace importer {
+
+bool ReencodeFavicon(const unsigned char* src_data,
size_t src_len,
- std::vector<uint8>* png_data) {
+ std::vector<unsigned char>* png_data) {
// Decode the favicon using WebKit's image decoder.
SkBitmap decoded = content::DecodeImage(
src_data,
@@ -36,3 +37,5 @@ bool ReencodeFavicon(const uint8* src_data,
gfx::PNGCodec::EncodeBGRASkBitmap(decoded, false, png_data);
return true;
}
+
+} // namespace importer
diff --git a/chrome/browser/importer/reencode_favicon.h b/chrome/utility/importer/favicon_reencode.h
index b1b510a..5d6f647 100644
--- a/chrome/browser/importer/reencode_favicon.h
+++ b/chrome/utility/importer/favicon_reencode.h
@@ -2,17 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_REENCODE_FAVICON_H_
-#define CHROME_BROWSER_IMPORTER_REENCODE_FAVICON_H_
+#ifndef CHROME_UTILITY_IMPORTER_FAVICON_REENCODE_H_
+#define CHROME_UTILITY_IMPORTER_FAVICON_REENCODE_H_
#include <vector>
#include "base/basictypes.h"
+namespace importer {
+
// Given raw image data, decodes the icon, re-sampling to the correct size as
// necessary, and re-encodes as PNG data in the given output vector. Returns
// true on success.
-bool ReencodeFavicon(const uint8* src_data, size_t src_len,
- std::vector<uint8>* png_data);
+bool ReencodeFavicon(const unsigned char* src_data,
+ size_t src_len,
+ std::vector<unsigned char>* png_data);
+
+} // namespace importer
-#endif // CHROME_BROWSER_IMPORTER_REENCODE_FAVICON_H_
+#endif // CHROME_UTILITY_IMPORTER_FAVICON_REENCODE_H_
diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/utility/importer/firefox3_importer.cc
index 7a5c26a..bdc5559 100644
--- a/chrome/browser/importer/firefox3_importer.cc
+++ b/chrome/utility/importer/firefox3_importer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/firefox3_importer.h"
+#include "chrome/utility/importer/firefox3_importer.h"
#include <set>
@@ -13,25 +13,22 @@
#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/importer/bookmark_html_reader.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
-#include "chrome/browser/importer/importer_bridge.h"
-#include "chrome/browser/importer/nss_decryptor.h"
-#include "chrome/browser/importer/reencode_favicon.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_bridge.h"
#include "chrome/common/importer/importer_url_row.h"
#include "chrome/common/time_format.h"
-#include "content/public/browser/browser_thread.h"
+#include "chrome/utility/importer/bookmark_html_reader.h"
+#include "chrome/utility/importer/favicon_reencode.h"
+#include "chrome/utility/importer/nss_decryptor.h"
#include "content/public/common/password_form.h"
#include "grit/generated_resources.h"
#include "sql/connection.h"
#include "sql/statement.h"
#include "url/gurl.h"
-using content::BrowserThread;
-
namespace {
// Original definition is in http://mxr.mozilla.org/firefox/source/toolkit/
@@ -580,7 +577,7 @@ void Firefox3Importer::LoadFavicons(
if (data.empty())
continue; // Data definitely invalid.
- if (!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;
diff --git a/chrome/browser/importer/firefox3_importer.h b/chrome/utility/importer/firefox3_importer.h
index a609f80..b69dd476 100644
--- a/chrome/browser/importer/firefox3_importer.h
+++ b/chrome/utility/importer/firefox3_importer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_
-#define CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_
+#ifndef CHROME_UTILITY_IMPORTER_FIREFOX3_IMPORTER_H_
+#define CHROME_UTILITY_IMPORTER_FIREFOX3_IMPORTER_H_
#include <map>
#include <set>
@@ -13,7 +13,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
-#include "chrome/browser/importer/importer.h"
+#include "chrome/utility/importer/importer.h"
class GURL;
struct ImportedFaviconUsage;
@@ -86,4 +86,4 @@ class Firefox3Importer : public Importer {
DISALLOW_COPY_AND_ASSIGN(Firefox3Importer);
};
-#endif // CHROME_BROWSER_IMPORTER_FIREFOX3_IMPORTER_H_
+#endif // CHROME_UTILITY_IMPORTER_FIREFOX3_IMPORTER_H_
diff --git a/chrome/browser/importer/firefox_importer_unittest.cc b/chrome/utility/importer/firefox_importer_unittest.cc
index bdfa18f..50372e1 100644
--- a/chrome/browser/importer/firefox_importer_unittest.cc
+++ b/chrome/utility/importer/firefox_importer_unittest.cc
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "testing/gtest/include/gtest/gtest.h"
-
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/importer/firefox_importer_unittest_utils.h"
-#include "chrome/browser/importer/nss_decryptor.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/utility/importer/firefox_importer_unittest_utils.h"
+#include "chrome/utility/importer/nss_decryptor.h"
+#include "testing/gtest/include/gtest/gtest.h"
// TODO(jschuh): Disabled on Win64 build. http://crbug.com/179688
#if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
diff --git a/chrome/browser/importer/firefox_importer_unittest_messages_internal.h b/chrome/utility/importer/firefox_importer_unittest_messages_internal.h
index ce29947..ce29947 100644
--- a/chrome/browser/importer/firefox_importer_unittest_messages_internal.h
+++ b/chrome/utility/importer/firefox_importer_unittest_messages_internal.h
diff --git a/chrome/browser/importer/firefox_importer_unittest_utils.h b/chrome/utility/importer/firefox_importer_unittest_utils.h
index 480b09e..5bdbfa7 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils.h
+++ b/chrome/utility/importer/firefox_importer_unittest_utils.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_
-#define CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_
+#ifndef CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_
+#define CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/process_util.h"
-#include "chrome/browser/importer/nss_decryptor.h"
+#include "chrome/utility/importer/nss_decryptor.h"
class FFDecryptorServerChannelListener;
@@ -86,4 +86,4 @@ string16 FFUnitTestDecryptorProxy::Decrypt(const std::string& crypt) {
}
#endif // !OS_MACOSX
-#endif // CHROME_BROWSER_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_
+#endif // CHROME_UTILITY_IMPORTER_FIREFOX_IMPORTER_UNITTEST_UTILS_H_
diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
index 33c877a..dfac596 100644
--- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc
+++ b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/firefox_importer_unittest_utils.h"
+#include "chrome/utility/importer/firefox_importer_unittest_utils.h"
#include "base/base_switches.h"
#include "base/bind.h"
@@ -11,7 +11,7 @@
#include "base/files/file_path.h"
#include "base/message_loop.h"
#include "base/test/test_timeouts.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_listener.h"
@@ -21,7 +21,7 @@
#include "testing/multiprocess_func_list.h"
#define IPC_MESSAGE_IMPL
-#include "chrome/browser/importer/firefox_importer_unittest_messages_internal.h"
+#include "chrome/utility/importer/firefox_importer_unittest_messages_internal.h"
namespace {
@@ -39,7 +39,7 @@ bool LaunchNSSDecrypterChildProcess(const base::FilePath& nss_path,
cl.AppendSwitchASCII(switches::kTestChildProcess, "NSSDecrypterChildProcess");
// Set env variable needed for FF encryption libs to load.
- // See "chrome/browser/importer/nss_decryptor_mac.mm" for an explanation of
+ // See "chrome/utility/importer/nss_decryptor_mac.mm" for an explanation of
// why we need this.
base::EnvironmentVector env;
std::pair<std::string, std::string> dyld_override;
diff --git a/chrome/browser/importer/firefox_importer_utils_unittest.cc b/chrome/utility/importer/firefox_importer_utils_unittest.cc
index b393d71..bc9b40e 100644
--- a/chrome/browser/importer/firefox_importer_utils_unittest.cc
+++ b/chrome/utility/importer/firefox_importer_utils_unittest.cc
@@ -4,7 +4,7 @@
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/utility/importer/ie_importer_win.cc
index 934e815..76c350d 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/utility/importer/ie_importer_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/ie_importer.h"
+#include "chrome/utility/importer/ie_importer_win.h"
#include <ole2.h>
#include <intshcut.h>
@@ -29,16 +29,16 @@
#include "base/win/scoped_handle.h"
#include "base/win/scoped_propvariant.h"
#include "base/win/windows_version.h"
-#include "chrome/browser/importer/ie_importer_utils_win.h"
-#include "chrome/browser/importer/importer_bridge.h"
-#include "chrome/browser/importer/pstore_declarations.h"
-#include "chrome/browser/importer/reencode_favicon.h"
+#include "chrome/common/importer/ie_importer_utils_win.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_bridge.h"
#include "chrome/common/importer/importer_data_types.h"
#include "chrome/common/importer/importer_url_row.h"
+#include "chrome/common/importer/pstore_declarations.h"
#include "chrome/common/time_format.h"
#include "chrome/common/url_constants.h"
+#include "chrome/utility/importer/favicon_reencode.h"
#include "content/public/common/password_form.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -360,8 +360,9 @@ bool ReadReencodedFaviconData(const string16& file,
return false;
}
- return ReencodeFavicon(reinterpret_cast<const uint8*>(image_data.c_str()),
- image_data.size(), data);
+ const unsigned char* ptr =
+ reinterpret_cast<const unsigned char*>(image_data.c_str());
+ return importer::ReencodeFavicon(ptr, image_data.size(), data);
}
// Loads favicon image data and registers to |favicon_map|.
diff --git a/chrome/browser/importer/ie_importer.h b/chrome/utility/importer/ie_importer_win.h
index c96200c..db22a22 100644
--- a/chrome/browser/importer/ie_importer.h
+++ b/chrome/utility/importer/ie_importer_win.h
@@ -1,87 +1,87 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_
-#define CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_
-
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/files/file_path.h"
-#include "base/gtest_prod_util.h"
-#include "base/strings/string16.h"
-#include "chrome/browser/importer/importer.h"
-
-struct ImportedBookmarkEntry;
-struct ImportedFaviconUsage;
-
-class IEImporter : public Importer {
- public:
- IEImporter();
-
- // Importer:
- virtual void StartImport(const importer::SourceProfile& source_profile,
- uint16 items,
- ImporterBridge* bridge) OVERRIDE;
-
- private:
- typedef std::vector<ImportedBookmarkEntry> BookmarkVector;
-
- // A struct that hosts the information of IE Favorite folder.
- struct FavoritesInfo {
- base::FilePath path;
- string16 links_folder;
- };
-
- // IE PStore subkey GUID: AutoComplete password & form data.
- static const GUID kPStoreAutocompleteGUID;
-
- // A fake GUID for unit test.
- static const GUID kUnittestGUID;
-
- FRIEND_TEST_ALL_PREFIXES(ImporterTest, IEImporter);
-
- virtual ~IEImporter();
-
- void ImportFavorites();
-
- // Reads history information from COM interface.
- void ImportHistory();
-
- // Import password for IE6 stored in protected storage.
- void ImportPasswordsIE6();
-
- // Import password for IE7 and IE8 stored in Storage2.
- void ImportPasswordsIE7();
-
- void ImportSearchEngines();
-
- // Import the homepage setting of IE. Note: IE supports multiple home pages,
- // whereas Chrome doesn't, so we import only the one defined under the
- // 'Start Page' registry key. We don't import if the homepage is set to the
- // machine default.
- void ImportHomepage();
-
- // Gets the information of Favorites folder. Returns true if successful.
- bool GetFavoritesInfo(FavoritesInfo* info);
-
- // This function will read the files in the Favorites folder, and store
- // the bookmark items in |bookmarks| and favicon information in |favicons|.
- void ParseFavoritesFolder(
- const FavoritesInfo& info,
- BookmarkVector* bookmarks,
- std::vector<ImportedFaviconUsage>* favicons);
-
- // Determines which version of IE is in use.
- int CurrentIEVersion() const;
-
- // IE does not have source path. It's used in unit tests only for providing a
- // fake source.
- base::FilePath source_path_;
-
- DISALLOW_COPY_AND_ASSIGN(IEImporter);
-};
-
-#endif // CHROME_BROWSER_IMPORTER_IE_IMPORTER_H_
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_UTILITY_IMPORTER_IE_IMPORTER_WIN_H_
+#define CHROME_UTILITY_IMPORTER_IE_IMPORTER_WIN_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/files/file_path.h"
+#include "base/gtest_prod_util.h"
+#include "base/strings/string16.h"
+#include "chrome/utility/importer/importer.h"
+
+struct ImportedBookmarkEntry;
+struct ImportedFaviconUsage;
+
+class IEImporter : public Importer {
+ public:
+ IEImporter();
+
+ // Importer:
+ virtual void StartImport(const importer::SourceProfile& source_profile,
+ uint16 items,
+ ImporterBridge* bridge) OVERRIDE;
+
+ private:
+ typedef std::vector<ImportedBookmarkEntry> BookmarkVector;
+
+ // A struct that hosts the information of IE Favorite folder.
+ struct FavoritesInfo {
+ base::FilePath path;
+ string16 links_folder;
+ };
+
+ // IE PStore subkey GUID: AutoComplete password & form data.
+ static const GUID kPStoreAutocompleteGUID;
+
+ // A fake GUID for unit test.
+ static const GUID kUnittestGUID;
+
+ FRIEND_TEST_ALL_PREFIXES(ImporterTest, IEImporter);
+
+ virtual ~IEImporter();
+
+ void ImportFavorites();
+
+ // Reads history information from COM interface.
+ void ImportHistory();
+
+ // Import password for IE6 stored in protected storage.
+ void ImportPasswordsIE6();
+
+ // Import password for IE7 and IE8 stored in Storage2.
+ void ImportPasswordsIE7();
+
+ void ImportSearchEngines();
+
+ // Import the homepage setting of IE. Note: IE supports multiple home pages,
+ // whereas Chrome doesn't, so we import only the one defined under the
+ // 'Start Page' registry key. We don't import if the homepage is set to the
+ // machine default.
+ void ImportHomepage();
+
+ // Gets the information of Favorites folder. Returns true if successful.
+ bool GetFavoritesInfo(FavoritesInfo* info);
+
+ // This function will read the files in the Favorites folder, and store
+ // the bookmark items in |bookmarks| and favicon information in |favicons|.
+ void ParseFavoritesFolder(
+ const FavoritesInfo& info,
+ BookmarkVector* bookmarks,
+ std::vector<ImportedFaviconUsage>* favicons);
+
+ // Determines which version of IE is in use.
+ int CurrentIEVersion() const;
+
+ // IE does not have source path. It's used in unit tests only for providing a
+ // fake source.
+ base::FilePath source_path_;
+
+ DISALLOW_COPY_AND_ASSIGN(IEImporter);
+};
+
+#endif // CHROME_UTILITY_IMPORTER_IE_IMPORTER_WIN_H_
diff --git a/chrome/browser/importer/importer.cc b/chrome/utility/importer/importer.cc
index a1133a5..8da3b79 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/utility/importer/importer.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/importer.h"
+#include "chrome/utility/importer/importer.h"
-#include "chrome/browser/importer/importer_bridge.h"
+#include "chrome/common/importer/importer_bridge.h"
void Importer::Cancel() {
cancelled_ = true;
diff --git a/chrome/browser/importer/importer.h b/chrome/utility/importer/importer.h
index a2f2340..36483e0 100644
--- a/chrome/browser/importer/importer.h
+++ b/chrome/utility/importer/importer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_IMPORTER_H_
-#define CHROME_BROWSER_IMPORTER_IMPORTER_H_
+#ifndef CHROME_UTILITY_IMPORTER_IMPORTER_H_
+#define CHROME_UTILITY_IMPORTER_IMPORTER_H_
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
@@ -45,4 +45,4 @@ class Importer : public base::RefCountedThreadSafe<Importer> {
DISALLOW_COPY_AND_ASSIGN(Importer);
};
-#endif // CHROME_BROWSER_IMPORTER_IMPORTER_H_
+#endif // CHROME_UTILITY_IMPORTER_IMPORTER_H_
diff --git a/chrome/utility/importer/importer_creator.cc b/chrome/utility/importer/importer_creator.cc
new file mode 100644
index 0000000..bba1c34
--- /dev/null
+++ b/chrome/utility/importer/importer_creator.cc
@@ -0,0 +1,44 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/utility/importer/importer_creator.h"
+
+#include "base/logging.h"
+#include "chrome/utility/importer/bookmarks_file_importer.h"
+#include "chrome/utility/importer/firefox3_importer.h"
+
+#if defined(OS_WIN)
+#include "chrome/utility/importer/ie_importer_win.h"
+#endif
+
+#if defined(OS_MACOSX)
+#include <CoreFoundation/CoreFoundation.h>
+
+#include "base/mac/foundation_util.h"
+#include "chrome/utility/importer/safari_importer.h"
+#endif
+
+namespace importer {
+
+Importer* CreateImporterByType(ImporterType type) {
+ switch (type) {
+#if defined(OS_WIN)
+ case TYPE_IE:
+ return new IEImporter();
+#endif
+ case TYPE_BOOKMARKS_FILE:
+ return new BookmarksFileImporter();
+ case TYPE_FIREFOX3:
+ return new Firefox3Importer();
+#if defined(OS_MACOSX)
+ case TYPE_SAFARI:
+ return new SafariImporter(base::mac::GetUserLibraryPath());
+#endif
+ default:
+ NOTREACHED();
+ return NULL;
+ }
+}
+
+} // namespace importer
diff --git a/chrome/utility/importer/importer_creator.h b/chrome/utility/importer/importer_creator.h
new file mode 100644
index 0000000..40e0de5
--- /dev/null
+++ b/chrome/utility/importer/importer_creator.h
@@ -0,0 +1,19 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_UTILITY_IMPORTER_IMPORTER_CREATOR_H_
+#define CHROME_UTILITY_IMPORTER_IMPORTER_CREATOR_H_
+
+#include "chrome/common/importer/importer_type.h"
+
+class Importer;
+
+namespace importer {
+
+// Creates an Importer of the specified |type|.
+Importer* CreateImporterByType(ImporterType type);
+
+} // namespace importer
+
+#endif // CHROME_UTILITY_IMPORTER_IMPORTER_CREATOR_H_
diff --git a/chrome/browser/importer/nss_decryptor.cc b/chrome/utility/importer/nss_decryptor.cc
index 6388786..7f98e33 100644
--- a/chrome/browser/importer/nss_decryptor.cc
+++ b/chrome/utility/importer/nss_decryptor.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/nss_decryptor.h"
+#include "chrome/utility/importer/nss_decryptor.h"
#include <string>
#include <vector>
diff --git a/chrome/browser/importer/nss_decryptor.h b/chrome/utility/importer/nss_decryptor.h
index a7284d6..d3d309c 100644
--- a/chrome/browser/importer/nss_decryptor.h
+++ b/chrome/utility/importer/nss_decryptor.h
@@ -2,24 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_H_
-#define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_H_
+#ifndef CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_H_
+#define CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_H_
#include "build/build_config.h"
#if defined(OS_MACOSX)
-#include "chrome/browser/importer/nss_decryptor_mac.h"
+#include "chrome/utility/importer/nss_decryptor_mac.h"
#elif defined(OS_WIN)
-#include "chrome/browser/importer/nss_decryptor_win.h"
+#include "chrome/utility/importer/nss_decryptor_win.h"
#elif defined(USE_OPENSSL)
// TODO(joth): It should be an error to include this file with USE_OPENSSL
// defined. (Unless there is a way to do nss decrypt with OpenSSL). Ideally
// we remove the importers that depend on NSS when doing USE_OPENSSL builds, but
// that is going to take some non-trivial refactoring so in the meantime we're
// just falling back to a no-op implementation.
-#include "chrome/browser/importer/nss_decryptor_null.h"
+#include "chrome/utility/importer/nss_decryptor_null.h"
#elif defined(USE_NSS)
-#include "chrome/browser/importer/nss_decryptor_system_nss.h"
+#include "chrome/utility/importer/nss_decryptor_system_nss.h"
#endif
-#endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_H_
+#endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_H_
diff --git a/chrome/browser/importer/nss_decryptor_mac.h b/chrome/utility/importer/nss_decryptor_mac.h
index 918a227..eb902a1 100644
--- a/chrome/browser/importer/nss_decryptor_mac.h
+++ b/chrome/utility/importer/nss_decryptor_mac.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_
-#define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_
+#ifndef CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_MAC_H_
+#define CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_MAC_H_
#include <string>
#include <vector>
@@ -159,4 +159,4 @@ class NSSDecryptor {
DISALLOW_COPY_AND_ASSIGN(NSSDecryptor);
};
-#endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_MAC_H_
+#endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_MAC_H_
diff --git a/chrome/browser/importer/nss_decryptor_mac.mm b/chrome/utility/importer/nss_decryptor_mac.mm
index 7b45a12..c01e96e 100644
--- a/chrome/browser/importer/nss_decryptor_mac.mm
+++ b/chrome/utility/importer/nss_decryptor_mac.mm
@@ -10,8 +10,8 @@
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
-#include "chrome/browser/importer/firefox_importer_utils.h"
-#include "chrome/browser/importer/nss_decryptor_mac.h"
+#include "chrome/common/importer/firefox_importer_utils.h"
+#include "chrome/utility/importer/nss_decryptor_mac.h"
// Important!! : On OS X the nss3 libraries are compiled with depedencies
// on one another, referenced using dyld's @executable_path directive.
diff --git a/chrome/browser/importer/nss_decryptor_null.h b/chrome/utility/importer/nss_decryptor_null.h
index a9e6d3b..6e6fb8f 100644
--- a/chrome/browser/importer/nss_decryptor_null.h
+++ b/chrome/utility/importer/nss_decryptor_null.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_NULL_H_
-#define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_NULL_H_
+#ifndef CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_NULL_H_
+#define CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_NULL_H_
#include <string>
#include <vector>
@@ -24,7 +24,9 @@ struct PasswordForm;
class NSSDecryptor {
public:
NSSDecryptor() {}
- bool Init(const base::FilePath& dll_path, const base::FilePath& db_path) { return false; }
+ bool Init(const base::FilePath& dll_path, const base::FilePath& db_path) {
+ return false;
+ }
string16 Decrypt(const std::string& crypt) const { return string16(); }
void ParseSignons(const std::string& content,
std::vector<content::PasswordForm>* forms) {}
@@ -37,4 +39,4 @@ class NSSDecryptor {
DISALLOW_COPY_AND_ASSIGN(NSSDecryptor);
};
-#endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_NULL_H_
+#endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_NULL_H_
diff --git a/chrome/browser/importer/nss_decryptor_system_nss.cc b/chrome/utility/importer/nss_decryptor_system_nss.cc
index 9c12fed43..c6b3cbc 100644
--- a/chrome/browser/importer/nss_decryptor_system_nss.cc
+++ b/chrome/utility/importer/nss_decryptor_system_nss.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/nss_decryptor_system_nss.h"
+#include "chrome/utility/importer/nss_decryptor_system_nss.h"
#include <pk11pub.h>
#include <pk11sdr.h>
diff --git a/chrome/browser/importer/nss_decryptor_system_nss.h b/chrome/utility/importer/nss_decryptor_system_nss.h
index b71b500..3cdaa36 100644
--- a/chrome/browser/importer/nss_decryptor_system_nss.h
+++ b/chrome/utility/importer/nss_decryptor_system_nss.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_
-#define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_
+#ifndef CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_
+#define CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_
#include <secmodt.h>
#include <string>
@@ -59,4 +59,4 @@ class NSSDecryptor {
DISALLOW_COPY_AND_ASSIGN(NSSDecryptor);
};
-#endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_
+#endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_SYSTEM_NSS_H_
diff --git a/chrome/browser/importer/nss_decryptor_win.cc b/chrome/utility/importer/nss_decryptor_win.cc
index a426ce0..28baf28 100644
--- a/chrome/browser/importer/nss_decryptor_win.cc
+++ b/chrome/utility/importer/nss_decryptor_win.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/nss_decryptor_win.h"
+#include "chrome/utility/importer/nss_decryptor_win.h"
#include "base/files/file_path.h"
#include "base/strings/sys_string_conversions.h"
diff --git a/chrome/browser/importer/nss_decryptor_win.h b/chrome/utility/importer/nss_decryptor_win.h
index d8b208f..130778c 100644
--- a/chrome/browser/importer/nss_decryptor_win.h
+++ b/chrome/utility/importer/nss_decryptor_win.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_
-#define CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_
+#ifndef CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_WIN_H_
+#define CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_WIN_H_
#include <string>
#include <vector>
@@ -175,4 +175,4 @@ class NSSDecryptor {
DISALLOW_COPY_AND_ASSIGN(NSSDecryptor);
};
-#endif // CHROME_BROWSER_IMPORTER_NSS_DECRYPTOR_WIN_H_
+#endif // CHROME_UTILITY_IMPORTER_NSS_DECRYPTOR_WIN_H_
diff --git a/chrome/browser/importer/safari_importer.h b/chrome/utility/importer/safari_importer.h
index fd83083..8b346d2 100644
--- a/chrome/browser/importer/safari_importer.h
+++ b/chrome/utility/importer/safari_importer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_IMPORTER_SAFARI_IMPORTER_H_
-#define CHROME_BROWSER_IMPORTER_SAFARI_IMPORTER_H_
+#ifndef CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_
+#define CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_
#include <map>
#include <set>
@@ -13,9 +13,8 @@
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
-#include "chrome/browser/history/history_types.h"
-#include "chrome/browser/importer/importer.h"
#include "chrome/common/importer/importer_url_row.h"
+#include "chrome/utility/importer/importer.h"
#if __OBJC__
@class NSDictionary;
@@ -29,10 +28,6 @@ class GURL;
struct ImportedBookmarkEntry;
struct ImportedFaviconUsage;
-namespace history {
-class URLRow;
-}
-
namespace sql {
class Connection;
}
@@ -49,13 +44,13 @@ class SafariImporter : public Importer {
uint16 items,
ImporterBridge* bridge) OVERRIDE;
- // Does this user account have a Safari Profile and if so, what items
- // are supported?
- // in: library_dir - ~/Library or a standin for testing purposes.
- // out: services_supported - the service supported for import.
- // Returns true if we can import the Safari profile.
- static bool CanImport(const base::FilePath& library_dir,
- uint16* services_supported);
+ // Does this user account have a Safari Profile and if so, what items
+ // are supported?
+ // in: library_dir - ~/Library or a standin for testing purposes.
+ // out: services_supported - the service supported for import.
+ // Returns true if we can import the Safari profile.
+ static bool CanImport(const base::FilePath& library_dir,
+ uint16* services_supported);
private:
FRIEND_TEST_ALL_PREFIXES(SafariImporterTest, BookmarkImport);
@@ -112,4 +107,4 @@ class SafariImporter : public Importer {
DISALLOW_COPY_AND_ASSIGN(SafariImporter);
};
-#endif // CHROME_BROWSER_IMPORTER_SAFARI_IMPORTER_H_
+#endif // CHROME_UTILITY_IMPORTER_SAFARI_IMPORTER_H_
diff --git a/chrome/browser/importer/safari_importer.mm b/chrome/utility/importer/safari_importer.mm
index 4a5de0d..8740742 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/importer/importer_bridge.h"
-#include "chrome/browser/importer/reencode_favicon.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_bridge.h"
#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"
@@ -176,7 +176,7 @@ void SafariImporter::LoadFaviconData(
if (data.empty())
continue; // Data definitely invalid.
- if (!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;
diff --git a/chrome/browser/importer/safari_importer_unittest.mm b/chrome/utility/importer/safari_importer_unittest.mm
index a5aae66..05392a4 100644
--- a/chrome/browser/importer/safari_importer_unittest.mm
+++ b/chrome/utility/importer/safari_importer_unittest.mm
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/importer/safari_importer.h"
+#include "chrome/utility/importer/safari_importer.h"
#include "base/basictypes.h"
#include "base/file_util.h"
@@ -13,10 +13,11 @@
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
+#include "chrome/common/importer/importer_bridge.h"
+#include "chrome/utility/importer/safari_importer.h"
#include "sql/connection.h"
#include "testing/platform_test.h"
diff --git a/chrome/utility/profile_import_handler.cc b/chrome/utility/profile_import_handler.cc
index 99ab420..457269d 100644
--- a/chrome/utility/profile_import_handler.cc
+++ b/chrome/utility/profile_import_handler.cc
@@ -8,10 +8,10 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop_proxy.h"
#include "base/threading/thread.h"
-#include "chrome/browser/importer/external_process_importer_bridge.h"
-#include "chrome/browser/importer/importer.h"
-#include "chrome/browser/importer/importer_creator.h"
#include "chrome/common/importer/profile_import_process_messages.h"
+#include "chrome/utility/importer/external_process_importer_bridge.h"
+#include "chrome/utility/importer/importer.h"
+#include "chrome/utility/importer/importer_creator.h"
#include "content/public/utility/utility_thread.h"
namespace chrome {
diff --git a/chrome/browser/importer/ie_importer_unittest_win.cc b/components/webdata/encryptor/ie7_password_unittest_win.cc
index df16ade..37021e8 100644
--- a/chrome/browser/importer/ie_importer_unittest_win.cc
+++ b/components/webdata/encryptor/ie7_password_unittest_win.cc
@@ -11,7 +11,7 @@
#include "base/strings/string16.h"
#include "components/webdata/encryptor/ie7_password.h"
-TEST(IEImporterTest, IE7Importer) {
+TEST(IE7PasswordTest, GetUserPassword) {
// This is the unencrypted values of my keys under Storage2.
// The passwords have been manually changed to abcdef... but the size remains
// the same.
diff --git a/tools/sort-headers.py b/tools/sort-headers.py
index 3771b77..42a8be8 100755
--- a/tools/sort-headers.py
+++ b/tools/sort-headers.py
@@ -55,8 +55,6 @@ def IncludeCompareKey(line):
return '1' + line
if line.startswith('<unknwn.h>'): # Must be before e.g. intshcut.h
return '1' + line
- if line.startswith('<ole2.h>'): # Must be before e.g. intshcut.h
- return '1' + line
# C++ system headers should come after C system headers.
if line.startswith('<'):