| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/importer/importer_bridge.h" | 5 #include "chrome/browser/importer/importer_bridge.h" |
| 6 | 6 |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/string16.h" | 8 #include "base/string16.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 void InProcessImporterBridge::AddIE7PasswordInfo( | 51 void InProcessImporterBridge::AddIE7PasswordInfo( |
| 52 const IE7PasswordInfo password_info) { | 52 const IE7PasswordInfo password_info) { |
| 53 BrowserThread::PostTask( | 53 BrowserThread::PostTask( |
| 54 BrowserThread::UI, FROM_HERE, | 54 BrowserThread::UI, FROM_HERE, |
| 55 NewRunnableMethod(writer_, &ProfileWriter::AddIE7PasswordInfo, | 55 NewRunnableMethod(writer_, &ProfileWriter::AddIE7PasswordInfo, |
| 56 password_info)); | 56 password_info)); |
| 57 } | 57 } |
| 58 #endif // OS_WIN | 58 #endif // OS_WIN |
| 59 | 59 |
| 60 void InProcessImporterBridge::SetFavicons( | 60 void InProcessImporterBridge::SetFavicons( |
| 61 const std::vector<history::ImportedFavIconUsage>& fav_icons) { | 61 const std::vector<history::ImportedFavIconUsage>& favicons) { |
| 62 BrowserThread::PostTask( | 62 BrowserThread::PostTask( |
| 63 BrowserThread::UI, FROM_HERE, | 63 BrowserThread::UI, FROM_HERE, |
| 64 NewRunnableMethod(writer_, &ProfileWriter::AddFavicons, fav_icons)); | 64 NewRunnableMethod(writer_, &ProfileWriter::AddFavicons, favicons)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void InProcessImporterBridge::SetHistoryItems( | 67 void InProcessImporterBridge::SetHistoryItems( |
| 68 const std::vector<history::URLRow> &rows, | 68 const std::vector<history::URLRow> &rows, |
| 69 history::VisitSource visit_source) { | 69 history::VisitSource visit_source) { |
| 70 BrowserThread::PostTask( | 70 BrowserThread::PostTask( |
| 71 BrowserThread::UI, FROM_HERE, | 71 BrowserThread::UI, FROM_HERE, |
| 72 NewRunnableMethod(writer_, &ProfileWriter::AddHistoryPage, | 72 NewRunnableMethod(writer_, &ProfileWriter::AddHistoryPage, |
| 73 rows, visit_source)); | 73 rows, visit_source)); |
| 74 } | 74 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
| 148 void ExternalProcessImporterBridge::AddIE7PasswordInfo( | 148 void ExternalProcessImporterBridge::AddIE7PasswordInfo( |
| 149 const IE7PasswordInfo password_info) { | 149 const IE7PasswordInfo password_info) { |
| 150 NOTIMPLEMENTED(); | 150 NOTIMPLEMENTED(); |
| 151 } | 151 } |
| 152 #endif | 152 #endif |
| 153 | 153 |
| 154 void ExternalProcessImporterBridge::SetFavicons( | 154 void ExternalProcessImporterBridge::SetFavicons( |
| 155 const std::vector<history::ImportedFavIconUsage>& fav_icons) { | 155 const std::vector<history::ImportedFavIconUsage>& favicons) { |
| 156 profile_import_thread_->NotifyFavIconsImportReady(fav_icons); | 156 profile_import_thread_->NotifyFavIconsImportReady(favicons); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void ExternalProcessImporterBridge::SetHistoryItems( | 159 void ExternalProcessImporterBridge::SetHistoryItems( |
| 160 const std::vector<history::URLRow> &rows, | 160 const std::vector<history::URLRow> &rows, |
| 161 history::VisitSource visit_source) { | 161 history::VisitSource visit_source) { |
| 162 profile_import_thread_->NotifyHistoryImportReady(rows, visit_source); | 162 profile_import_thread_->NotifyHistoryImportReady(rows, visit_source); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ExternalProcessImporterBridge::SetKeywords( | 165 void ExternalProcessImporterBridge::SetKeywords( |
| 166 const std::vector<TemplateURL*>& template_urls, | 166 const std::vector<TemplateURL*>& template_urls, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 194 | 194 |
| 195 // TODO(viettrungluu): convert to string16. | 195 // TODO(viettrungluu): convert to string16. |
| 196 std::wstring ExternalProcessImporterBridge::GetLocalizedString( | 196 std::wstring ExternalProcessImporterBridge::GetLocalizedString( |
| 197 int message_id) { | 197 int message_id) { |
| 198 string16 message; | 198 string16 message; |
| 199 localized_strings_->GetString(base::IntToString(message_id), &message); | 199 localized_strings_->GetString(base::IntToString(message_id), &message); |
| 200 return UTF16ToWideHack(message); | 200 return UTF16ToWideHack(message); |
| 201 } | 201 } |
| 202 | 202 |
| 203 ExternalProcessImporterBridge::~ExternalProcessImporterBridge() {} | 203 ExternalProcessImporterBridge::~ExternalProcessImporterBridge() {} |
| OLD | NEW |