Commit d30213ce authored by gab@chromium.org's avatar gab@chromium.org

OOP import on Linux (i.e., on all platforms since Linux is the only one left!).

After this CL the only blocker to completely remove the in-process import code will be the toolbar importer on Windows (http://crbug.com/243423).

BUG=56816
TEST=Manually verify that first run import works (i.e. imports FF history when FF is default) on Linux.

Review URL: https://chromiumcodereview.appspot.com/17379006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208054 0039d316-1c4b-4281-b951-d872f2087c98
parent 5acc2bc6
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extensions_quota_service.h" #include "chrome/browser/extensions/extensions_quota_service.h"
#include "chrome/browser/importer/external_process_importer_host.h"
#include "chrome/browser/importer/importer_data_types.h" #include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/importer/importer_host.h"
#include "chrome/browser/importer/importer_type.h" #include "chrome/browser/importer/importer_type.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/browser/ui/chrome_select_file_policy.h"
...@@ -979,7 +979,7 @@ void BookmarksImportFunction::FileSelected(const base::FilePath& path, ...@@ -979,7 +979,7 @@ void BookmarksImportFunction::FileSelected(const base::FilePath& path,
// TODO(jgreenwald): remove ifdef once extensions are no longer built on // TODO(jgreenwald): remove ifdef once extensions are no longer built on
// Android. // Android.
// Deletes itself. // Deletes itself.
ImporterHost* importer_host = new ImporterHost; ImporterHost* importer_host = new ExternalProcessImporterHost;
importer::SourceProfile source_profile; importer::SourceProfile source_profile;
source_profile.importer_type = importer::TYPE_BOOKMARKS_FILE; source_profile.importer_type = importer::TYPE_BOOKMARKS_FILE;
source_profile.source_path = path; source_profile.source_path = path;
......
...@@ -677,15 +677,7 @@ void AutoImport( ...@@ -677,15 +677,7 @@ void AutoImport(
int dont_import_items, int dont_import_items,
const std::string& import_bookmarks_path) { const std::string& import_bookmarks_path) {
// Deletes itself. // Deletes itself.
ImporterHost* importer_host; ImporterHost* importer_host = new ExternalProcessImporterHost;
// TODO(csilv,mirandac): Out-of-process import has only been qualified on
// MacOS X and Windows, so we will only use it on those platforms.
// Linux still uses the in-process import (http://crbug.com/56816).
#if defined(OS_MACOSX) || defined(OS_WIN)
importer_host = new ExternalProcessImporterHost;
#else
importer_host = new ImporterHost;
#endif
base::FilePath local_state_path; base::FilePath local_state_path;
PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
...@@ -753,14 +745,7 @@ void AutoImport( ...@@ -753,14 +745,7 @@ void AutoImport(
if (!import_bookmarks_path.empty()) { if (!import_bookmarks_path.empty()) {
// Deletes itself. // Deletes itself.
ImporterHost* file_importer_host; ImporterHost* file_importer_host = new ExternalProcessImporterHost;
// TODO(gab): Make Linux use OOP import as well (http://crbug.com/56816) and
// get rid of these ugly ifdefs.
#if defined(OS_MACOSX) || defined(OS_WIN)
file_importer_host = new ExternalProcessImporterHost;
#else
file_importer_host = new ImporterHost;
#endif
file_importer_host->set_headless(); file_importer_host->set_headless();
ImportFromFile(profile, file_importer_host, import_bookmarks_path); ImportFromFile(profile, file_importer_host, import_bookmarks_path);
......
...@@ -64,6 +64,7 @@ void ExternalProcessImporterClient::Cancel() { ...@@ -64,6 +64,7 @@ void ExternalProcessImporterClient::Cancel() {
} }
void ExternalProcessImporterClient::OnProcessCrashed(int exit_code) { void ExternalProcessImporterClient::OnProcessCrashed(int exit_code) {
DLOG(ERROR) << __FUNCTION__;
if (cancelled_) if (cancelled_)
return; return;
......
...@@ -269,13 +269,7 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest { ...@@ -269,13 +269,7 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest {
items = items | importer::SEARCH_ENGINES; items = items | importer::SEARCH_ENGINES;
// Deletes itself. // Deletes itself.
// TODO(gab): Use ExternalProcessImporterHost on Linux as well. ImporterHost* host = new ExternalProcessImporterHost;
ImporterHost* host;
#if defined(OS_MACOSX) || defined(OS_WIN)
host = new ExternalProcessImporterHost;
#else
host = new ImporterHost;
#endif
host->SetObserver(observer); host->SetObserver(observer);
host->StartImportSettings(source_profile, host->StartImportSettings(source_profile,
browser()->profile(), browser()->profile(),
......
...@@ -111,9 +111,6 @@ void ImportDataHandler::ImportData(const ListValue* args) { ...@@ -111,9 +111,6 @@ void ImportDataHandler::ImportData(const ListValue* args) {
state); state);
import_did_succeed_ = false; import_did_succeed_ = false;
// TODO(gab): Make Linux use OOP import as well (http://crbug.com/56816) and
// get rid of these ugly ifdefs.
#if defined(OS_MACOSX) || defined(OS_WIN)
// The Google Toolbar importer doesn't work for the out-of-process import. // The Google Toolbar importer doesn't work for the out-of-process import.
// This is the only entry point for this importer (it is never used on first // This is the only entry point for this importer (it is never used on first
// run). See discussion on http://crbug.com/219419 for details. // run). See discussion on http://crbug.com/219419 for details.
...@@ -121,9 +118,6 @@ void ImportDataHandler::ImportData(const ListValue* args) { ...@@ -121,9 +118,6 @@ void ImportDataHandler::ImportData(const ListValue* args) {
importer_host_ = new ImporterHost; importer_host_ = new ImporterHost;
else else
importer_host_ = new ExternalProcessImporterHost; importer_host_ = new ExternalProcessImporterHost;
#else
importer_host_ = new ImporterHost;
#endif
importer_host_->SetObserver(this); importer_host_->SetObserver(this);
importer_host_->set_browser( importer_host_->set_browser(
chrome::FindBrowserWithWebContents(web_ui()->GetWebContents())); chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment