| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 NewRunnableMethod(host_, &ImporterHost::ImportStarted)); | 110 NewRunnableMethod(host_, &ImporterHost::ImportStarted)); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void InProcessImporterBridge::NotifyEnded() { | 113 void InProcessImporterBridge::NotifyEnded() { |
| 114 BrowserThread::PostTask( | 114 BrowserThread::PostTask( |
| 115 BrowserThread::UI, FROM_HERE, | 115 BrowserThread::UI, FROM_HERE, |
| 116 NewRunnableMethod(host_, &ImporterHost::ImportEnded)); | 116 NewRunnableMethod(host_, &ImporterHost::ImportEnded)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 std::wstring InProcessImporterBridge::GetLocalizedString(int message_id) { | 119 std::wstring InProcessImporterBridge::GetLocalizedString(int message_id) { |
| 120 return l10n_util::GetString(message_id); | 120 return UTF16ToWideHack(l10n_util::GetStringUTF16(message_id)); |
| 121 } | 121 } |
| 122 | 122 |
| 123 InProcessImporterBridge::~InProcessImporterBridge() {} | 123 InProcessImporterBridge::~InProcessImporterBridge() {} |
| 124 | 124 |
| 125 ExternalProcessImporterBridge::ExternalProcessImporterBridge( | 125 ExternalProcessImporterBridge::ExternalProcessImporterBridge( |
| 126 ProfileImportThread* profile_import_thread, | 126 ProfileImportThread* profile_import_thread, |
| 127 const DictionaryValue& localized_strings) | 127 const DictionaryValue& localized_strings) |
| 128 : profile_import_thread_(profile_import_thread) { | 128 : profile_import_thread_(profile_import_thread) { |
| 129 // Bridge needs to make its own copy because OS 10.6 autoreleases the | 129 // Bridge needs to make its own copy because OS 10.6 autoreleases the |
| 130 // localized_strings value that is passed in (see http://crbug.com/46003 ). | 130 // localized_strings value that is passed in (see http://crbug.com/46003 ). |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 // TODO(viettrungluu): convert to string16. | 196 // TODO(viettrungluu): convert to string16. |
| 197 std::wstring ExternalProcessImporterBridge::GetLocalizedString( | 197 std::wstring ExternalProcessImporterBridge::GetLocalizedString( |
| 198 int message_id) { | 198 int message_id) { |
| 199 string16 message; | 199 string16 message; |
| 200 localized_strings_->GetString(base::IntToString(message_id), &message); | 200 localized_strings_->GetString(base::IntToString(message_id), &message); |
| 201 return UTF16ToWideHack(message); | 201 return UTF16ToWideHack(message); |
| 202 } | 202 } |
| 203 | 203 |
| 204 ExternalProcessImporterBridge::~ExternalProcessImporterBridge() {} | 204 ExternalProcessImporterBridge::~ExternalProcessImporterBridge() {} |
| OLD | NEW |