| Index: chrome/browser/first_run/first_run_win.cc
|
| diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
|
| index f1c0cd387553b9b564337d1b5efae483ae8949c6..95c93f0f6d8ff74ca4fe3898e5ccdac9a2e78051 100644
|
| --- a/chrome/browser/first_run/first_run_win.cc
|
| +++ b/chrome/browser/first_run/first_run_win.cc
|
| @@ -25,11 +25,9 @@
|
| #include "base/win/object_watcher.h"
|
| #include "base/win/windows_version.h"
|
| #include "chrome/browser/browser_process.h"
|
| -#include "chrome/browser/first_run/first_run_import_observer.h"
|
| #include "chrome/browser/first_run/first_run_internal.h"
|
| #include "chrome/browser/importer/importer_host.h"
|
| #include "chrome/browser/importer/importer_list.h"
|
| -#include "chrome/browser/importer/importer_progress_dialog.h"
|
| #include "chrome/browser/process_singleton.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/shell_integration.h"
|
| @@ -283,7 +281,7 @@ bool DecodeImportParams(const std::string& encoded,
|
| #if !defined(USE_AURA)
|
| // Imports browser items in this process. The browser and the items to
|
| // import are encoded in the command line.
|
| -int ImportFromBrowser(Profile* profile,
|
| +bool ImportFromBrowser(Profile* profile,
|
| const CommandLine& cmdline) {
|
| std::string import_info = cmdline.GetSwitchValueASCII(switches::kImport);
|
| if (import_info.empty()) {
|
| @@ -299,7 +297,6 @@ int ImportFromBrowser(Profile* profile,
|
| return false;
|
| }
|
| scoped_refptr<ImporterHost> importer_host(new ImporterHost);
|
| - FirstRunImportObserver importer_observer;
|
|
|
| scoped_refptr<ImporterList> importer_list(new ImporterList(NULL));
|
| importer_list->DetectSourceProfilesHack();
|
| @@ -309,12 +306,20 @@ int ImportFromBrowser(Profile* profile,
|
| if (skip_first_run_ui)
|
| importer_host->set_headless();
|
|
|
| - importer::ShowImportProgressDialog(static_cast<uint16>(items_to_import),
|
| - importer_host, &importer_observer,
|
| + scoped_ptr<first_run::internal::ImportEndedObserver> observer(
|
| + new first_run::internal::ImportEndedObserver);
|
| + importer_host->SetObserver(observer.get());
|
| + importer_host->StartImportSettings(
|
| importer_list->GetSourceProfileForImporterType(importer_type), profile,
|
| - true);
|
| - importer_observer.RunLoop();
|
| - return importer_observer.import_result();
|
| + static_cast<uint16>(items_to_import), new ProfileWriter(profile), true);
|
| + // If the import process has not errored out, block on it.
|
| + if (!observer->ended()) {
|
| + observer->set_should_quit_message_loop();
|
| + MessageLoop::current()->Run();
|
| + }
|
| + // TODO(gab): This method will be go away as part of http://crbug.com/219419/,
|
| + // so it is fine to hardcode |true| here for now.
|
| + return true;
|
| }
|
| #endif // !defined(USE_AURA)
|
|
|
|
|