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

Unified Diff: chrome/browser/importer/in_process_importer_bridge.cc

Issue 18501013: Move most importer code to chrome/utility/importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac4 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
Index: chrome/browser/importer/in_process_importer_bridge.cc
diff --git a/chrome/browser/importer/in_process_importer_bridge.cc b/chrome/browser/importer/in_process_importer_bridge.cc
index 218a72645d3ae0646c00e87c715ad55230cb2433..7b4b3f281214773582966bef49feb8af68350ebc 100644
--- a/chrome/browser/importer/in_process_importer_bridge.cc
+++ b/chrome/browser/importer/in_process_importer_bridge.cc
@@ -43,6 +43,22 @@ history::URLRows ConvertImporterURLRowsToHistoryURLRows(
return converted;
}
+history::VisitSource ConvertImporterVisitSourceToHistoryVisitSource(
+ ImporterVisitSource visit_source) {
+ switch (visit_source) {
+ case IMPORTER_VISIT_SOURCE_BROWSED:
+ return history::SOURCE_BROWSED;
+ case IMPORTER_VISIT_SOURCE_FIREFOX_IMPORTED:
+ return history::SOURCE_FIREFOX_IMPORTED;
+ case IMPORTER_VISIT_SOURCE_IE_IMPORTED:
+ return history::SOURCE_IE_IMPORTED;
+ case IMPORTER_VISIT_SOURCE_SAFARI_IMPORTED:
+ return history::SOURCE_SAFARI_IMPORTED;
+ };
+ NOTREACHED();
+ return history::SOURCE_SYNCED;
+}
+
} // namespace
using content::BrowserThread;
@@ -187,13 +203,17 @@ void InProcessImporterBridge::SetFavicons(
void InProcessImporterBridge::SetHistoryItems(
const std::vector<ImporterURLRow>& rows,
- history::VisitSource visit_source) {
- history::URLRows converted = ConvertImporterURLRowsToHistoryURLRows(rows);
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(
- &ProfileWriter::AddHistoryPage, writer_, converted, visit_source));
+ ImporterVisitSource visit_source) {
gab 2013/07/08 15:18:08 Can you introduce this new ImporterVisitSource in
scottmg 2013/07/09 16:20:49 Done.
+ history::URLRows converted_rows =
+ ConvertImporterURLRowsToHistoryURLRows(rows);
+ history::VisitSource converted_visit_source =
+ ConvertImporterVisitSourceToHistoryVisitSource(visit_source);
+ BrowserThread::PostTask(BrowserThread::UI,
+ FROM_HERE,
+ base::Bind(&ProfileWriter::AddHistoryPage,
+ writer_,
+ converted_rows,
+ converted_visit_source));
}
void InProcessImporterBridge::SetKeywords(

Powered by Google App Engine
This is Rietveld 408576698