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

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

Issue 10071036: RefCounted types should not have public destructors, chrome/browser/ part 6 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implementation fixes Created 8 years, 8 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/external_process_importer_client.cc
diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc
index dbc25cf13901dcc2b847810bf3ce9264964944ca..e66b6e058d514d579a724eb7430e90cb6540940f 100644
--- a/chrome/browser/importer/external_process_importer_client.cc
+++ b/chrome/browser/importer/external_process_importer_client.cc
@@ -38,29 +38,6 @@ ExternalProcessImporterClient::ExternalProcessImporterClient(
process_importer_host_->NotifyImportStarted();
}
-ExternalProcessImporterClient::~ExternalProcessImporterClient() {
-}
-
-void ExternalProcessImporterClient::CancelImportProcessOnIOThread() {
- if (utility_process_host_)
- utility_process_host_->Send(new ProfileImportProcessMsg_CancelImport());
-}
-
-void ExternalProcessImporterClient::NotifyItemFinishedOnIOThread(
- importer::ImportItem import_item) {
- utility_process_host_->Send(
- new ProfileImportProcessMsg_ReportImportItemFinished(import_item));
-}
-
-void ExternalProcessImporterClient::Cleanup() {
- if (cancelled_)
- return;
-
- if (process_importer_host_)
- process_importer_host_->NotifyImportEnded();
- Release();
-}
-
void ExternalProcessImporterClient::Start() {
AddRef(); // balanced in Cleanup.
BrowserThread::ID thread_id;
@@ -72,46 +49,6 @@ void ExternalProcessImporterClient::Start() {
thread_id));
}
-void ExternalProcessImporterClient::StartProcessOnIOThread(
- BrowserThread::ID thread_id) {
- utility_process_host_ =
- UtilityProcessHost::Create(this, thread_id)->AsWeakPtr();
- utility_process_host_->DisableSandbox();
-
-#if defined(OS_MACOSX)
- base::EnvironmentVector env;
- std::string dylib_path = GetFirefoxDylibPath().value();
- if (!dylib_path.empty())
- env.push_back(std::make_pair("DYLD_FALLBACK_LIBRARY_PATH", dylib_path));
- utility_process_host_->SetEnv(env);
-#endif
-
- // Dictionary of all localized strings that could be needed by the importer
- // in the external process.
- DictionaryValue localized_strings;
- localized_strings.SetString(
- base::IntToString(IDS_BOOKMARK_GROUP_FROM_FIREFOX),
- l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_FIREFOX));
- localized_strings.SetString(
- base::IntToString(IDS_BOOKMARK_GROUP_FROM_SAFARI),
- l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_SAFARI));
- localized_strings.SetString(
- base::IntToString(IDS_IMPORT_FROM_FIREFOX),
- l10n_util::GetStringUTF8(IDS_IMPORT_FROM_FIREFOX));
- localized_strings.SetString(
- base::IntToString(IDS_IMPORT_FROM_GOOGLE_TOOLBAR),
- l10n_util::GetStringUTF8(IDS_IMPORT_FROM_GOOGLE_TOOLBAR));
- localized_strings.SetString(
- base::IntToString(IDS_IMPORT_FROM_SAFARI),
- l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI));
- localized_strings.SetString(
- base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME),
- l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME));
-
- utility_process_host_->Send(new ProfileImportProcessMsg_StartImport(
- source_profile_, items_, localized_strings));
-}
-
void ExternalProcessImporterClient::Cancel() {
if (cancelled_)
return;
@@ -298,3 +235,65 @@ void ExternalProcessImporterClient::OnKeywordsImportReady(
bridge_->SetKeywords(template_urls, unique_on_host_and_path);
// The pointers in |template_urls| have now been deleted.
}
+
+ExternalProcessImporterClient::~ExternalProcessImporterClient() {}
+
+void ExternalProcessImporterClient::Cleanup() {
+ if (cancelled_)
+ return;
+
+ if (process_importer_host_)
+ process_importer_host_->NotifyImportEnded();
+ Release();
+}
+
+void ExternalProcessImporterClient::CancelImportProcessOnIOThread() {
+ if (utility_process_host_)
+ utility_process_host_->Send(new ProfileImportProcessMsg_CancelImport());
+}
+
+void ExternalProcessImporterClient::NotifyItemFinishedOnIOThread(
+ importer::ImportItem import_item) {
+ utility_process_host_->Send(
+ new ProfileImportProcessMsg_ReportImportItemFinished(import_item));
+}
+
+void ExternalProcessImporterClient::StartProcessOnIOThread(
+ BrowserThread::ID thread_id) {
+ utility_process_host_ =
+ UtilityProcessHost::Create(this, thread_id)->AsWeakPtr();
+ utility_process_host_->DisableSandbox();
+
+#if defined(OS_MACOSX)
+ base::EnvironmentVector env;
+ std::string dylib_path = GetFirefoxDylibPath().value();
+ if (!dylib_path.empty())
+ env.push_back(std::make_pair("DYLD_FALLBACK_LIBRARY_PATH", dylib_path));
+ utility_process_host_->SetEnv(env);
+#endif
+
+ // Dictionary of all localized strings that could be needed by the importer
+ // in the external process.
+ DictionaryValue localized_strings;
+ localized_strings.SetString(
+ base::IntToString(IDS_BOOKMARK_GROUP_FROM_FIREFOX),
+ l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_FIREFOX));
+ localized_strings.SetString(
+ base::IntToString(IDS_BOOKMARK_GROUP_FROM_SAFARI),
+ l10n_util::GetStringUTF8(IDS_BOOKMARK_GROUP_FROM_SAFARI));
+ localized_strings.SetString(
+ base::IntToString(IDS_IMPORT_FROM_FIREFOX),
+ l10n_util::GetStringUTF8(IDS_IMPORT_FROM_FIREFOX));
+ localized_strings.SetString(
+ base::IntToString(IDS_IMPORT_FROM_GOOGLE_TOOLBAR),
+ l10n_util::GetStringUTF8(IDS_IMPORT_FROM_GOOGLE_TOOLBAR));
+ localized_strings.SetString(
+ base::IntToString(IDS_IMPORT_FROM_SAFARI),
+ l10n_util::GetStringUTF8(IDS_IMPORT_FROM_SAFARI));
+ localized_strings.SetString(
+ base::IntToString(IDS_BOOKMARK_BAR_FOLDER_NAME),
+ l10n_util::GetStringUTF8(IDS_BOOKMARK_BAR_FOLDER_NAME));
+
+ utility_process_host_->Send(new ProfileImportProcessMsg_StartImport(
+ source_profile_, items_, localized_strings));
+}
« no previous file with comments | « chrome/browser/importer/external_process_importer_client.h ('k') | chrome/browser/importer/external_process_importer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698