Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3769)

Unified Diff: chrome/utility/importer/importer_creator.cc

Issue 18501013: Move most importer code to chrome/utility/importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another gyp attempt Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/utility/importer/importer_creator.h ('k') | chrome/utility/importer/nss_decryptor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/importer_creator.cc
diff --git a/chrome/utility/importer/importer_creator.cc b/chrome/utility/importer/importer_creator.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bba1c34e8270242775ff8b33374a901d3f726bfb
--- /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
« no previous file with comments | « chrome/utility/importer/importer_creator.h ('k') | chrome/utility/importer/nss_decryptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698